`sig
module type G =
sig
val is_directed : bool
type t
module V : Sig.COMPARABLE
val iter_vertex : (V.t -> unit) -> Traverse.G.t -> unit
val fold_vertex : (V.t -> 'a -> 'a) -> Traverse.G.t -> 'a -> 'a
val iter_succ : (V.t -> unit) -> Traverse.G.t -> V.t -> unit
val fold_succ : (V.t -> 'a -> 'a) -> Traverse.G.t -> V.t -> 'a -> 'a
end
module Dfs :
functor (G : G) ->
sig
val iter :
?pre:(G.V.t -> unit) ->
?post:(G.V.t -> unit) -> Traverse.G.t -> unit
val prefix : (G.V.t -> unit) -> Traverse.G.t -> unit
val postfix : (G.V.t -> unit) -> Traverse.G.t -> unit
val iter_component :
?pre:(G.V.t -> unit) ->
?post:(G.V.t -> unit) -> Traverse.G.t -> G.V.t -> unit
val prefix_component :
(G.V.t -> unit) -> Traverse.G.t -> G.V.t -> unit
val postfix_component :
(G.V.t -> unit) -> Traverse.G.t -> G.V.t -> unit
type iterator
val start : Traverse.G.t -> Traverse.Dfs.iterator
val step : Traverse.Dfs.iterator -> Traverse.Dfs.iterator
val get : Traverse.Dfs.iterator -> G.V.t
val has_cycle : Traverse.G.t -> bool
end
module Bfs :
functor (G : G) ->
sig
val iter : (G.V.t -> unit) -> Traverse.G.t -> unit
val iter_component : (G.V.t -> unit) -> Traverse.G.t -> G.V.t -> unit
type iterator
val start : Traverse.G.t -> Traverse.Bfs.iterator
val step : Traverse.Bfs.iterator -> Traverse.Bfs.iterator
val get : Traverse.Bfs.iterator -> G.V.t
end
module type GM =
sig
type t
module V : sig type t end
val iter_vertex : (Traverse.GM.V.t -> unit) -> Traverse.GM.t -> unit
val iter_succ :
(Traverse.GM.V.t -> unit) -> Traverse.GM.t -> Traverse.GM.V.t -> unit
module Mark :
sig
val clear : Traverse.GM.t -> unit
val get : Traverse.GM.V.t -> int
val set : Traverse.GM.V.t -> int -> unit
end
end
module Mark :
functor (G : GM) ->
sig
val dfs : Traverse.G.t -> unit
val has_cycle : Traverse.G.t -> bool
end
end`