<ahref="max__flow_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2010-2018 Google LLC</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// you may not use this file except in compliance with the License.</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// You may obtain a copy of the License at</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">// See the License for the specific language governing permissions and</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">// limitations under the License.</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> </div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment">// An implementation of a push-relabel algorithm for the max flow problem.</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment">// In the following, we consider a graph G = (V,E,s,t) where V denotes the set</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">// of nodes (vertices) in the graph, E denotes the set of arcs (edges). s and t</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment">// denote distinguished nodes in G called source and target. n = |V| denotes the</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment">// number of nodes in the graph, and m = |E| denotes the number of arcs in the</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment">// graph.</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment">// Each arc (v,w) is associated a capacity c(v,w).</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment">// A flow is a function from E to R such that:</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="comment">// a) f(
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a92fbc9576b457ceddeb21395181b3273"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a92fbc9576b457ceddeb21395181b3273">operations_research::GenericMaxFlow::check_result_</a></div><divclass="ttdeci">bool check_result_</div><divclass="ttdoc">Whether or not we check the result.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00638">max_flow.h:638</a></div></div>
<divclass="ttc"id="classoperations__research_1_1PriorityQueueWithRestrictedPush_html"><divclass="ttname"><ahref="classoperations__research_1_1PriorityQueueWithRestrictedPush.html">operations_research::PriorityQueueWithRestrictedPush</a></div><divclass="ttdoc">Specific but efficient priority queue implementation.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00264">max_flow.h:264</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html">operations_research::SimpleMaxFlow</a></div><divclass="ttdoc">A simple and efficient max-cost flow interface.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00152">max_flow.h:152</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a553204b2dccf205ff9c00c3c589d309b"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a553204b2dccf205ff9c00c3c589d309b">operations_research::SimpleMaxFlow::OptimalFlow</a></div><divclass="ttdeci">FlowQuantity OptimalFlow() const</div><divclass="ttdoc">Returns the maximum flow we can send from the source to the sink in the last OPTIMAL Solve() context.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a8f83ce5b69d2e3d4cbf314ed6b3d01a6"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a8f83ce5b69d2e3d4cbf314ed6b3d01a6">operations_research::GenericMaxFlow::graph</a></div><divclass="ttdeci">const Graph * graph() const</div><divclass="ttdoc">Returns the graph associated to the current object.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00338">max_flow.h:338</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aeeb216a2384f75c7a46cf54de35027d2"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aeeb216a2384f75c7a46cf54de35027d2">operations_research::GenericMaxFlow::GetSourceNodeIndex</a></div><divclass="ttdeci">NodeIndex GetSourceNodeIndex() const</div><divclass="ttdoc">Returns the index of the node corresponding to the source of the network.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00346">max_flow.h:346</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a643e76aab33e0ee6c13b0b336af05352"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a643e76aab33e0ee6c13b0b336af05352">operations_research::GenericMaxFlow::check_input_</a></div><divclass="ttdeci">bool check_input_</div><divclass="ttdoc">Whether or not we check the input, this is a small price to pay for robustness.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00634">max_flow.h:634</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a9a357ac0cc6e451b5b1b81a9abdeb49b"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a9a357ac0cc6e451b5b1b81a9abdeb49b">operations_research::GenericMaxFlow::SetArcFlow</a></div><divclass="ttdeci">void SetArcFlow(ArcIndex arc, FlowQuantity new_flow)</div><divclass="ttdoc">Sets the flow for arc.</div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a693abc3c55e13dbe2f836e562b5a9c0f"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a693abc3c55e13dbe2f836e562b5a9c0f">operations_research::SimpleMaxFlow::GetSinkSideMinCut</a></div><divclass="ttdeci">void GetSinkSideMinCut(std::vector< NodeIndex > *result)</div><divclass="ttdoc">Returns the nodes that can reach the sink by non-saturated arcs, the outgoing arcs of this set form a...</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a6881e220a50b6ab95192f7f263b5eee6"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a6881e220a50b6ab95192f7f263b5eee6">operations_research::GenericMaxFlow::node_excess_</a></div><divclass="ttdeci">QuantityArray node_excess_</div><divclass="ttdoc">An array representing the excess for each node in graph_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00550">max_flow.h:550</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a7cc8b8045738632185c7c0f82eb9791f"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a7cc8b8045738632185c7c0f82eb9791f">operations_research::GenericMaxFlow::active_node_by_height_</a></div><divclass="ttdeci">PriorityQueueWithRestrictedPush< NodeIndex, NodeHeight > active_node_by_height_</div><divclass="ttdoc">A priority queue used for managing active nodes in the algorithm.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00597">max_flow.h:597</a></div></div>
<divclass="ttc"id="namespaceutil_html_ae76339cb2dcd3bc05ad762146f91fdda"><divclass="ttname"><ahref="namespaceutil.html#ae76339cb2dcd3bc05ad762146f91fdda">util::Graph</a></div><divclass="ttdeci">ListGraph Graph</div><divclass="ttdoc">Defining the simplest Graph interface as Graph for convenience.</div><divclass="ttdef"><b>Definition:</b><ahref="graph_8h_source.html#l02358">graph.h:2358</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a177f9e6c8a8c603e3cead358da5d1026"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a177f9e6c8a8c603e3cead358da5d1026">operations_research::SimpleMaxFlow::CreateFlowModelOfLastSolve</a></div><divclass="ttdeci">FlowModel CreateFlowModelOfLastSolve()</div><divclass="ttdoc">Creates the protocol buffer representation of the problem used by the last Solve() call.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a9662fa5cf2007a62968e6c22fb8a4564"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a9662fa5cf2007a62968e6c22fb8a4564">operations_research::GenericMaxFlow::status</a></div><divclass="ttdeci">Status status() const</div><divclass="ttdoc">Returns the status of last call to Solve().</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00343">max_flow.h:343</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a8a7acde49c4d55f2eb42e2b6869cdb3da2260e76ea3adc21a9cd21f46f232ebbc"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da2260e76ea3adc21a9cd21f46f232ebbc">operations_research::SimpleMaxFlow::BAD_INPUT</a></div><divclass="ttdoc">The input is inconsistent (bad tail/head/capacity values).</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00192">max_flow.h:192</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a6a160e49372bec143572964e6b19f444"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a6a160e49372bec143572964e6b19f444">operations_research::GenericMaxFlow::CheckInputConsistency</a></div><divclass="ttdeci">bool CheckInputConsistency() const</div><divclass="ttdoc">Checks the consistency of the input, i.e.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a2d2ffca7a04ecd2975025cb34a3898cb"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a2d2ffca7a04ecd2975025cb34a3898cb">operations_research::GenericMaxFlow::SaturateOutgoingArcsFromSource</a></div><divclass="ttdeci">bool SaturateOutgoingArcsFromSource()</div><divclass="ttdoc">Tries to saturate all the outgoing arcs from the source that can reach the sink.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aaf724f9c00dee72b9b2e510e9e88e13e"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aaf724f9c00dee72b9b2e510e9e88e13e">operations_research::GenericMaxFlow::node_in_bfs_queue_</a></div><divclass="ttdeci">std::vector< bool > node_in_bfs_queue_</div><divclass="ttdoc">BFS queue used by the GlobalUpdate() function.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00610">max_flow.h:610</a></div></div>
<divclass="ttc"id="classoperations__research_1_1MaxFlowStatusClass_html"><divclass="ttname"><ahref="classoperations__research_1_1MaxFlowStatusClass.html">operations_research::MaxFlowStatusClass</a></div><divclass="ttdoc">We want an enum for the Status of a max flow run, and we want this enum to be scoped under GenericMax...</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00300">max_flow.h:300</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a9dbc134de4c5e1d424b49f7000c713f4"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a9dbc134de4c5e1d424b49f7000c713f4">operations_research::GenericMaxFlow::CheckRelabelPrecondition</a></div><divclass="ttdeci">bool CheckRelabelPrecondition(NodeIndex node) const</div><divclass="ttdoc">Returns true if a precondition for Relabel is met, i.e.</div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a8a7acde49c4d55f2eb42e2b6869cdb3d"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3d">operations_research::SimpleMaxFlow::Status</a></div><divclass="ttdeci">Status</div><divclass="ttdoc">Solves the problem (finds the maximum flow from the given source to the given sink),...</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00180">max_flow.h:180</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a784643a086180b1755f704d652f564a0"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a784643a086180b1755f704d652f564a0">operations_research::GenericMaxFlow::status_</a></div><divclass="ttdeci">Status status_</div><divclass="ttdoc">The status of the problem.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00606">max_flow.h:606</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a5a2c545458610cc9b1486ae083708574"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a5a2c545458610cc9b1486ae083708574">operations_research::GenericMaxFlow::Discharge</a></div><divclass="ttdeci">void Discharge(NodeIndex node)</div><divclass="ttdoc">Discharges an active node node by saturating its admissible adjacent arcs, if any,...</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aa70e526f9be229e52bf598d9cd0e7406"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aa70e526f9be229e52bf598d9cd0e7406">operations_research::GenericMaxFlow::Relabel</a></div><divclass="ttdeci">void Relabel(NodeIndex node)</div><divclass="ttdoc">Relabels a node, i.e.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a3b47bff3c2733b198d34aeaa0cbcfa19"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a3b47bff3c2733b198d34aeaa0cbcfa19">operations_research::GenericMaxFlow::InitializeActiveNodeContainer</a></div><divclass="ttdeci">void InitializeActiveNodeContainer()</div><divclass="ttdoc">Initializes the container active_nodes_.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a8c16f1156b2e038ca0d3f8ba96490ab5"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a8c16f1156b2e038ca0d3f8ba96490ab5">operations_research::GenericMaxFlow::GetSinkNodeIndex</a></div><divclass="ttdeci">NodeIndex GetSinkNodeIndex() const</div><divclass="ttdoc">Returns the index of the node corresponding to the sink of the network.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00349">max_flow.h:349</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a5b1cf7943417c669c41dc29547f8cd00"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a5b1cf7943417c669c41dc29547f8cd00">operations_research::GenericMaxFlow::CreateFlowModel</a></div><divclass="ttdeci">FlowModel CreateFlowModel()</div><divclass="ttdoc">Returns the protocol buffer representation of the current problem.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a20139b839cd5764939afc8df968a2484"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a20139b839cd5764939afc8df968a2484">operations_research::GenericMaxFlow::InitializePreflow</a></div><divclass="ttdeci">void InitializePreflow()</div><divclass="ttdoc">Initializes the preflow to a state that enables to run Refine.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a05eb488b184996513248b0dffca59600"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a05eb488b184996513248b0dffca59600">operations_research::GenericMaxFlow::PushFlowExcessBackToSource</a></div><divclass="ttdeci">void PushFlowExcessBackToSource()</div><divclass="ttdoc">Clears the flow excess at each node by pushing the flow back to the source:</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aef5b9fc304666691405861f4caf35f45"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aef5b9fc304666691405861f4caf35f45">operations_research::GenericMaxFlow::Flow</a></div><divclass="ttdeci">FlowQuantity Flow(ArcIndex arc) const</div><divclass="ttdoc">Returns the flow on arc using the equations given in the comment on residual_arc_capacity_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00365">max_flow.h:365</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a8a7acde49c4d55f2eb42e2b6869cdb3da18a3ff25435f10be68329d4b39de4700"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da18a3ff25435f10be68329d4b39de4700">operations_research::SimpleMaxFlow::POSSIBLE_OVERFLOW</a></div><divclass="ttdoc">There is a flow > std::numeric_limits<FlowQuantity>::max().</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00190">max_flow.h:190</a></div></div>
<divclass="ttc"id="classoperations__research_1_1PriorityQueueWithRestrictedPush_html_a0fa26c84168a6d71010556b0d6541a1f"><divclass="ttname"><ahref="classoperations__research_1_1PriorityQueueWithRestrictedPush.html#a0fa26c84168a6d71010556b0d6541a1f">operations_research::PriorityQueueWithRestrictedPush::IsEmpty</a></div><divclass="ttdeci">bool IsEmpty() const</div><divclass="ttdoc">Is the queue empty?</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00661">max_flow.h:661</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a64c1cc700d51eca9eac6bec6542d0bfb"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a64c1cc700d51eca9eac6bec6542d0bfb">operations_research::SimpleMaxFlow::AddArcWithCapacity</a></div><divclass="ttdeci">ArcIndex AddArcWithCapacity(NodeIndex tail, NodeIndex head, FlowQuantity capacity)</div><divclass="ttdoc">Adds a directed arc with the given capacity from tail to head.</div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_ae83c98d7dcf6a2d76a5d500273255fe6"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#ae83c98d7dcf6a2d76a5d500273255fe6">operations_research::SimpleMaxFlow::GetSourceSideMinCut</a></div><divclass="ttdeci">void GetSourceSideMinCut(std::vector< NodeIndex > *result)</div><divclass="ttdoc">Returns the nodes reachable from the source by non-saturated arcs (.i.e.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a75c3aeba25a7c62b4e237d2b34594b0e"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a75c3aeba25a7c62b4e237d2b34594b0e">operations_research::GenericMaxFlow::AugmentingPathExists</a></div><divclass="ttdeci">bool AugmentingPathExists() const</div><divclass="ttdoc">Returns true if there exists a path from the source to the sink with remaining capacity.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a022da70970a497438cd0304cf1c6efd9"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a022da70970a497438cd0304cf1c6efd9">operations_research::GenericMaxFlow::GetSourceSideMinCut</a></div><divclass="ttdeci">void GetSourceSideMinCut(std::vector< NodeIndex > *result)</div><divclass="ttdoc">Returns the nodes reachable from the source in the residual graph, the outgoing arcs of this set form...</div></div>
<divclass="ttc"id="classoperations__research_1_1PriorityQueueWithRestrictedPush_html_a2662f061f688af21e19f3ac53027ed4b"><divclass="ttname"><ahref="classoperations__research_1_1PriorityQueueWithRestrictedPush.html#a2662f061f688af21e19f3ac53027ed4b">operations_research::PriorityQueueWithRestrictedPush::Push</a></div><divclass="ttdeci">void Push(Element element, IntegerPriority priority)</div><divclass="ttdoc">Push a new element in the queue.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00673">max_flow.h:673</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a90f1c23703ab4e69d7e42549ea005464"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a90f1c23703ab4e69d7e42549ea005464">operations_research::GenericMaxFlow::GetOptimalFlow</a></div><divclass="ttdeci">FlowQuantity GetOptimalFlow() const</div><divclass="ttdoc">Returns the total flow found by the algorithm.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00361">max_flow.h:361</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a65afde65cda262fce8107f3a15d657c4"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a65afde65cda262fce8107f3a15d657c4">operations_research::GenericMaxFlow::node_potential_</a></div><divclass="ttdeci">NodeHeightArray node_potential_</div><divclass="ttdoc">An array representing the height function for each node in graph_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00563">max_flow.h:563</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a10899eb2ae1b242c4737e4c9e7ecdae5"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a10899eb2ae1b242c4737e4c9e7ecdae5">operations_research::SimpleMaxFlow::NumArcs</a></div><divclass="ttdeci">ArcIndex NumArcs() const</div><divclass="ttdoc">Returns the current number of arcs in the graph.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aa094beccfd146238de41da6f8a2b2e4a"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aa094beccfd146238de41da6f8a2b2e4a">operations_research::GenericMaxFlow::Capacity</a></div><divclass="ttdeci">FlowQuantity Capacity(ArcIndex arc) const</div><divclass="ttdoc">Returns the capacity of arc using the equations given in the comment on residual_arc_capacity_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00375">max_flow.h:375</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a5b535e0a581ca57102d6c495a10bc911"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a5b535e0a581ca57102d6c495a10bc911">operations_research::GenericMaxFlow::IsActive</a></div><divclass="ttdeci">bool IsActive(NodeIndex node) const</div><divclass="ttdoc">Returns true if node is active, i.e.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00437">max_flow.h:437</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a4c09a4799a59a5e2947b2da44c7d0ba3"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a4c09a4799a59a5e2947b2da44c7d0ba3">operations_research::GenericMaxFlow::residual_arc_capacity_</a></div><divclass="ttdeci">QuantityArray residual_arc_capacity_</div><divclass="ttdoc">An array representing the residual_capacity for each arc in graph_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00581">max_flow.h:581</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a4bfa3888f90a91610caa02c8498c6f67"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a4bfa3888f90a91610caa02c8498c6f67">operations_research::GenericMaxFlow::NodeHeight</a></div><divclass="ttdeci">NodeIndex NodeHeight</div><divclass="ttdoc">The height of a node never excess 2 times the number of node, so we use the same type as a Node index...</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00327">max_flow.h:327</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_aef35310ddd005652bb2b3db14c323ae9"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#aef35310ddd005652bb2b3db14c323ae9">operations_research::SimpleMaxFlow::Flow</a></div><divclass="ttdeci">FlowQuantity Flow(ArcIndex arc) const</div><divclass="ttdoc">Returns the flow on the given arc in the last OPTIMAL Solve() context.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a4cc032f9987eb1ae9eaa8ebb013f671b"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a4cc032f9987eb1ae9eaa8ebb013f671b">operations_research::GenericMaxFlow::PushActiveNode</a></div><divclass="ttdeci">void PushActiveNode(const NodeIndex &node)</div><divclass="ttdoc">Push element to the active node container.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00468">max_flow.h:468</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ad52713e66db4d174006e1c3cac7d9d09"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ad52713e66db4d174006e1c3cac7d9d09">operations_research::GenericMaxFlow::active_nodes_</a></div><divclass="ttdeci">std::vector< NodeIndex > active_nodes_</div><divclass="ttdoc">A stack used for managing active nodes in the algorithm.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00590">max_flow.h:590</a></div></div>
<divclass="ttc"id="classoperations__research_1_1PriorityQueueWithRestrictedPush_html_ad5d7012545c74d85dd938ea6bf9e9537"><divclass="ttname"><ahref="classoperations__research_1_1PriorityQueueWithRestrictedPush.html#ad5d7012545c74d85dd938ea6bf9e9537">operations_research::PriorityQueueWithRestrictedPush::Clear</a></div><divclass="ttdeci">void Clear()</div><divclass="ttdoc">Clears the queue.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00667">max_flow.h:667</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a27da86de84ba65849c8aebf7aa153f91"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a27da86de84ba65849c8aebf7aa153f91">operations_research::GenericMaxFlow::graph_</a></div><divclass="ttdeci">const Graph * graph_</div><divclass="ttdoc">A pointer to the graph passed as argument.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00547">max_flow.h:547</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a57cf9ba195eb368ccd5856ef7de4dcca"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a57cf9ba195eb368ccd5856ef7de4dcca">operations_research::GenericMaxFlow::DebugString</a></div><divclass="ttdeci">std::string DebugString(const std::string &context, ArcIndex arc) const</div><divclass="ttdoc">Returns context concatenated with information about arc in a human-friendly way.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aecd4716fa878055b30386f0f97a0d907"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aecd4716fa878055b30386f0f97a0d907">operations_research::GenericMaxFlow::IsAdmissible</a></div><divclass="ttdeci">bool IsAdmissible(ArcIndex arc) const</div><divclass="ttdoc">Returns true if arc is admissible.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00430">max_flow.h:430</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ade3632560edb912b1758628f327dfe3d"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ade3632560edb912b1758628f327dfe3d">operations_research::GenericMaxFlow::ComputeReachableNodes</a></div><divclass="ttdeci">void ComputeReachableNodes(NodeIndex start, std::vector< NodeIndex > *result)</div><divclass="ttdoc">Returns the set of nodes reachable from start in the residual graph or in the reverse residual graph ...</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a1c31c96effb1f91f800895be2339045b"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a1c31c96effb1f91f800895be2339045b">operations_research::GenericMaxFlow::PushFlow</a></div><divclass="ttdeci">void PushFlow(FlowQuantity flow, ArcIndex arc)</div><divclass="ttdoc">Pushes flow on arc, i.e.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ad7892ad5aa8338015f320267fb7f298f"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ad7892ad5aa8338015f320267fb7f298f">operations_research::GenericMaxFlow::GetSinkSideMinCut</a></div><divclass="ttdeci">void GetSinkSideMinCut(std::vector< NodeIndex > *result)</div><divclass="ttdoc">Returns the nodes that can reach the sink in the residual graph, the outgoing arcs of this set form a...</div></div>
<divclass="ttc"id="classoperations__research_1_1PriorityQueueWithRestrictedPush_html_a9597013d76010425ffc592a32ff4f259"><divclass="ttname"><ahref="classoperations__research_1_1PriorityQueueWithRestrictedPush.html#a9597013d76010425ffc592a32ff4f259">operations_research::PriorityQueueWithRestrictedPush::Pop</a></div><divclass="ttdeci">Element Pop()</div><divclass="ttdoc">Returns the element with highest priority and remove it from the queue.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00692">max_flow.h:692</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a1da59e63f4d617578a0dc218d7f2f3e9"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a1da59e63f4d617578a0dc218d7f2f3e9">operations_research::GenericMaxFlow::Solve</a></div><divclass="ttdeci">bool Solve()</div><divclass="ttdoc">Returns true if a maximum flow was solved.</div></div>
<divclass="ttc"id="classoperations__research_1_1MaxFlow_html"><divclass="ttname"><ahref="classoperations__research_1_1MaxFlow.html">operations_research::MaxFlow</a></div><divclass="ttdoc">Default instance MaxFlow that uses StarGraph.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00652">max_flow.h:652</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a323ba66c6b6e63c3c7165081614e2689"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a323ba66c6b6e63c3c7165081614e2689">operations_research::GenericMaxFlow::use_two_phase_algorithm_</a></div><divclass="ttdeci">bool use_two_phase_algorithm_</div><divclass="ttdoc">Whether or not we use a two-phase algorithm: 1/ Only deal with nodes that can reach the sink.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00621">max_flow.h:621</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a3aae9d11f361dfd5c98dcca64987cfb9"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a3aae9d11f361dfd5c98dcca64987cfb9">operations_research::GenericMaxFlow::stats_</a></div><divclass="ttdeci">StatsGroup stats_</div><divclass="ttdoc">Statistics about this class.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00641">max_flow.h:641</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ae78f6137700a6942cee3b8b5bd40817b"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ae78f6137700a6942cee3b8b5bd40817b">operations_research::GenericMaxFlow::GenericMaxFlow</a></div><divclass="ttdeci">GenericMaxFlow(const Graph *graph, NodeIndex source, NodeIndex sink)</div><divclass="ttdoc">Initialize a MaxFlow instance on the given graph.</div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a57296b653813abdd8d711048e87d1212"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a57296b653813abdd8d711048e87d1212">operations_research::SimpleMaxFlow::SetArcCapacity</a></div><divclass="ttdeci">void SetArcCapacity(ArcIndex arc, FlowQuantity capacity)</div><divclass="ttdoc">Change the capacity of an arc.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a0c56ff7a0c8bac88e8f6e0da3689e838"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a0c56ff7a0c8bac88e8f6e0da3689e838">operations_research::GenericMaxFlow::SetCapacityAndClearFlow</a></div><divclass="ttdeci">void SetCapacityAndClearFlow(ArcIndex arc, FlowQuantity capacity)</div><divclass="ttdoc">Sets the capacity of arc to 'capacity' and clears the flow on arc.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00442">max_flow.h:442</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html"><divclass="ttname"><ahref="namespaceoperations__research.html">operations_research</a></div><divclass="ttdoc">Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c...</div><divclass="ttdef"><b>Definition:</b><ahref="christofides_8h_source.html#l00033">christofides.h:33</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ab3915b57ac3d28863ad3372f1598a494"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ab3915b57ac3d28863ad3372f1598a494">operations_research::GenericMaxFlow::use_global_update_</a></div><divclass="ttdeci">bool use_global_update_</div><divclass="ttdoc">Whether or not to use GlobalUpdate().</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00614">max_flow.h:614</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a200b4dbff9102ee1232e05f569fc2427"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a200b4dbff9102ee1232e05f569fc2427">operations_research::SimpleMaxFlow::NumNodes</a></div><divclass="ttdeci">NodeIndex NumNodes() const</div><divclass="ttdoc">Returns the current number of nodes.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ad4a6ec3deadedd6c027b8c0fbbdac88d"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ad4a6ec3deadedd6c027b8c0fbbdac88d">operations_research::GenericMaxFlow::Head</a></div><divclass="ttdeci">NodeIndex Head(ArcIndex arc) const</div><divclass="ttdoc">Handy member functions to make the code more compact.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00532">max_flow.h:532</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a1055514c9f93a7ffeea0ae9e8a6a7f58"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a1055514c9f93a7ffeea0ae9e8a6a7f58">operations_research::GenericMaxFlow::SetUseGlobalUpdate</a></div><divclass="ttdeci">void SetUseGlobalUpdate(bool value)</div><divclass="ttdoc">Sets the different algorithm options.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00414">max_flow.h:414</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a3653a3df1b94e4150486b5149d8eaae7"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a3653a3df1b94e4150486b5149d8eaae7">operations_research::GenericMaxFlow::IsEmptyActiveNodeContainer</a></div><divclass="ttdeci">bool IsEmptyActiveNodeContainer()</div><divclass="ttdoc">Check the emptiness of the container.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00477">max_flow.h:477</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a05f2661c573eb445212f4eddd694fc2f"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a05f2661c573eb445212f4eddd694fc2f">operations_research::GenericMaxFlow::SetArcCapacity</a></div><divclass="ttdeci">void SetArcCapacity(ArcIndex arc, FlowQuantity new_capacity)</div><divclass="ttdoc">Sets the capacity for arc to new_capacity.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a4a6b55b37ed5a95debcd86aa40370e28"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a4a6b55b37ed5a95debcd86aa40370e28">operations_research::GenericMaxFlow::source_</a></div><divclass="ttdeci">NodeIndex source_</div><divclass="ttdoc">The index of the source node in graph_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00600">max_flow.h:600</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_ada0b88e232c739108184deb35dd54b3f"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#ada0b88e232c739108184deb35dd54b3f">operations_research::SimpleMaxFlow::SimpleMaxFlow</a></div><divclass="ttdeci">SimpleMaxFlow()</div><divclass="ttdoc">The constructor takes no size.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_aa44b5dfa3bad855a7a7b19750b6db748"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#aa44b5dfa3bad855a7a7b19750b6db748">operations_research::GenericMaxFlow::process_node_by_height_</a></div><divclass="ttdeci">bool process_node_by_height_</div><divclass="ttdoc">Whether or not we use the PriorityQueueWithRestrictedPush to process the active nodes rather than a s...</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00629">max_flow.h:629</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html_a0e629e35bfa311b31dd7f5065eb834bb"><divclass="ttname"><ahref="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">operations_research::NodeIndex</a></div><divclass="ttdeci">int32 NodeIndex</div><divclass="ttdoc">Standard instantiation of ForwardEbertGraph (named 'ForwardStarGraph') of EbertGraph (named 'StarGrap...</div><divclass="ttdef"><b>Definition:</b><ahref="ebert__graph_8h_source.html#l00192">ebert_graph.h:192</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a8a7acde49c4d55f2eb42e2b6869cdb3da11ce6c709e3b39a368358f2ee79942d6"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da11ce6c709e3b39a368358f2ee79942d6">operations_research::SimpleMaxFlow::BAD_RESULT</a></div><divclass="ttdoc">This should not happen. There was an error in our code (i.e. file a bug).</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00194">max_flow.h:194</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a5ceac4e6ee8eedd556f1cdec11a2b665"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a5ceac4e6ee8eedd556f1cdec11a2b665">operations_research::GenericMaxFlow::CheckResult</a></div><divclass="ttdeci">bool CheckResult() const</div><divclass="ttdoc">Checks whether the result is valid, i.e.</div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_a5421b464b61e322c676935f312501af8"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#a5421b464b61e322c676935f312501af8">operations_research::GenericMaxFlow::first_admissible_arc_</a></div><divclass="ttdeci">ArcIndexArray first_admissible_arc_</div><divclass="ttdoc">An array representing the first admissible arc for each node in graph_.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00584">max_flow.h:584</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ad411ee050c1c6a25b5b2abc42a2f0491"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ad411ee050c1c6a25b5b2abc42a2f0491">operations_research::GenericMaxFlow::GetAndRemoveFirstActiveNode</a></div><divclass="ttdeci">NodeIndex GetAndRemoveFirstActiveNode()</div><divclass="ttdoc">Get the first element from the active node container.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00460">max_flow.h:460</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SimpleMaxFlow_html_a8a7acde49c4d55f2eb42e2b6869cdb3da3b60465215ab4363dec64fd313771658"><divclass="ttname"><ahref="classoperations__research_1_1SimpleMaxFlow.html#a8a7acde49c4d55f2eb42e2b6869cdb3da3b60465215ab4363dec64fd313771658">operations_research::SimpleMaxFlow::OPTIMAL</a></div><divclass="ttdoc">Solve() was called and found an optimal solution.</div><divclass="ttdef"><b>Definition:</b><ahref="max__flow_8h_source.html#l00183">max_flow.h:183</a></div></div>
<divclass="ttc"id="classoperations__research_1_1GenericMaxFlow_html_ad3925f2137b18b1555563ed149ada740"><divclass="ttname"><ahref="classoperations__research_1_1GenericMaxFlow.html#ad3925f2137b18b1555563ed149ada740">operations_research::GenericMaxFlow::GlobalUpdate</a></div><divclass="ttdeci">void GlobalUpdate()</div><divclass="ttdoc">Computes the best possible node potential given the current flow using a reverse breadth-first search...</div></div>