module type GRAPH = sig end
The client must provide an implementation of graphs which fullfills the
signature GRAPH
.
type graph
The type of graphs.
type node
The type of nodes.
val iter_nodes : (node -> unit) -> graph -> unit
iter_nodes f g
applies f
on every nodes of the graph g
. The
order in which nodes are considered does not matter and may change
between different application of the function on the same graph.
However, each node must be considered exactly once.
val iter_successors : (node -> unit) -> node -> unit
iter_successors f nd
applies f
on every successors of the
node nd
in its graph. The order in which successors are
considere does not matter. The graph is not required to be
simple (i.e. iter_successors f nd
may apply f
an arbitrary
number of time the function f
on each of nd
's successors, as
long as this number is fixed.
val get : node -> int
Every node must carry a transient integer field. The following
functions allows reading and updating this field. No assumption
is made by the module on the initial content of this field at
each function call. However, the client cannot make any
assumption on the final content too.
val set : node -> int -> unit