Module Traverse.Mark

Graph traversal with marking. Only applies to imperative graphs with marks.

Parameters

module G : GM

Signature

val dfs : G.t -> unit

dfs g traverses g in depth-first search, marking all nodes.

val has_cycle : G.t -> bool

has_cycle g checks for a cycle in g. Modifies the marks. Linear time, constant space.