<!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="previous" href="Sig.P.html"> <link rel="next" href="Sig.MARK.html"> <link rel="Up" href="Sig.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>Sig.I</title> </head> <body> <div class="navbar"><a href="Sig.P.html">Previous</a> <a href="Sig.html">Up</a> <a href="Sig.MARK.html">Next</a> </div> <center><h1>Module type <a href="type_Sig.I.html">Sig.I</a></h1></center> <br> <pre><span class="keyword">module type</span> I = <code class="code">sig</code> <a href="Sig.I.html">..</a> <code class="code">end</code></pre>Signature for imperative (i.e. mutable) graphs.<br> <hr width="100%"> <pre><span class="keyword">include</span> <a href="Sig.G.html">Sig.G</a></pre> <br> An imperative graph is a graph.<br> <pre><span class="keyword">val</span> <a name="VALcreate"></a>create : <code class="type">?size:int -> unit -> t</code></pre><div class="info"> <code class="code">create ()</code> returns an empty graph. Optionally, a size can be given, which should be on the order of the expected number of vertices that will be in the graph (for hash tables-based implementations). The graph grows as needed, so <code class="code">size</code> is just an initial guess.<br> </div> <pre><span class="keyword">val</span> <a name="VALcopy"></a>copy : <code class="type">t -> t</code></pre><div class="info"> <code class="code">copy g</code> returns a copy of <code class="code">g</code>. Vertices and edges (and eventually marks, see module <code class="code">Mark</code>) are duplicated.<br> </div> <pre><span class="keyword">val</span> <a name="VALadd_vertex"></a>add_vertex : <code class="type">t -> vertex -> unit</code></pre><div class="info"> <code class="code">add_vertex g v</code> adds the vertex <code class="code">v</code> from the graph <code class="code">g</code>. Do nothing if <code class="code">v</code> is already in <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALremove_vertex"></a>remove_vertex : <code class="type">t -> vertex -> unit</code></pre><div class="info"> <code class="code">remove g v</code> removes the vertex <code class="code">v</code> from the graph <code class="code">g</code> (and all the edges going from <code class="code">v</code> in <code class="code">g</code>). Do nothing if <code class="code">v</code> is not in <code class="code">g</code>. <p> <b>Time complexity for ocamlgraph implementations:</b> O(|V|*ln(D)) for unlabeled graphs and O(|V|*D) for labeled graphs. D is the maximal degree of the graph.<br> </div> <pre><span class="keyword">val</span> <a name="VALadd_edge"></a>add_edge : <code class="type">t -> vertex -> vertex -> unit</code></pre><div class="info"> <code class="code">add_edge g v1 v2</code> adds an edge from the vertex <code class="code">v1</code> to the vertex <code class="code">v2</code> in the graph <code class="code">g</code>. Add also <code class="code">v1</code> (resp. <code class="code">v2</code>) in <code class="code">g</code> if <code class="code">v1</code> (resp. <code class="code">v2</code>) is not in <code class="code">g</code>. Do nothing if this edge is already in <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALadd_edge_e"></a>add_edge_e : <code class="type">t -> edge -> unit</code></pre><div class="info"> <code class="code">add_edge_e g e</code> adds the edge <code class="code">e</code> in the graph <code class="code">g</code>. Add also <code class="code">E.src e</code> (resp. <code class="code">E.dst e</code>) in <code class="code">g</code> if <code class="code">E.src e</code> (resp. <code class="code">E.dst e</code>) is not in <code class="code">g</code>. Do nothing if <code class="code">e</code> is already in <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALremove_edge"></a>remove_edge : <code class="type">t -> vertex -> vertex -> unit</code></pre><div class="info"> <code class="code">remove_edge g v1 v2</code> removes the edge going from <code class="code">v1</code> to <code class="code">v2</code> from the graph <code class="code">g</code>. If the graph is labelled, all the edges going from <code class="code">v1</code> to <code class="code">v2</code> are removed from <code class="code">g</code>. Do nothing if this edge is not in <code class="code">g</code>.<br> <b>Raises</b> <code>Invalid_argument</code> if <code class="code">v1</code> or <code class="code">v2</code> are not in <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALremove_edge_e"></a>remove_edge_e : <code class="type">t -> edge -> unit</code></pre><div class="info"> <code class="code">remove_edge_e g e</code> removes the edge <code class="code">e</code> from the graph <code class="code">g</code>. Do nothing if <code class="code">e</code> is not in <code class="code">g</code>.<br> <b>Raises</b> <code>Invalid_argument</code> if <code class="code">E.src e</code> or <code class="code">E.dst e</code> are not in <code class="code">g</code>.<br> </div> </body></html>