class util::ListGraph< NodeIndexType, ArcIndexType ></h3>
<p>Basic graph implementation without reverse arc. </p>
<p>This class also serves as a documentation for the generic graph interface (minus the part related to reverse arcs).</p>
<p>This implementation uses a linked list and compared to <aclass="el"href="classutil_1_1StaticGraph.html"title="Most efficient implementation of a graph without reverse arcs:">StaticGraph</a>:</p><ul>
<li>Is a bit faster to construct (if the arcs are not ordered by tail).</li>
<li>Does not require calling <aclass="el"href="classutil_1_1ListGraph.html#a777ff917f03a31da77f275d536578afa"title="Some graph implementations need to be finalized with Build() before they can be used.">Build()</a>.</li>
<li>Has slower outgoing arc iteration.</li>
<li>Uses more memory: ArcIndexType * <aclass="el"href="classutil_1_1BaseGraph.html#a463d57480c9563a7a707c5d0928c9946"title="Capacity reserved for future nodes, always >= num_nodes_.">node_capacity()</a><ul>
<li>Has an efficient <aclass="el"href="classutil_1_1ListGraph.html#aba03f198f690155bca2ab23b039cea54"title="Returns the tail/head of a valid arc.">Tail()</a> but need an extra NodeIndexType/arc memory for it.</li>
<li>Never changes the initial arc index returned by <aclass="el"href="classutil_1_1ListGraph.html#ac1aa8c7591bb033a49bab79c21c9f496"title="Adds an arc to the graph and returns its current index which will always be num_arcs() - 1.">AddArc()</a>. </li>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00297">297</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<trclass="memdesc:adb271cf4bcf2de5b5bbe300d7054af29"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Typedef so you can use Graph::NodeIndex and Graph::ArcIndex to be generic but also to improve the readability of your code. <ahref="#adb271cf4bcf2de5b5bbe300d7054af29">More...</a><br/></td></tr>
<trclass="memdesc:a184d6ce1a3d943810039ac9b97b860ef"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Reserve space for the graph at construction and do not allow it to grow beyond that, see <aclass="el"href="classutil_1_1BaseGraph.html#aa3bd051d1e141b09dda17aa9b5f24f69"title="FreezeCapacities() makes any future attempt to change the graph capacities crash in DEBUG mode.">FreezeCapacities()</a>. <ahref="#a184d6ce1a3d943810039ac9b97b860ef">More...</a><br/></td></tr>
<trclass="memdesc:a6af38e88610400b54e8f28ab6f880908"><tdclass="mdescLeft"> </td><tdclass="mdescRight">If node is not a valid node, sets num_nodes_ to node + 1 so that the given node becomes valid. <ahref="#a6af38e88610400b54e8f28ab6f880908">More...</a><br/></td></tr>
<trclass="memdesc:ac1aa8c7591bb033a49bab79c21c9f496"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds an arc to the graph and returns its current index which will always be <aclass="el"href="classutil_1_1BaseGraph.html#aefb468e4d4a3128c91b3bad9f5b314c8"title="Returns the number of valid arcs in the graph.">num_arcs()</a> - 1. <ahref="#ac1aa8c7591bb033a49bab79c21c9f496">More...</a><br/></td></tr>
<trclass="memdesc:a777ff917f03a31da77f275d536578afa"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Some graph implementations need to be finalized with <aclass="el"href="classutil_1_1ListGraph.html#a777ff917f03a31da77f275d536578afa"title="Some graph implementations need to be finalized with Build() before they can be used.">Build()</a> before they can be used. <ahref="#a777ff917f03a31da77f275d536578afa">More...</a><br/></td></tr>
<trclass="memdesc:ac52db792129da62b7ab25372ab90647c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Graph jargon: the "degree" of a node is its number of arcs. <ahref="#ac52db792129da62b7ab25372ab90647c">More...</a><br/></td></tr>
<trclass="memdesc:ab63770fa993b9347586d2852b841bdc2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Allows to iterate over the forward arcs that verify Tail(arc) == node. <ahref="#ab63770fa993b9347586d2852b841bdc2">More...</a><br/></td></tr>
<trclass="memdesc:a1565480b94bf179067e81d762916ed52"><tdclass="mdescLeft"> </td><tdclass="mdescRight">This loops over the heads of the OutgoingArcs(node). <ahref="#a1565480b94bf179067e81d762916ed52">More...</a><br/></td></tr>
<trclass="memdesc:aba03f198f690155bca2ab23b039cea54"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the tail/head of a valid arc. <ahref="#aba03f198f690155bca2ab23b039cea54">More...</a><br/></td></tr>
<trclass="memdesc:aefd885a0eba3ec33568137533190ba5b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Changes the graph capacities. <ahref="#aefd885a0eba3ec33568137533190ba5b">More...</a><br/></td></tr>
<trclass="memdesc:a0f551c921fa0b5aaa334a6e36f61db4a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the number of valid nodes in the graph. <ahref="#a0f551c921fa0b5aaa334a6e36f61db4a">More...</a><br/></td></tr>
<trclass="memdesc:aefb468e4d4a3128c91b3bad9f5b314c8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the number of valid arcs in the graph. <ahref="#aefb468e4d4a3128c91b3bad9f5b314c8">More...</a><br/></td></tr>
<trclass="memdesc:abf853acea86e01356f53055f77661770"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns true if the given node is a valid node of the graph. <ahref="#abf853acea86e01356f53055f77661770">More...</a><br/></td></tr>
<trclass="memdesc:a2097ccda3b1ad27e2c82166979018bda"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns true if the given arc is a valid arc of the graph. <ahref="#a2097ccda3b1ad27e2c82166979018bda">More...</a><br/></td></tr>
<trclass="memdesc:aa3bd051d1e141b09dda17aa9b5f24f69"><tdclass="mdescLeft"> </td><tdclass="mdescRight"><aclass="el"href="classutil_1_1BaseGraph.html#aa3bd051d1e141b09dda17aa9b5f24f69"title="FreezeCapacities() makes any future attempt to change the graph capacities crash in DEBUG mode.">FreezeCapacities()</a> makes any future attempt to change the graph capacities crash in DEBUG mode. <ahref="#aa3bd051d1e141b09dda17aa9b5f24f69">More...</a><br/></td></tr>
<trclass="memitem:a07214b96597069d781e27b1dd17ef83e"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classutil_1_1BaseGraph.html#a07214b96597069d781e27b1dd17ef83e">GroupForwardArcsByFunctor</a> (const A &a, B *b)</td></tr>
<trclass="memdesc:ab1292c82a3f43be3bd57b63a05fe0214"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constants that will never be a valid node or arc. <ahref="#ab1292c82a3f43be3bd57b63a05fe0214">More...</a><br/></td></tr>
<trclass="memdesc:ac47030fcb75a3220f8cf9ed79697056e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Functions commented when defined because they are implementation details. <ahref="#ac47030fcb75a3220f8cf9ed79697056e">More...</a><br/></td></tr>
<trclass="memdesc:a63fd586eed6c345866317e2f0faf377e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Given the tail of arc #i in (*head)[i] and the head of arc #i in (*head)[~i]. <ahref="#a63fd586eed6c345866317e2f0faf377e">More...</a><br/></td></tr>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00190">190</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Typedef so you can use <aclass="el"href="classutil_1_1BaseGraph.html#adb271cf4bcf2de5b5bbe300d7054af29"title="Typedef so you can use Graph::NodeIndex and Graph::ArcIndex to be generic but also to improve the rea...">Graph::NodeIndex</a> and <aclass="el"href="classutil_1_1BaseGraph.html#a0eba6e5899924388644dfa2258ae8929">Graph::ArcIndex</a> to be generic but also to improve the readability of your code. </p>
<p>We also recommend that you define a typedef ... Graph; for readability. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00189">189</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
</div>
</div>
<h2class="groupheader">Constructor & Destructor Documentation</h2>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00307">307</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Reserve space for the graph at construction and do not allow it to grow beyond that, see <aclass="el"href="classutil_1_1BaseGraph.html#aa3bd051d1e141b09dda17aa9b5f24f69"title="FreezeCapacities() makes any future attempt to change the graph capacities crash in DEBUG mode.">FreezeCapacities()</a>. </p>
<p>This constructor also makes any nodes in [0, num_nodes) valid. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00312">312</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Adds an arc to the graph and returns its current index which will always be <aclass="el"href="classutil_1_1BaseGraph.html#aefb468e4d4a3128c91b3bad9f5b314c8"title="Returns the number of valid arcs in the graph.">num_arcs()</a> - 1. </p>
<p>It will also automatically call AddNode(tail) and AddNode(head). It will fail in DEBUG mode if the capacities are fixed and this cause the graph to grow beyond them.</p>
<dlclass="section note"><dt>Note</dt><dd>Self referencing arcs and duplicate arcs are supported. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01137">1137</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>If node is not a valid node, sets num_nodes_ to node + 1 so that the given node becomes valid. </p>
<p>It will fail in DEBUG mode if the capacities are fixed and the new node is out of range. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01129">1129</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00935">935</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Allows nice range-based for loop: for (const NodeIndex node : graph.AllNodes()) { ... </p>
<p><aclass="el"href="classutil_1_1BaseGraph.html"title="Base class of all Graphs implemented here.">BaseGraph</a> implementation -------------------------------------------------—.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00929">929</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000015">Todo:</a></b></dt><dd>(user): Same questions as the ones in <aclass="el"href="classutil_1_1BaseGraph.html#a463d57480c9563a7a707c5d0928c9946"title="Capacity reserved for future nodes, always >= num_nodes_.">node_capacity()</a>. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00959">959</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Some graph implementations need to be finalized with <aclass="el"href="classutil_1_1ListGraph.html#a777ff917f03a31da77f275d536578afa"title="Some graph implementations need to be finalized with Build() before they can be used.">Build()</a> before they can be used. </p>
<p>After <aclass="el"href="classutil_1_1ListGraph.html#a777ff917f03a31da77f275d536578afa"title="Some graph implementations need to be finalized with Build() before they can be used.">Build()</a> is called, the arc indices (which had been the return values of previous <aclass="el"href="classutil_1_1ListGraph.html#ac1aa8c7591bb033a49bab79c21c9f496"title="Adds an arc to the graph and returns its current index which will always be num_arcs() - 1.">AddArc()</a> calls) may change: the new index of former arc #i will be stored in permutation[i] if #i is smaller than permutation.size() or will be unchanged otherwise. If you don't care about these, just call the simple no-output version <aclass="el"href="classutil_1_1ListGraph.html#a777ff917f03a31da77f275d536578afa"title="Some graph implementations need to be finalized with Build() before they can be used.">Build()</a>.</p>
<dlclass="section note"><dt>Note</dt><dd>some implementations become immutable after calling <aclass="el"href="classutil_1_1ListGraph.html#a777ff917f03a31da77f275d536578afa"title="Some graph implementations need to be finalized with Build() before they can be used.">Build()</a>. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00339">339</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01167">1167</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Given the tail of arc #i in (*head)[i] and the head of arc #i in (*head)[~i]. </p>
<ul>
<li>Reorder the arc by increasing tail.</li>
<li>Put the head of the new arc #i in (*head)[i].</li>
<li>Put in start[i] the index of the first arc with tail >= i.</li>
<li>Update "permutation" to reflect the change, unless it is NULL. </li>
</ul>
<p>Computes the outgoing degree of each nodes and check if we need to permute something or not. Note that the tails are currently stored in the positive range of the <aclass="el"href="classutil_1_1SVector.html"title="Forward declaration.">SVector</a> head.</p>
<p>Abort early if we do not need the permutation: we only need to put the heads in the positive range.</p>
<p>Computes the forward arc permutation. </p><dlclass="section note"><dt>Note</dt><dd>this temporarily alters the start vector.</dd></dl>
<p>Restore in (*start)[i] the index of the first arc with tail >= i.</p>
<p>Permutes the head into their final position in head. We do not need the tails anymore at this point. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00995">995</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Functions commented when defined because they are implementation details. </p>
<p>Computes the cummulative sum of the entry in v.</p>
<p>We only use it with in/out degree distribution, hence the Check() at the end. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00978">978</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p><aclass="el"href="classutil_1_1BaseGraph.html#aa3bd051d1e141b09dda17aa9b5f24f69"title="FreezeCapacities() makes any future attempt to change the graph capacities crash in DEBUG mode.">FreezeCapacities()</a> makes any future attempt to change the graph capacities crash in DEBUG mode. </p>
<dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000016">Todo:</a></b></dt><dd>(user): Only define this in debug mode at the cost of having a lot of ifndef NDEBUG all over the place? remove the function completely ? </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00966">966</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>They are just here during the transition from the old ebert_graph api to this new graph api. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00264">264</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01114">1114</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Returns true if the given arc is a valid arc of the graph. </p>
<dlclass="section note"><dt>Note</dt><dd>the arc validity range changes for graph with reverse arcs. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00219">219</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Returns true if the given node is a valid node of the graph. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00213">213</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00267">267</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000014">Todo:</a></b></dt><dd>(user): Is it needed? remove completely? return the real capacities at the cost of having a different implementation for each graphs? </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00951">951</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Returns the number of valid arcs in the graph. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00204">204</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Returns the number of valid nodes in the graph. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00201">201</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>This loops over the heads of the OutgoingArcs(node). </p>
<p>It is just a more convenient way to achieve this. Moreover this interface is used by some graph algorithms. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01099">1099</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Graph jargon: the "degree" of a node is its number of arcs. </p>
<p>The out-degree is the number of outgoing arcs. The in-degree is the number of incoming arcs, and is only available for some graph implementations, below.</p>
<p><aclass="el"href="classutil_1_1ListGraph.html#ac52db792129da62b7ab25372ab90647c"title="Graph jargon: the "degree" of a node is its number of arcs.">ListGraph<>::OutDegree()</a> works in O(degree). </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01121">1121</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Same as <aclass="el"href="classutil_1_1ListGraph.html#ab63770fa993b9347586d2852b841bdc2"title="Allows to iterate over the forward arcs that verify Tail(arc) == node.">OutgoingArcs()</a>, but allows to restart the iteration from an already known outgoing arc of the given node. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00247">247</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Reimplemented from <aclass="el"href="classutil_1_1BaseGraph.html#a9563f7154a759843923dd9bb27b288e7">util::BaseGraph< NodeIndexType, ArcIndexType, false ></a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01158">1158</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>The functions will fail in debug mode if:</p><ul>
<li>const_capacities_ is true.</li>
<li>A valid node does not fall into the new node range.</li>
<li>A valid arc does not fall into the new arc range. In non-debug mode, const_capacities_ is ignored and nothing will happen if the new capacity value for the arcs or the nodes is too small. </li>
</ul>
<p>Reimplemented from <aclass="el"href="classutil_1_1BaseGraph.html#a69a71cbb575b13bde9899f5a6a217139">util::BaseGraph< NodeIndexType, ArcIndexType, false ></a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01151">1151</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l01107">1107</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Data Documentation</h2>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00279">279</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00280">280</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00259">259</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<p>Constants that will never be a valid node or arc. </p>
<p>They are the maximum possible node and arc capacity. </p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00258">258</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00277">277</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00278">278</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="graph_8h_source.html#l00276">276</a> of file <aclass="el"href="graph_8h_source.html">graph.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>