531 lines
36 KiB
HTML
531 lines
36 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_1SimpleMinCostFlow.html">SimpleMinCostFlow</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_1SimpleMinCostFlow-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">operations_research::SimpleMinCostFlow Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>A simple and efficient min-cost flow interface.
|
|
<a href="classoperations__research_1_1SimpleMinCostFlow.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="min__cost__flow_8h_source.html">min_cost_flow.h</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for operations_research::SimpleMinCostFlow:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classoperations__research_1_1SimpleMinCostFlow__inherit__graph.png" border="0" usemap="#operations__research_1_1SimpleMinCostFlow_inherit__map" alt="Inheritance graph"/></div>
|
|
<map name="operations__research_1_1SimpleMinCostFlow_inherit__map" id="operations__research_1_1SimpleMinCostFlow_inherit__map">
|
|
<area shape="rect" title="A simple and efficient min-cost flow interface." alt="" coords="5,92,152,131"/>
|
|
<area shape="rect" href="classoperations__research_1_1MinCostFlowBase.html" title="Different statuses for a solved problem." alt="" coords="7,5,150,44"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<div class="dynheader">
|
|
Collaboration diagram for operations_research::SimpleMinCostFlow:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classoperations__research_1_1SimpleMinCostFlow__coll__graph.png" border="0" usemap="#operations__research_1_1SimpleMinCostFlow_coll__map" alt="Collaboration graph"/></div>
|
|
<map name="operations__research_1_1SimpleMinCostFlow_coll__map" id="operations__research_1_1SimpleMinCostFlow_coll__map">
|
|
<area shape="rect" title="A simple and efficient min-cost flow interface." alt="" coords="5,92,152,131"/>
|
|
<area shape="rect" href="classoperations__research_1_1MinCostFlowBase.html" title="Different statuses for a solved problem." alt="" coords="7,5,150,44"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<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:ae5cad0c7d9c3eddbc7c3aefbee060457"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457">Status</a> { <br />
|
|
  <a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457a44ab1b2f3c5251267bce749661e4e6de">NOT_SOLVED</a>,
|
|
<a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457a7ba4907297a99141ebd2bc890d5a591c">OPTIMAL</a>,
|
|
<a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457ab78b8e2734f0e777e79b8e5f93948101">FEASIBLE</a>,
|
|
<a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457af323941c683086f71ce1e7cae7a0a1b3">INFEASIBLE</a>,
|
|
<br />
|
|
  <a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457ad79843de8fcdec97ba2ce9b83d6cf3c1">UNBALANCED</a>,
|
|
<a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457a030d97dcea9960e3d1f127024b0e2168">BAD_RESULT</a>,
|
|
<a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457a41523b94852c3cb55c86ce0e291e3719">BAD_COST_RANGE</a>
|
|
<br />
|
|
}</td></tr>
|
|
<tr class="separator:ae5cad0c7d9c3eddbc7c3aefbee060457"><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:a4f442c73b242e40a793d529df4e44d07"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#a4f442c73b242e40a793d529df4e44d07">SimpleMinCostFlow</a> ()</td></tr>
|
|
<tr class="memdesc:a4f442c73b242e40a793d529df4e44d07"><td class="mdescLeft"> </td><td class="mdescRight">The constructor takes no size. <a href="#a4f442c73b242e40a793d529df4e44d07">More...</a><br /></td></tr>
|
|
<tr class="separator:a4f442c73b242e40a793d529df4e44d07"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a632cc069a03f2d9873715467c09a3810"><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_1SimpleMinCostFlow.html#a632cc069a03f2d9873715467c09a3810">AddArcWithCapacityAndUnitCost</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, <a class="el" href="namespaceoperations__research.html#aa7950685633ee869aa9471b2ec5fbcfa">CostValue</a> unit_cost)</td></tr>
|
|
<tr class="memdesc:a632cc069a03f2d9873715467c09a3810"><td class="mdescLeft"> </td><td class="mdescRight">Adds a directed arc from tail to head to the underlying graph with a given capacity and cost per unit of flow. <a href="#a632cc069a03f2d9873715467c09a3810">More...</a><br /></td></tr>
|
|
<tr class="separator:a632cc069a03f2d9873715467c09a3810"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7410b695f7e06dd3de7e6920bc28a3ac"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#a7410b695f7e06dd3de7e6920bc28a3ac">SetNodeSupply</a> (<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> node, <a class="el" href="namespaceoperations__research.html#a5841ff601ab08548afb15c45b2245de7">FlowQuantity</a> supply)</td></tr>
|
|
<tr class="memdesc:a7410b695f7e06dd3de7e6920bc28a3ac"><td class="mdescLeft"> </td><td class="mdescRight">Sets the supply of the given node. <a href="#a7410b695f7e06dd3de7e6920bc28a3ac">More...</a><br /></td></tr>
|
|
<tr class="separator:a7410b695f7e06dd3de7e6920bc28a3ac"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af4eeb2bca251bf02604bcbea5c304421"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#af4eeb2bca251bf02604bcbea5c304421">Solve</a> ()</td></tr>
|
|
<tr class="memdesc:af4eeb2bca251bf02604bcbea5c304421"><td class="mdescLeft"> </td><td class="mdescRight">Solves the problem, and returns the problem status. <a href="#af4eeb2bca251bf02604bcbea5c304421">More...</a><br /></td></tr>
|
|
<tr class="separator:af4eeb2bca251bf02604bcbea5c304421"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a443e6d29a83127237379abb898a26195"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#a443e6d29a83127237379abb898a26195">SolveMaxFlowWithMinCost</a> ()</td></tr>
|
|
<tr class="memdesc:a443e6d29a83127237379abb898a26195"><td class="mdescLeft"> </td><td class="mdescRight">Same as <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#af4eeb2bca251bf02604bcbea5c304421" title="Solves the problem, and returns the problem status.">Solve()</a>, but does not have the restriction that the supply must match the demand or that the graph has enough capacity to serve all the demand or use all the supply. <a href="#a443e6d29a83127237379abb898a26195">More...</a><br /></td></tr>
|
|
<tr class="separator:a443e6d29a83127237379abb898a26195"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aaec6a152673412884a7c0d1b59991a70"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#aa7950685633ee869aa9471b2ec5fbcfa">CostValue</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#aaec6a152673412884a7c0d1b59991a70">OptimalCost</a> () const</td></tr>
|
|
<tr class="memdesc:aaec6a152673412884a7c0d1b59991a70"><td class="mdescLeft"> </td><td class="mdescRight">Returns the cost of the minimum-cost flow found by the algorithm when the returned Status is OPTIMAL. <a href="#aaec6a152673412884a7c0d1b59991a70">More...</a><br /></td></tr>
|
|
<tr class="separator:aaec6a152673412884a7c0d1b59991a70"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a49270938ce4794ae76f8a25c23ddef65"><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_1SimpleMinCostFlow.html#a49270938ce4794ae76f8a25c23ddef65">MaximumFlow</a> () const</td></tr>
|
|
<tr class="memdesc:a49270938ce4794ae76f8a25c23ddef65"><td class="mdescLeft"> </td><td class="mdescRight">Returns the total flow of the minimum-cost flow found by the algorithm when the returned Status is OPTIMAL. <a href="#a49270938ce4794ae76f8a25c23ddef65">More...</a><br /></td></tr>
|
|
<tr class="separator:a49270938ce4794ae76f8a25c23ddef65"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac2a7f803ea909ac1f3225f2607f1f33b"><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_1SimpleMinCostFlow.html#ac2a7f803ea909ac1f3225f2607f1f33b">Flow</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="memdesc:ac2a7f803ea909ac1f3225f2607f1f33b"><td class="mdescLeft"> </td><td class="mdescRight">Returns the flow on arc, this only make sense for a successful <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#af4eeb2bca251bf02604bcbea5c304421" title="Solves the problem, and returns the problem status.">Solve()</a>. <a href="#ac2a7f803ea909ac1f3225f2607f1f33b">More...</a><br /></td></tr>
|
|
<tr class="separator:ac2a7f803ea909ac1f3225f2607f1f33b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac80325e043df267da7b4f9e0799bba54"><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_1SimpleMinCostFlow.html#ac80325e043df267da7b4f9e0799bba54">NumNodes</a> () const</td></tr>
|
|
<tr class="memdesc:ac80325e043df267da7b4f9e0799bba54"><td class="mdescLeft"> </td><td class="mdescRight">Accessors for the user given data. <a href="#ac80325e043df267da7b4f9e0799bba54">More...</a><br /></td></tr>
|
|
<tr class="separator:ac80325e043df267da7b4f9e0799bba54"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aad61644a352f9eccbce03deffa6f6313"><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_1SimpleMinCostFlow.html#aad61644a352f9eccbce03deffa6f6313">NumArcs</a> () const</td></tr>
|
|
<tr class="separator:aad61644a352f9eccbce03deffa6f6313"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a492bdbfb9459995c0f0c41c1cbd0b1bd"><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_1SimpleMinCostFlow.html#a492bdbfb9459995c0f0c41c1cbd0b1bd">Tail</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="separator:a492bdbfb9459995c0f0c41c1cbd0b1bd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4792c687fa3c6fc576f0495e542ee6e5"><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_1SimpleMinCostFlow.html#a4792c687fa3c6fc576f0495e542ee6e5">Head</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="separator:a4792c687fa3c6fc576f0495e542ee6e5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6f1a6fedf4eff7e8b015564e0a4fc786"><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_1SimpleMinCostFlow.html#a6f1a6fedf4eff7e8b015564e0a4fc786">Capacity</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="separator:a6f1a6fedf4eff7e8b015564e0a4fc786"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a034e472c35933cd3b6c6fc02985f54f7"><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_1SimpleMinCostFlow.html#a034e472c35933cd3b6c6fc02985f54f7">Supply</a> (<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> node) const</td></tr>
|
|
<tr class="separator:a034e472c35933cd3b6c6fc02985f54f7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a98af872df7cb24c5d3074cc44a16f9a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#aa7950685633ee869aa9471b2ec5fbcfa">CostValue</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#a98af872df7cb24c5d3074cc44a16f9a7">UnitCost</a> (<a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a> arc) const</td></tr>
|
|
<tr class="separator:a98af872df7cb24c5d3074cc44a16f9a7"><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 min-cost flow interface. </p>
|
|
<p>This is as fast as GenericMinCostFlow<ReverseArcStaticGraph>, which is the fastest, but is 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#_todo000048">Todo:</a></b></dt><dd>(user): If the need arises, extend this interface to support warm start and incrementality between solves. Note that this is already supported by the GenericMinCostFlow<> interface. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="min__cost__flow_8h_source.html#l00213">213</a> of file <a class="el" href="min__cost__flow_8h_source.html">min_cost_flow.h</a>.</p>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="ae5cad0c7d9c3eddbc7c3aefbee060457"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae5cad0c7d9c3eddbc7c3aefbee060457">◆ </a></span>Status</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457">operations_research::MinCostFlowBase::Status</a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457a44ab1b2f3c5251267bce749661e4e6de"></a>NOT_SOLVED </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457a7ba4907297a99141ebd2bc890d5a591c"></a>OPTIMAL </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457ab78b8e2734f0e777e79b8e5f93948101"></a>FEASIBLE </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457af323941c683086f71ce1e7cae7a0a1b3"></a>INFEASIBLE </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457ad79843de8fcdec97ba2ce9b83d6cf3c1"></a>UNBALANCED </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457a030d97dcea9960e3d1f127024b0e2168"></a>BAD_RESULT </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="ae5cad0c7d9c3eddbc7c3aefbee060457a41523b94852c3cb55c86ce0e291e3719"></a>BAD_COST_RANGE </td><td class="fielddoc"></td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="min__cost__flow_8h_source.html#l00194">194</a> of file <a class="el" href="min__cost__flow_8h_source.html">min_cost_flow.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a4f442c73b242e40a793d529df4e44d07"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4f442c73b242e40a793d529df4e44d07">◆ </a></span>SimpleMinCostFlow()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">operations_research::SimpleMinCostFlow::SimpleMinCostFlow </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_1SimpleMinCostFlow.html#a632cc069a03f2d9873715467c09a3810" title="Adds a directed arc from tail to head to the underlying graph with a given capacity and cost per unit...">AddArcWithCapacityAndUnitCost()</a> or <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#a7410b695f7e06dd3de7e6920bc28a3ac" title="Sets the supply of the given node.">SetNodeSupply()</a> such that the set of valid nodes will always be [0, <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#ac80325e043df267da7b4f9e0799bba54" title="Accessors for the user given data.">NumNodes()</a>). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a632cc069a03f2d9873715467c09a3810"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a632cc069a03f2d9873715467c09a3810">◆ </a></span>AddArcWithCapacityAndUnitCost()</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::SimpleMinCostFlow::AddArcWithCapacityAndUnitCost </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 class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#aa7950685633ee869aa9471b2ec5fbcfa">CostValue</a> </td>
|
|
<td class="paramname"><em>unit_cost</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Adds a directed arc from tail to head to the underlying graph with a given capacity and cost per unit of flow. </p>
|
|
<ul>
|
|
<li>Node indices and the capacity must be non-negative (>= 0).</li>
|
|
<li>The unit cost can take any integer value (even negative).</li>
|
|
<li>Self-looping and duplicate arcs are supported.</li>
|
|
<li>After the method finishes, <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#aad61644a352f9eccbce03deffa6f6313">NumArcs()</a> == the returned ArcIndex + 1. </li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6f1a6fedf4eff7e8b015564e0a4fc786"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6f1a6fedf4eff7e8b015564e0a4fc786">◆ </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::SimpleMinCostFlow::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="ac2a7f803ea909ac1f3225f2607f1f33b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac2a7f803ea909ac1f3225f2607f1f33b">◆ </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::SimpleMinCostFlow::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 arc, this only make sense for a successful <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#af4eeb2bca251bf02604bcbea5c304421" title="Solves the problem, and returns the problem status.">Solve()</a>. </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="a4792c687fa3c6fc576f0495e542ee6e5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4792c687fa3c6fc576f0495e542ee6e5">◆ </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::SimpleMinCostFlow::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="a49270938ce4794ae76f8a25c23ddef65"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a49270938ce4794ae76f8a25c23ddef65">◆ </a></span>MaximumFlow()</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::SimpleMinCostFlow::MaximumFlow </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the total flow of the minimum-cost flow found by the algorithm when the returned Status is OPTIMAL. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aad61644a352f9eccbce03deffa6f6313"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aad61644a352f9eccbce03deffa6f6313">◆ </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::SimpleMinCostFlow::NumArcs </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac80325e043df267da7b4f9e0799bba54"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac80325e043df267da7b4f9e0799bba54">◆ </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::SimpleMinCostFlow::NumNodes </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Accessors for the user given data. </p>
|
|
<p>The implementation will crash if "arc" is not in [0, <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#aad61644a352f9eccbce03deffa6f6313">NumArcs()</a>) or "node" is not in [0, <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#ac80325e043df267da7b4f9e0799bba54" title="Accessors for the user given data.">NumNodes()</a>). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aaec6a152673412884a7c0d1b59991a70"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aaec6a152673412884a7c0d1b59991a70">◆ </a></span>OptimalCost()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#aa7950685633ee869aa9471b2ec5fbcfa">CostValue</a> operations_research::SimpleMinCostFlow::OptimalCost </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the cost of the minimum-cost flow found by the algorithm when the returned Status is OPTIMAL. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a7410b695f7e06dd3de7e6920bc28a3ac"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7410b695f7e06dd3de7e6920bc28a3ac">◆ </a></span>SetNodeSupply()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void operations_research::SimpleMinCostFlow::SetNodeSupply </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>node</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>supply</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the supply of the given node. </p>
|
|
<p>The node index must be non-negative (>= 0). Nodes implicitly created will have a default supply set to 0. A demand is modeled as a negative supply. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af4eeb2bca251bf02604bcbea5c304421"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af4eeb2bca251bf02604bcbea5c304421">◆ </a></span>Solve()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457">Status</a> operations_research::SimpleMinCostFlow::Solve </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Solves the problem, and returns the problem status. </p>
|
|
<p>This function requires that the sum of all node supply minus node demand is zero and that the graph has enough capacity to send all supplies and serve all demands. Otherwise, it will return INFEASIBLE. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="min__cost__flow_8h_source.html#l00239">239</a> of file <a class="el" href="min__cost__flow_8h_source.html">min_cost_flow.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a443e6d29a83127237379abb898a26195"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a443e6d29a83127237379abb898a26195">◆ </a></span>SolveMaxFlowWithMinCost()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classoperations__research_1_1MinCostFlowBase.html#ae5cad0c7d9c3eddbc7c3aefbee060457">Status</a> operations_research::SimpleMinCostFlow::SolveMaxFlowWithMinCost </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Same as <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#af4eeb2bca251bf02604bcbea5c304421" title="Solves the problem, and returns the problem status.">Solve()</a>, but does not have the restriction that the supply must match the demand or that the graph has enough capacity to serve all the demand or use all the supply. </p>
|
|
<p>This will compute a maximum-flow with minimum cost. The value of the maximum-flow will be given by <a class="el" href="classoperations__research_1_1SimpleMinCostFlow.html#a49270938ce4794ae76f8a25c23ddef65" title="Returns the total flow of the minimum-cost flow found by the algorithm when the returned Status is OP...">MaximumFlow()</a>. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="min__cost__flow_8h_source.html#l00248">248</a> of file <a class="el" href="min__cost__flow_8h_source.html">min_cost_flow.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a034e472c35933cd3b6c6fc02985f54f7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a034e472c35933cd3b6c6fc02985f54f7">◆ </a></span>Supply()</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::SimpleMinCostFlow::Supply </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>node</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a492bdbfb9459995c0f0c41c1cbd0b1bd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a492bdbfb9459995c0f0c41c1cbd0b1bd">◆ </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::SimpleMinCostFlow::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">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a98af872df7cb24c5d3074cc44a16f9a7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a98af872df7cb24c5d3074cc44a16f9a7">◆ </a></span>UnitCost()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#aa7950685633ee869aa9471b2ec5fbcfa">CostValue</a> operations_research::SimpleMinCostFlow::UnitCost </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>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="min__cost__flow_8h_source.html">min_cost_flow.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|