<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="next" href="Rand.P.html"> <link rel="Up" href="Rand.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Sig" rel="Chapter" href="Sig.html"> <link title="Sig_pack" rel="Chapter" href="Sig_pack.html"> <link title="Dot_ast" rel="Chapter" href="Dot_ast.html"> <link title="Util" rel="Chapter" href="Util.html"> <link title="Persistent" rel="Chapter" href="Persistent.html"> <link title="Imperative" rel="Chapter" href="Imperative.html"> <link title="Delaunay" rel="Chapter" href="Delaunay.html"> <link title="Builder" rel="Chapter" href="Builder.html"> <link title="Classic" rel="Chapter" href="Classic.html"> <link title="Rand" rel="Chapter" href="Rand.html"> <link title="Oper" rel="Chapter" href="Oper.html"> <link title="Path" rel="Chapter" href="Path.html"> <link title="Traverse" rel="Chapter" href="Traverse.html"> <link title="Coloring" rel="Chapter" href="Coloring.html"> <link title="Topological" rel="Chapter" href="Topological.html"> <link title="Components" rel="Chapter" href="Components.html"> <link title="Kruskal" rel="Chapter" href="Kruskal.html"> <link title="Flow" rel="Chapter" href="Flow.html"> <link title="Graphviz" rel="Chapter" href="Graphviz.html"> <link title="Gml" rel="Chapter" href="Gml.html"> <link title="Dot" rel="Chapter" href="Dot.html"> <link title="Pack" rel="Chapter" href="Pack.html"> <link title="Gmap" rel="Chapter" href="Gmap.html"> <link title="Minsep" rel="Chapter" href="Minsep.html"> <link title="Cliquetree" rel="Chapter" href="Cliquetree.html"> <link title="Mcs_m" rel="Chapter" href="Mcs_m.html"> <link title="Md" rel="Chapter" href="Md.html"> <link title="Strat" rel="Chapter" href="Strat.html"><title>Rand.Make</title> </head> <body> <div class="navbar"> <a href="Rand.html">Up</a> <a href="Rand.P.html">Next</a> </div> <center><h1>Functor <a href="type_Rand.Make.html">Rand.Make</a></h1></center> <br> <pre><span class="keyword">module</span> Make: <div class="sig_block"><code class="code">functor (</code><code class="code">B</code><code class="code"> : </code><code class="type"><a href="Builder.INT.html">Builder.INT</a></code><code class="code">) -> </code><code class="type"><a href="Rand.S.html">S</a></code><code class="type"> with type graph = B.G.t and type vertex = B.G.V.t and type edge_label = B.G.E.label</code></div></pre>Random graphs<br> <table border="0" cellpadding="3" width="100%"> <tr> <td align="left" valign="top" width="1%%"><b>Parameters: </b></td> <td> <table class="paramstable"> <tr> <td align="center" valign="top" width="15%"> <code>B</code></td> <td align="center" valign="top">:</td> <td><code class="type"><a href="Builder.INT.html">Builder.INT</a></code> </table> </td> </tr> </table> <hr width="100%"> <pre><span class="keyword">type</span> <a name="TYPEgraph"></a><code class="type"></code>graph </pre> <pre><span class="keyword">type</span> <a name="TYPEvertex"></a><code class="type"></code>vertex </pre> <pre><span class="keyword">type</span> <a name="TYPEedge_label"></a><code class="type"></code>edge_label </pre> <pre><span class="keyword">val</span> <a name="VALgraph"></a>graph : <code class="type">?loops:bool -> v:int -> e:int -> unit -> <a href="Rand.S.html#TYPEgraph">graph</a></code></pre><div class="info"> <code class="code">graph v e</code> generates a random graph with exactly <code class="code">v</code> vertices and <code class="code">e</code> edges. Vertices are labeled with <code class="code">0</code> ... <code class="code">v-1</code>. The boolean <code class="code">loops</code> indicates whether loops are allowed; default value is no loop (<code class="code">false</code>).<br> <b>Raises</b> <code>Invalid_argument</code> if <code class="code">e</code> exceeds the maximal number of edges.<br> </div> <pre><span class="keyword">val</span> <a name="VALlabeled"></a>labeled : <code class="type">(<a href="Rand.S.html#TYPEvertex">vertex</a> -> <a href="Rand.S.html#TYPEvertex">vertex</a> -> <a href="Rand.S.html#TYPEedge_label">edge_label</a>) -><br> ?loops:bool -> v:int -> e:int -> unit -> <a href="Rand.S.html#TYPEgraph">graph</a></code></pre><div class="info"> <code class="code">labeled f</code> is similar to <code class="code">graph</code> except that edges are labeled using function <code class="code">f</code>.<br> <b>Raises</b> <code>Invalid_argument</code> if there are too many edges.<br> </div> <br> The two functions above actually make a choice between two different implementations according to the ratio e/(v*v). When this ratio is small, <code class="code">random_few_edges</code> is selected; otherwise <code class="code">random_many_edges</code> is selected.<br> <pre><span class="keyword">val</span> <a name="VALrandom_few_edges"></a>random_few_edges : <code class="type">loops:bool -> v:int -> e:int -> <a href="Rand.S.html#TYPEgraph">graph</a></code></pre><pre><span class="keyword">val</span> <a name="VALrandom_many_edges"></a>random_many_edges : <code class="type">loops:bool -> v:int -> e:int -> <a href="Rand.S.html#TYPEgraph">graph</a></code></pre></body></html>