IsAntiArborescence - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

IsArborescence

  

test if a graph is an arborescence

  

IsAntiArborescence

  

test if a graph is an anti-arborescence

 

Calling Sequence

Parameters

Options

Description

Details

Examples

Compatibility

Calling Sequence

IsArborescence(G,opts)

IsAntiArborescence(G,opts)

Parameters

G

-

a directed graph

opts

-

: (optional) root=true or root=false

Options

• 

root : keyword option of the form root=true or root=false. This specifies whether the root vertex should be returned when the check is positive. The default is false.

Description

• 

The IsArborescence function returns true if the input graph is an arborescence, and false otherwise.

• 

The IsAntiArborescence function returns true if the input graph is an anti-arborescence, and false otherwise.

Details

• 

A directed graph G is an arborescence if there is a single vertex u called the root such that for any other vertex v, there is exactly one path from u to v.

• 

A directed graph G is an anti-arborescence if there is a single vertex v called the root such that for any other vertex u, there is exactly one path from u to v. An anti-arborescence is a graph whose reverse is an arborescence.

Examples

Confirm that a directed path is both an arborescence and an anti-arborescence.

> 

with⁡GraphTheory:

> 

T≔Graph⁡1,2,2,3

T≔Graph 1: a directed graph with 3 vertices and 2 arcs

(1)
> 

IsArborescence⁡T

true

(2)
> 

IsAntiArborescence⁡T

true

(3)

Confirm that a directed cycle is neither an arborescence nor an anti-arborescence.

> 

C≔Graph⁡1,2,2,3,3,1

C≔Graph 2: a directed graph with 3 vertices and 3 arcs

(4)
> 

IsArborescence⁡C

false

(5)
> 

IsAntiArborescence⁡C

false

(6)

Check whether a graph is an arborescence and display its root vertex.

> 

G≔Graph⁡1,2,1,5,2,3,2,4

G≔Graph 3: a directed graph with 5 vertices and 4 arcs

(7)
> 

IsArborescence⁡G

true

(8)
> 

IsArborescence⁡G,root

true,1

(9)
> 

IsAntiArborescence⁡G

false

(10)

Check whether a graph is an anti-arborescence and display its root vertex.

> 

A≔Graph⁡1,3,2,3

A≔Graph 4: a directed graph with 3 vertices and 2 arcs

(11)
> 

IsArborescence⁡A

false

(12)
> 

IsAntiArborescence⁡A,root

true,3

(13)
> 

IsAntiArborescence⁡A

true

(14)

Compatibility

• 

The GraphTheory[IsArborescence] and GraphTheory[IsAntiArborescence] commands were introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

• 

The GraphTheory[IsArborescence] and GraphTheory[IsAntiArborescence] commands were updated in Maple 2019.

• 

The root option was introduced in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

IsAcyclic

IsConnected

IsForest

IsTree

NumberOfEdges

NumberOfVertices