next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Graphs :: reachable

reachable -- Computes the vertices which are reachable from a vertex set by a path

Synopsis

Description

If the user inputs a set A, then the output will be a set of vertices. If the user inputs a list A, then the output will be a list of vertices.
i1 : G = digraph {{1,2},{2,3},{4,5},{2,5}}

o1 = Digraph{1 => set {2}   }
             2 => set {3, 5}
             3 => set {}
             4 => set {5}
             5 => set {}

o1 : Digraph
i2 : reachable(G,{2})

o2 = {5, 2, 3}

o2 : List

Ways to use reachable :