Object_graph.MakeBuild a graph.
module Contents_key : Type.Smodule Commit_key : Type.SDirected graph
include Graph.Sig.I
with type V.t =
[ `Contents of Contents_key.t
| `Node of Node_key.t
| `Commit of Commit_key.t
| `Branch of Branch.t ]module E : sig ... endtype edge = E.tval is_empty : t -> boolval nb_vertex : t -> intval nb_edges : t -> intval create : ?size:int -> unit -> tval clear : t -> unitBasic operations.
include Graph.Oper.S with type g := tmodule Topological : sig ... endTopological traversal
val closure :
?depth:int ->
pred:(vertex -> vertex list) ->
min:vertex list ->
max:vertex list ->
unit ->
tclosure depth pred min max () creates the transitive closure graph of max using the predecessor relation pred. The graph is bounded by the min nodes and by depth.
Note: Both min and max are subsets of n.
val iter :
?cache_size:int ->
?depth:int ->
pred:(vertex -> vertex list) ->
min:vertex list ->
max:vertex list ->
node:(vertex -> unit) ->
?edge:(vertex -> vertex -> unit) ->
skip:(vertex -> bool) ->
rev:bool ->
unit ->
unititer depth min max node edge skip rev () iterates in topological order over the closure graph starting with the max nodes and bounded by the min nodes and by depth.
It applies three functions while traversing the graph: node on the nodes; edge n predecessor_of_n on the directed edges and skip n to not include a node n, its predecessors and the outgoing edges of n.
If rev is true (the default) then the graph is traversed in the reverse order: node n is applied only after it was applied on all its predecessors; edge n p is applied after node n. Note that edge n p is applied even if p is skipped.
cache_size is the size of the LRU cache used to store nodes already seen. If None (by default) every traversed nodes is stored (and thus no entries are never removed from the LRU).
val breadth_first_traversal :
?cache_size:int ->
pred:(vertex -> vertex list) ->
max:vertex list ->
node:(vertex -> unit) ->
unit ->
unitbreadth_first_traversal ?cache_size pred max node () traverses the closure graph in breadth-first order starting with the max nodes. It applies node on the nodes of the graph while traversing it.
val output :
Stdlib.Format.formatter ->
(vertex * Graph.Graphviz.DotAttributes.vertex list) list ->
(vertex * Graph.Graphviz.DotAttributes.edge list * vertex) list ->
string ->
unitoutput ppf vertex edges name create aand dumps the graph contents on ppf. The graph is defined by its vertex and edges. name is the name of the output graph.