Function ADS::longestPathDag

Function Documentation

inline int ADS::longestPathDag(const Adjacency &G, int r, int t)

the most edges of a path from r to t in an acyclic oriented graph, -1 if t is not reachable; O( n^2 ) by the topological order

Pre:

G is square and acyclic, r and t are nodes