Module Oper.I
Basic operations over imperative graphs
Parameters
Signature
type g
= G.t
val transitive_closure : ?reflexive:bool -> g -> g
transitive_closure ?reflexive g
returns the transitive closure ofg
(as a new graph). Loops (i.e. edges from a vertex to itself) are added only ifreflexive
istrue
(default isfalse
).
val add_transitive_closure : ?reflexive:bool -> g -> g
add_transitive_closure ?reflexive g
replacesg
by its transitive closure. Meaningless for persistent implementations (then acts astransitive_closure
).
val transitive_reduction : ?reflexive:bool -> g -> g
transitive_reduction ?reflexive g
returns the transitive reduction ofg
(as a new graph). Loops (i.e. edges from a vertex to itself) are removed only ifreflexive
istrue
(default isfalse
).
val replace_by_transitive_reduction : ?reflexive:bool -> g -> g
replace_by_transitive_reduction ?reflexive g
replacesg
by its transitive reduction. Meaningless for persistent implementations (then acts astransitive_reduction
).
val mirror : g -> g
mirror g
returns a new graph which is the mirror image ofg
: each edge fromu
tov
has been replaced by an edge fromv
tou
. For undirected graphs, it simply returnsg
. Note: Vertices are shared betweeng
andmirror g
; you may need to make a copy ofg
before usingmirror
val complement : g -> g
complement g
returns a new graph which is the complement ofg
: each edge present ing
is not present in the resulting graph and vice-versa. Edges of the returned graph are unlabeled.