Rand.MakeRandom graphs
module B : Builder.INTtype graph = B.G.ttype vertex = B.G.V.ttype edge_label = B.G.E.labelval graph : ?loops:bool -> v:int -> e:int -> unit -> graphgraph v e generates a random graph with exactly v vertices and e edges. Vertices are labeled with 0 ... v-1. The boolean loops indicates whether loops are allowed; default value is no loop (false).
val labeled :
(vertex -> vertex -> edge_label) ->
?loops:bool ->
v:int ->
e:int ->
unit ->
graphlabeled f is similar to graph except that edges are labeled using function f.
The two functions above actually make a choice between two different implementations according to the ratio e/(v*v). When this ratio is small, random_few_edges is selected; otherwise random_many_edges is selected.
val random_few_edges : loops:bool -> v:int -> e:int -> graphval random_many_edges : loops:bool -> v:int -> e:int -> graphval gnp : ?loops:bool -> v:int -> prob:float -> unit -> graphrandom graph using the G(n,p) model. gnp v prob generates a random graph with exactly v vertices and where each edge is selected with probability prob
val gnp_labeled :
(vertex -> vertex -> edge_label) ->
?loops:bool ->
v:int ->
prob:float ->
unit ->
graphgnp_labeled add_edge v e is similar to gnp except that edges are labeled using function f.