Module Graph__Topological.Make
Functor providing topological iterators over a graph.
Parameters
Signature
val fold : (G.V.t -> 'a -> 'a) -> G.t -> 'a -> 'a
fold action g seed
allows iterating over the graphg
in topological order.action node accu
is called repeatedly, wherenode
is the node being visited, andaccu
is the result of theaction
's previous invocation, if any, andseed
otherwise. Ifg
contains cycles, the order is unspecified inside the cycles and every node in the cycles will be presented exactly once.Not tail-recursive. Complexity: O(V+E)