Module Classic.I
Classic Imperative Graphs
Parameters
Signature
type graph
= G.t
val divisors : int -> graph
divisors n
builds the graph of divisors. Vertices are integers from2
ton
.i
is connected toj
if and only ifi
dividesj
.- raises Invalid_argument
is
n < 2
.
val de_bruijn : int -> graph
de_bruijn n
builds the de Bruijn graph of ordern
. Vertices are bit sequences of lengthn
(encoded as their interpretation as binary integers). The sequencexw
is connected to the sequencewy
for any bitsx
andy
and any bit sequencew
of lengthn-1
.- raises Invalid_argument
is
n < 1
orn > Sys.word_size-1
.
val vertex_only : int -> graph
vertex_only n
builds a graph withn
vertices and no edge.
val full : ?self:bool -> int -> graph
full n
builds a graph withn
vertices and all possible edges. The optional argumentself
indicates if loop edges should be added (default value istrue
).