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

isReachable -- checks if a vertex u is reachable from a vertex v

Synopsis

Description

In a Digraph D, a vertex u of D is reachable from another vertex v of D if u is a descendant of v. Alternatively, u is reachable from v if there is some set of vertices u0, ... , un such that un = u and u0 = v and (ui, ui+1) is and edge of D for all i from 0 to n-1.

i1 : D = digraph({a,b,c,d,e},{{a,b},{b,c},{b,d},{e,b}});
i2 : isReachable(D, e, a)

o2 = false
i3 : isReachable(D, d, e)

o3 = true

See also

Ways to use isReachable :