480 lines
33 KiB
HTML
480 lines
33 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>OR-Tools</title>
|
|
<meta http-equiv="Content-Type" content="text/html;"/>
|
|
<meta charset="utf-8"/>
|
|
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
|
|
<link rel="stylesheet" type="text/css" href="ortools.css" title="default" media="screen,print" />
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">OR-Tools 7.2</span>
|
|
</div>
|
|
</div>
|
|
<link rel="icon" href="https://developers.google.com/optimization/images/orLogo.png">
|
|
<div id="content">
|
|
<!-- Generated by Doxygen 1.8.15 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="namespaceoperations__research.html">operations_research</a></li><li class="navelem"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html">SimpleMaxFlow</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classoperations__research_1_1SimpleMaxFlow-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">operations_research::SimpleMaxFlow Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>A simple and efficient max-cost flow interface.
|
|
<a href="classoperations__research_1_1SimpleMaxFlow.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="max__flow_8h_source.html">max_flow.h</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:a8a7acde49c4d55f2eb42e2b6869cdb3d"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">Status</a> { <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da3b60465215ab4363dec64fd313771658">OPTIMAL</a>,
|
|
<a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da18a3ff25435f10be68329d4b39de4700">POSSIBLE_OVERFLOW</a>,
|
|
<a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da2260e76ea3adc21a9cd21f46f232ebbc">BAD_INPUT</a>,
|
|
<a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da11ce6c709e3b39a368358f2ee79942d6">BAD_RESULT</a>
|
|
}</td></tr>
|
|
<tr class="memdesc:a8a7acde49c4d55f2eb42e2b6869cdb3d"><td class="mdescLeft"> </td><td class="mdescRight">Solves the problem (finds the maximum flow from the given source to the given sink), and returns the problem status. <a href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">More...</a><br /></td></tr>
|
|
<tr class="separator:a8a7acde49c4d55f2eb42e2b6869cdb3d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:ada0b88e232c739108184deb35dd54b3f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#ada0b88e232c739108184deb35dd54b3f">SimpleMaxFlow</a> ()</td></tr>
|
|
<tr class="memdesc:ada0b88e232c739108184deb35dd54b3f"><td class="mdescLeft"> </td><td class="mdescRight">The constructor takes no size. <a href="#ada0b88e232c739108184deb35dd54b3f">More...</a><br /></td></tr>
|
|
<tr class="separator:ada0b88e232c739108184deb35dd54b3f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a64c1cc700d51eca9eac6bec6542d0bfb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a64c1cc700d51eca9eac6bec6542d0bfb">AddArcWithCapacity</a> (<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> tail, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> head, <a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> capacity)</td></tr>
|
|
<tr class="memdesc:a64c1cc700d51eca9eac6bec6542d0bfb"><td class="mdescLeft"> </td><td class="mdescRight">Adds a directed arc with the given capacity from tail to head. <a href="#a64c1cc700d51eca9eac6bec6542d0bfb">More...</a><br /></td></tr>
|
|
<tr class="separator:a64c1cc700d51eca9eac6bec6542d0bfb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a200b4dbff9102ee1232e05f569fc2427"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a200b4dbff9102ee1232e05f569fc2427">NumNodes</a> () const</td></tr>
|
|
<tr class="memdesc:a200b4dbff9102ee1232e05f569fc2427"><td class="mdescLeft"> </td><td class="mdescRight">Returns the current number of nodes. <a href="#a200b4dbff9102ee1232e05f569fc2427">More...</a><br /></td></tr>
|
|
<tr class="separator:a200b4dbff9102ee1232e05f569fc2427"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a10899eb2ae1b242c4737e4c9e7ecdae5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a10899eb2ae1b242c4737e4c9e7ecdae5">NumArcs</a> () const</td></tr>
|
|
<tr class="memdesc:a10899eb2ae1b242c4737e4c9e7ecdae5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the current number of arcs in the graph. <a href="#a10899eb2ae1b242c4737e4c9e7ecdae5">More...</a><br /></td></tr>
|
|
<tr class="separator:a10899eb2ae1b242c4737e4c9e7ecdae5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aead7fdba72a6048caad9c20150368348"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#aead7fdba72a6048caad9c20150368348">Tail</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="memdesc:aead7fdba72a6048caad9c20150368348"><td class="mdescLeft"> </td><td class="mdescRight">Returns user-provided data. <a href="#aead7fdba72a6048caad9c20150368348">More...</a><br /></td></tr>
|
|
<tr class="separator:aead7fdba72a6048caad9c20150368348"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab239080405c843687c20d1533b5512be"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#ab239080405c843687c20d1533b5512be">Head</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="separator:ab239080405c843687c20d1533b5512be"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a86dad6a200cad46b7d53305e2837cfb3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a86dad6a200cad46b7d53305e2837cfb3">Capacity</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="separator:a86dad6a200cad46b7d53305e2837cfb3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5ae2ad55f2fd8ce704fe695f835c2ed2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve</a> (<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> source, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> sink)</td></tr>
|
|
<tr class="separator:a5ae2ad55f2fd8ce704fe695f835c2ed2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a553204b2dccf205ff9c00c3c589d309b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a553204b2dccf205ff9c00c3c589d309b">OptimalFlow</a> () const</td></tr>
|
|
<tr class="memdesc:a553204b2dccf205ff9c00c3c589d309b"><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximum flow we can send from the source to the sink in the last OPTIMAL <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. <a href="#a553204b2dccf205ff9c00c3c589d309b">More...</a><br /></td></tr>
|
|
<tr class="separator:a553204b2dccf205ff9c00c3c589d309b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aef35310ddd005652bb2b3db14c323ae9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#aef35310ddd005652bb2b3db14c323ae9">Flow</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="memdesc:aef35310ddd005652bb2b3db14c323ae9"><td class="mdescLeft"> </td><td class="mdescRight">Returns the flow on the given arc in the last OPTIMAL <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. <a href="#aef35310ddd005652bb2b3db14c323ae9">More...</a><br /></td></tr>
|
|
<tr class="separator:aef35310ddd005652bb2b3db14c323ae9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae83c98d7dcf6a2d76a5d500273255fe6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#ae83c98d7dcf6a2d76a5d500273255fe6">GetSourceSideMinCut</a> (std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > *result)</td></tr>
|
|
<tr class="memdesc:ae83c98d7dcf6a2d76a5d500273255fe6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the nodes reachable from the source by non-saturated arcs (.i.e. <a href="#ae83c98d7dcf6a2d76a5d500273255fe6">More...</a><br /></td></tr>
|
|
<tr class="separator:ae83c98d7dcf6a2d76a5d500273255fe6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a693abc3c55e13dbe2f836e562b5a9c0f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a693abc3c55e13dbe2f836e562b5a9c0f">GetSinkSideMinCut</a> (std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > *result)</td></tr>
|
|
<tr class="memdesc:a693abc3c55e13dbe2f836e562b5a9c0f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the nodes that can reach the sink by non-saturated arcs, the outgoing arcs of this set form a minimum cut. <a href="#a693abc3c55e13dbe2f836e562b5a9c0f">More...</a><br /></td></tr>
|
|
<tr class="separator:a693abc3c55e13dbe2f836e562b5a9c0f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a177f9e6c8a8c603e3cead358da5d1026"><td class="memItemLeft" align="right" valign="top">FlowModel </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a177f9e6c8a8c603e3cead358da5d1026">CreateFlowModelOfLastSolve</a> ()</td></tr>
|
|
<tr class="memdesc:a177f9e6c8a8c603e3cead358da5d1026"><td class="mdescLeft"> </td><td class="mdescRight">Creates the protocol buffer representation of the problem used by the last <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> call. <a href="#a177f9e6c8a8c603e3cead358da5d1026">More...</a><br /></td></tr>
|
|
<tr class="separator:a177f9e6c8a8c603e3cead358da5d1026"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a57296b653813abdd8d711048e87d1212"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a57296b653813abdd8d711048e87d1212">SetArcCapacity</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc, <a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> capacity)</td></tr>
|
|
<tr class="memdesc:a57296b653813abdd8d711048e87d1212"><td class="mdescLeft"> </td><td class="mdescRight">Change the capacity of an arc. <a href="#a57296b653813abdd8d711048e87d1212">More...</a><br /></td></tr>
|
|
<tr class="separator:a57296b653813abdd8d711048e87d1212"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="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>
|
|
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000041">Todo:</a></b></dt><dd>(user): If the need arises, extend this interface to support warm start. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="max__flow_8h_source.html#l00152">152</a> of file <a class="el" href="max__flow_8h_source.html">max_flow.h</a>.</p>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="a8a7acde49c4d55f2eb42e2b6869cdb3d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8a7acde49c4d55f2eb42e2b6869cdb3d">◆ </a></span>Status</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">operations_research::SimpleMaxFlow::Status</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Solves the problem (finds the maximum flow from the given source to the given sink), and returns the problem status. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a8a7acde49c4d55f2eb42e2b6869cdb3da3b60465215ab4363dec64fd313771658"></a>OPTIMAL </td><td class="fielddoc"><p><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> was called and found an optimal solution. </p>
|
|
<p>Note that <a class="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><td class="fieldname"><a id="a8a7acde49c4d55f2eb42e2b6869cdb3da18a3ff25435f10be68329d4b39de4700"></a>POSSIBLE_OVERFLOW </td><td class="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>
|
|
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000044">Todo:</a></b></dt><dd>(user): rename POSSIBLE_OVERFLOW to INT_OVERFLOW and modify our clients. </dd></dl>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a8a7acde49c4d55f2eb42e2b6869cdb3da2260e76ea3adc21a9cd21f46f232ebbc"></a>BAD_INPUT </td><td class="fielddoc"><p>The input is inconsistent (bad tail/head/capacity values). </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a8a7acde49c4d55f2eb42e2b6869cdb3da11ce6c709e3b39a368358f2ee79942d6"></a>BAD_RESULT </td><td class="fielddoc"><p>This should not happen. There was an error in our code (i.e. file a bug). </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="max__flow_8h_source.html#l00180">180</a> of file <a class="el" href="max__flow_8h_source.html">max_flow.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="ada0b88e232c739108184deb35dd54b3f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ada0b88e232c739108184deb35dd54b3f">◆ </a></span>SimpleMaxFlow()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">operations_research::SimpleMaxFlow::SimpleMaxFlow </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The constructor takes no size. </p>
|
|
<p>New node indices will be created lazily by <a class="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>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a64c1cc700d51eca9eac6bec6542d0bfb"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a64c1cc700d51eca9eac6bec6542d0bfb">◆ </a></span>AddArcWithCapacity()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> operations_research::SimpleMaxFlow::AddArcWithCapacity </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>tail</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>head</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> </td>
|
|
<td class="paramname"><em>capacity</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<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, <a class="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>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a86dad6a200cad46b7d53305e2837cfb3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a86dad6a200cad46b7d53305e2837cfb3">◆ </a></span>Capacity()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> operations_research::SimpleMaxFlow::Capacity </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td>
|
|
<td class="paramname"><em>arc</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a177f9e6c8a8c603e3cead358da5d1026"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a177f9e6c8a8c603e3cead358da5d1026">◆ </a></span>CreateFlowModelOfLastSolve()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">FlowModel operations_research::SimpleMaxFlow::CreateFlowModelOfLastSolve </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Creates the protocol buffer representation of the problem used by the last <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> call. </p>
|
|
<p>This is mainly useful for debugging. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aef35310ddd005652bb2b3db14c323ae9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aef35310ddd005652bb2b3db14c323ae9">◆ </a></span>Flow()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> operations_research::SimpleMaxFlow::Flow </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td>
|
|
<td class="paramname"><em>arc</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the flow on the given arc in the last OPTIMAL <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. </p>
|
|
<dl class="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>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a693abc3c55e13dbe2f836e562b5a9c0f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a693abc3c55e13dbe2f836e562b5a9c0f">◆ </a></span>GetSinkSideMinCut()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void operations_research::SimpleMaxFlow::GetSinkSideMinCut </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > * </td>
|
|
<td class="paramname"><em>result</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<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 <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> returned OPTIMAL. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae83c98d7dcf6a2d76a5d500273255fe6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae83c98d7dcf6a2d76a5d500273255fe6">◆ </a></span>GetSourceSideMinCut()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void operations_research::SimpleMaxFlow::GetSourceSideMinCut </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > * </td>
|
|
<td class="paramname"><em>result</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<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 <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> returned OPTIMAL. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab239080405c843687c20d1533b5512be"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab239080405c843687c20d1533b5512be">◆ </a></span>Head()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> operations_research::SimpleMaxFlow::Head </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td>
|
|
<td class="paramname"><em>arc</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a10899eb2ae1b242c4737e4c9e7ecdae5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a10899eb2ae1b242c4737e4c9e7ecdae5">◆ </a></span>NumArcs()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> operations_research::SimpleMaxFlow::NumArcs </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the current number of arcs in the graph. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a200b4dbff9102ee1232e05f569fc2427"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a200b4dbff9102ee1232e05f569fc2427">◆ </a></span>NumNodes()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> operations_research::SimpleMaxFlow::NumNodes </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the current number of nodes. </p>
|
|
<p>This is one more than the largest node index seen so far in <a class="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>
|
|
<a id="a553204b2dccf205ff9c00c3c589d309b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a553204b2dccf205ff9c00c3c589d309b">◆ </a></span>OptimalFlow()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> operations_research::SimpleMaxFlow::OptimalFlow </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the maximum flow we can send from the source to the sink in the last OPTIMAL <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> context. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a57296b653813abdd8d711048e87d1212"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a57296b653813abdd8d711048e87d1212">◆ </a></span>SetArcCapacity()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void operations_research::SimpleMaxFlow::SetArcCapacity </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td>
|
|
<td class="paramname"><em>arc</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> </td>
|
|
<td class="paramname"><em>capacity</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Change the capacity of an arc. </p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>This looks like it enables incremental solves, but as of 2018-02, the next <a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a5ae2ad55f2fd8ce704fe695f835c2ed2">Solve()</a> will restart from scratch anyway. </dd></dl>
|
|
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000043">Todo:</a></b></dt><dd>(user): Support incrementality in the max flow implementation. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5ae2ad55f2fd8ce704fe695f835c2ed2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5ae2ad55f2fd8ce704fe695f835c2ed2">◆ </a></span>Solve()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">Status</a> operations_research::SimpleMaxFlow::Solve </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>source</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>sink</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aead7fdba72a6048caad9c20150368348"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aead7fdba72a6048caad9c20150368348">◆ </a></span>Tail()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> operations_research::SimpleMaxFlow::Tail </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> </td>
|
|
<td class="paramname"><em>arc</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns user-provided data. </p>
|
|
<p>The implementation will crash if "arc" is not in [0, <a class="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>
|
|
<li><a class="el" href="max__flow_8h_source.html">max_flow.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|