next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Graphs :: isCyclic(Digraph)

isCyclic(Digraph) -- determines whether a digraph is cyclic

Synopsis

Description

A digraph is cyclic if it contains a cycle, i.e. for some vertex v of D, by following the edges of D, one can return to v.

i1 : D = digraph ({{0,1},{0,2},{2,3},{3,4},{4,2}},EntryMode=>"edges")

o1 = Digraph{0 => {1, 2}}
             1 => {}
             2 => {3}
             3 => {4}
             4 => {2}

o1 : Digraph
i2 : isCyclic D

o2 = true

See also