Module Traverse.Mark
Graph traversal with marking. Only applies to imperative graphs with marks.
Parameters
Signature
val dfs : G.t -> unit
dfs g
traversesg
in depth-first search, marking all nodes.
val has_cycle : G.t -> bool
has_cycle g
checks for a cycle ing
. Modifies the marks. Linear time, constant space.