Macaulay2 » Documentation
Packages » Graphs :: isReachable
next | previous | forward | backward | up | index | toc

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



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 u_0, ... , u_n such that u_n = u and u_0 = v and (u_i, u_i+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 :

For the programmer

The object isReachable is a method function.