<divclass="textblock"><p>A simple and efficient max-cost flow interface. </p>
<p>This is as fast as GenericMaxFlow<ReverseArcStaticGraph>, which is the fastest, but uses more memory in order to hide the somewhat involved construction of the static graph.</p>
<dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000042">Todo:</a></b></dt><dd>(user): If the need arises, extend this interface to support warm start. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="max__flow_8h_source.html#l00152">152</a> of file <aclass="el"href="max__flow_8h_source.html">max_flow.h</a>.</p>
<trclass="memdesc:a8a7acde49c4d55f2eb42e2b6869cdb3d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Solves the problem (finds the maximum flow from the given source to the given sink), and returns the problem status. <ahref="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">More...</a><br/></td></tr>
<trclass="memdesc:a64c1cc700d51eca9eac6bec6542d0bfb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds a directed arc with the given capacity from tail to head. <ahref="#a64c1cc700d51eca9eac6bec6542d0bfb">More...</a><br/></td></tr>
<trclass="memdesc:a200b4dbff9102ee1232e05f569fc2427"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the current number of nodes. <ahref="#a200b4dbff9102ee1232e05f569fc2427">More...</a><br/></td></tr>
<trclass="memdesc:a10899eb2ae1b242c4737e4c9e7ecdae5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the current number of arcs in the graph. <ahref="#a10899eb2ae1b242c4737e4c9e7ecdae5">More...</a><br/></td></tr>
<trclass="memdesc:a553204b2dccf205ff9c00c3c589d309b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the maximum flow we can send from the source to the sink in the last OPTIMAL <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. <ahref="#a553204b2dccf205ff9c00c3c589d309b">More...</a><br/></td></tr>
<trclass="memdesc:aef35310ddd005652bb2b3db14c323ae9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the flow on the given arc in the last OPTIMAL <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. <ahref="#aef35310ddd005652bb2b3db14c323ae9">More...</a><br/></td></tr>
<trclass="memdesc:ae83c98d7dcf6a2d76a5d500273255fe6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the nodes reachable from the source by non-saturated arcs (.i.e. <ahref="#ae83c98d7dcf6a2d76a5d500273255fe6">More...</a><br/></td></tr>
<trclass="memdesc:a693abc3c55e13dbe2f836e562b5a9c0f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the nodes that can reach the sink by non-saturated arcs, the outgoing arcs of this set form a minimum cut. <ahref="#a693abc3c55e13dbe2f836e562b5a9c0f">More...</a><br/></td></tr>
<trclass="memdesc:a177f9e6c8a8c603e3cead358da5d1026"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates the protocol buffer representation of the problem used by the last <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> call. <ahref="#a177f9e6c8a8c603e3cead358da5d1026">More...</a><br/></td></tr>
<trclass="memdesc:a57296b653813abdd8d711048e87d1212"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Change the capacity of an arc. <ahref="#a57296b653813abdd8d711048e87d1212">More...</a><br/></td></tr>
<p>Solves the problem (finds the maximum flow from the given source to the given sink), and returns the problem status. </p>
<tableclass="fieldtable">
<tr><thcolspan="2">Enumerator</th></tr><tr><tdclass="fieldname"><aid="a8a7acde49c4d55f2eb42e2b6869cdb3da3b60465215ab4363dec64fd313771658"></a>OPTIMAL </td><tdclass="fielddoc"><p><aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> was called and found an optimal solution. </p>
<p>Note that <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a553204b2dccf205ff9c00c3c589d309b"title="Returns the maximum flow we can send from the source to the sink in the last OPTIMAL Solve() context.">OptimalFlow()</a> may be 0 which means that the sink is not reachable from the source. </p>
</td></tr>
<tr><tdclass="fieldname"><aid="a8a7acde49c4d55f2eb42e2b6869cdb3da18a3ff25435f10be68329d4b39de4700"></a>POSSIBLE_OVERFLOW </td><tdclass="fielddoc"><p>There is a flow > std::numeric_limits<FlowQuantity>::max(). </p>
<p>Note that in this case, the class will contain a solution with a flow reaching that bound.</p>
<dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000045">Todo:</a></b></dt><dd>(user): rename POSSIBLE_OVERFLOW to INT_OVERFLOW and modify our clients. </dd></dl>
<tr><tdclass="fieldname"><aid="a8a7acde49c4d55f2eb42e2b6869cdb3da2260e76ea3adc21a9cd21f46f232ebbc"></a>BAD_INPUT </td><tdclass="fielddoc"><p>The input is inconsistent (bad tail/head/capacity values). </p>
</td></tr>
<tr><tdclass="fieldname"><aid="a8a7acde49c4d55f2eb42e2b6869cdb3da11ce6c709e3b39a368358f2ee79942d6"></a>BAD_RESULT </td><tdclass="fielddoc"><p>This should not happen. There was an error in our code (i.e. file a bug). </p>
</td></tr>
</table>
<pclass="definition">Definition at line <aclass="el"href="max__flow_8h_source.html#l00180">180</a> of file <aclass="el"href="max__flow_8h_source.html">max_flow.h</a>.</p>
</div>
</div>
<h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>New node indices will be created lazily by <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a64c1cc700d51eca9eac6bec6542d0bfb"title="Adds a directed arc with the given capacity from tail to head.">AddArcWithCapacity()</a>. </p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Adds a directed arc with the given capacity from tail to head. </p>
<ul>
<li>Node indices and capacity must be non-negative (>= 0).</li>
<li>Self-looping and duplicate arcs are supported.</li>
<li>After the method finishes, <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a10899eb2ae1b242c4737e4c9e7ecdae5"title="Returns the current number of arcs in the graph.">NumArcs()</a> == the returned ArcIndex + 1. </li>
<p>Creates the protocol buffer representation of the problem used by the last <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> call. </p>
<p>Returns the flow on the given arc in the last OPTIMAL <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. </p>
<dlclass="section note"><dt>Note</dt><dd>It is possible that there is more than one optimal solution. The algorithm is deterministic so it will always return the same solution for a given problem. However, there is no guarantee of this from one code version to the next (but the code does not change often). </dd></dl>
<p>Returns the nodes that can reach the sink by non-saturated arcs, the outgoing arcs of this set form a minimum cut. </p>
<p>Note that if this is the complement set of GetNodeReachableFromSource(), then the min-cut is unique. This works only if <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> returned OPTIMAL. </p>
<p>Returns the nodes reachable from the source by non-saturated arcs (.i.e. </p>
<p>arc with Flow(arc) < Capacity(arc)), the outgoing arcs of this set form a minimum cut. This works only if <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> returned OPTIMAL. </p>
<p>This is one more than the largest node index seen so far in <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a64c1cc700d51eca9eac6bec6542d0bfb"title="Adds a directed arc with the given capacity from tail to head.">AddArcWithCapacity()</a>. </p>
<p>Returns the maximum flow we can send from the source to the sink in the last OPTIMAL <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. </p>
<dlclass="section warning"><dt>Warning</dt><dd>This looks like it enables incremental solves, but as of 2018-02, the next <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> will restart from scratch anyway. </dd></dl>
<dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000044">Todo:</a></b></dt><dd>(user): Support incrementality in the max flow implementation. </dd></dl>
<p>The implementation will crash if "arc" is not in [0, <aclass="el"href="classoperations__research_1_1SimpleMaxFlow.html#a10899eb2ae1b242c4737e4c9e7ecdae5"title="Returns the current number of arcs in the graph.">NumArcs()</a>). </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>