Macaulay2 » Documentation
Packages » Graphs :: isCyclic(Digraph)
next | previous | forward | backward | up | index | toc

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

- Function: isCyclic
- Usage:
    `C = isCyclic D`
- Inputs:
  - D, a digraph,
- Outputs:
  - C, a Boolean value, Whether the digraph D is cyclic

## 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

- isCyclic -- determines whether a graph is cyclic

## Ways to use this method:

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

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Graphs.m2:4406:0.