Up
# module Classic

: sig

Some classic graphs

#

module type S = sig

#

type graph

#

val divisors : int -> graph

`divisors n`

builds the graph of divisors.
Vertices are integers from `2`

to `n`

. `i`

is connected to `j`

if
and only if `i`

divides `j`

.

Raises

`Invalid_argument`

is `n < 2`

.
#

val de_bruijn : int -> graph

`de_bruijn n`

builds the de Bruijn graph of order `n`

.
Vertices are bit sequences of length `n`

(encoded as their
interpretation as binary integers). The sequence `xw`

is connected
to the sequence `wy`

for any bits `x`

and `y`

and any bit sequence
`w`

of length `n-1`

.

Raises

`Invalid_argument`

is `n < 1`

or `n > Sys.word_size-1`

.
end

end