Module Oper.P
Basic operations over persistent graphs
Parameters
Signature
type g= G.t
val transitive_closure : ?reflexive:bool -> g -> gtransitive_closure ?reflexive greturns the transitive closure ofg(as a new graph). Loops (i.e. edges from a vertex to itself) are added only ifreflexiveistrue(default isfalse).
val add_transitive_closure : ?reflexive:bool -> g -> gadd_transitive_closure ?reflexive greplacesgby its transitive closure. Meaningless for persistent implementations (then acts astransitive_closure).
val transitive_reduction : ?reflexive:bool -> g -> gtransitive_reduction ?reflexive greturns the transitive reduction ofg(as a new graph). Loops (i.e. edges from a vertex to itself) are removed only ifreflexiveistrue(default isfalse).
val replace_by_transitive_reduction : ?reflexive:bool -> g -> greplace_by_transitive_reduction ?reflexive greplacesgby its transitive reduction. Meaningless for persistent implementations (then acts astransitive_reduction).
val mirror : g -> gmirror greturns a new graph which is the mirror image ofg: each edge fromutovhas been replaced by an edge fromvtou. For undirected graphs, it simply returnsg. Note: Vertices are shared betweengandmirror g; you may need to make a copy ofgbefore usingmirror
val complement : g -> gcomplement greturns a new graph which is the complement ofg: each edge present ingis not present in the resulting graph and vice-versa. Edges of the returned graph are unlabeled.