<ahref="linear__assignment_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">//</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment">// An implementation of a cost-scaling push-relabel algorithm for the</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment">// assignment problem (minimum-cost perfect bipartite matching), from</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">// the paper of Goldberg and Kennedy (1995).</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment">// This implementation finds the minimum-cost perfect assignment in</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment">// the given graph with integral edge weights set through the</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment">// SetArcCost method.</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">// The running time is O(n*m*log(nC)) where n is the number of nodes,</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment">// m is the number of edges, and C is the largest magnitude of an edge cost.</span></div><divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="comment">// In principle it
<divclass="ttc"id="classoperations__research_1_1ArcIndexOrderingByTailNode_html"><divclass="ttname"><ahref="classoperations__research_1_1ArcIndexOrderingByTailNode.html">operations_research::ArcIndexOrderingByTailNode</a></div><divclass="ttdoc">Logically this class should be defined inside OptimizeGraphLayout, but compilation fails if we do tha...</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01057">linear_assignment.h:1057</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_ab369ec930d05edbccaef63529b852ffc"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#ab369ec930d05edbccaef63529b852ffc">operations_research::LinearSumAssignment::GetMate</a></div><divclass="ttdeci">NodeIndex GetMate(NodeIndex left_node) const</div><divclass="ttdoc">Returns the node to which the given node is matched.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00350">linear_assignment.h:350</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_acad00acac7169537c5fa2a2c52ff9d02"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#acad00acac7169537c5fa2a2c52ff9d02">operations_research::LinearSumAssignment::ArcCost</a></div><divclass="ttdeci">CostValue ArcCost(ArcIndex arc) const</div><divclass="ttdoc">Returns the original arc cost for use by a client that's iterating over the optimum assignment.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00291">linear_assignment.h:291</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a43439fdb497f05396053b387ea880ebc"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a43439fdb497f05396053b387ea880ebc">operations_research::LinearSumAssignment::FinalizeSetup</a></div><divclass="ttdeci">bool FinalizeSetup()</div><divclass="ttdoc">Completes initialization after the problem is fully specified.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01388">linear_assignment.h:1388</a></div></div>
<divclass="ttc"id="classoperations__research_1_1ArcIndexOrderingByTailNode_html_a469f26e2984e4bb6058323ff48609f08"><divclass="ttname"><ahref="classoperations__research_1_1ArcIndexOrderingByTailNode.html#a469f26e2984e4bb6058323ff48609f08">operations_research::ArcIndexOrderingByTailNode::operator()</a></div><divclass="ttdeci">bool operator()(typename GraphType::ArcIndex a, typename GraphType::ArcIndex b) const</div><divclass="ttdoc">Says ArcIndex a is less than ArcIndex b if arc a's tail is less than arc b's tail.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01064">linear_assignment.h:1064</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_ab0da9fe270ac009766835e156e88691d"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#ab0da9fe270ac009766835e156e88691d">operations_research::LinearSumAssignment::SetCostScalingDivisor</a></div><divclass="ttdeci">void SetCostScalingDivisor(CostValue factor)</div><divclass="ttdoc">Sets the cost-scaling divisor, i.e., the amount by which we divide the scaling parameter on each iter...</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00254">linear_assignment.h:254</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a5b4c65750d20e6a8139f56d9ec0b8110"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a5b4c65750d20e6a8139f56d9ec0b8110">operations_research::LinearSumAssignment::GetCost</a></div><divclass="ttdeci">CostValue GetCost() const</div><divclass="ttdoc">Returns the cost of the minimum-cost perfect matching.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01473">linear_assignment.h:1473</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_aba97b69de699d2b370cf10430f6ea49e"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#aba97b69de699d2b370cf10430f6ea49e">operations_research::LinearSumAssignment::GetAssignmentCost</a></div><divclass="ttdeci">CostValue GetAssignmentCost(NodeIndex node) const</div><divclass="ttdoc">Returns the cost of the assignment arc incident to the given node.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00345">linear_assignment.h:345</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a0bde059a6043623c8a208dbedb44185d"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a0bde059a6043623c8a208dbedb44185d">operations_research::LinearSumAssignment::NumLeftNodes</a></div><divclass="ttdeci">NodeIndex NumLeftNodes() const</div><divclass="ttdoc">Returns the number of nodes on the left side of the given problem.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00335">linear_assignment.h:335</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a0ab1092db058f93c6baf0d4ea44f15a8"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a0ab1092db058f93c6baf0d4ea44f15a8">operations_research::LinearSumAssignment::Head</a></div><divclass="ttdeci">NodeIndex Head(ArcIndex arc) const</div><divclass="ttdoc">These handy member functions make the code more compact, and we expose them to clients so that client...</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00287">linear_assignment.h:287</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_ac2682c67a5799b2f76105159621a971a"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#ac2682c67a5799b2f76105159621a971a">operations_research::LinearSumAssignment::GetAssignmentArc</a></div><divclass="ttdeci">ArcIndex GetAssignmentArc(NodeIndex left_node) const</div><divclass="ttdoc">Returns the arc through which the given node is matched.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00338">linear_assignment.h:338</a></div></div>
<divclass="ttc"id="namespaceutil_html_aadd7603ae6e78cc2490ca9710fbaf180"><divclass="ttname"><ahref="namespaceutil.html#aadd7603ae6e78cc2490ca9710fbaf180">util::false</a></div><divclass="ttdeci">false</div><divclass="ttdoc">This is useful for wrapping iterators of a class that support many different iterations.</div><divclass="ttdef"><b>Definition:</b><ahref="iterators_8h_source.html#l00030">iterators.h:30</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a16dcc92e05be8b51c348b1b3f0aac5fc"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a16dcc92e05be8b51c348b1b3f0aac5fc">operations_research::LinearSumAssignment::NumNodes</a></div><divclass="ttdeci">NodeIndex NumNodes() const</div><divclass="ttdoc">Returns the total number of nodes in the given problem.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00323">linear_assignment.h:323</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a1eae4227ff347a3d9b66cc705118f092"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a1eae4227ff347a3d9b66cc705118f092">operations_research::LinearSumAssignment::LinearSumAssignment</a></div><divclass="ttdeci">LinearSumAssignment(const GraphType &graph, NodeIndex num_left_nodes)</div><divclass="ttdoc">Constructor for the case in which we will build the graph incrementally as we discover arc costs,...</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00963">linear_assignment.h:963</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a15cfa33783e509c9ab447858abf6cdab"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a15cfa33783e509c9ab447858abf6cdab">operations_research::LinearSumAssignment::OptimizeGraphLayout</a></div><divclass="ttdeci">void OptimizeGraphLayout(GraphType *graph)</div><divclass="ttdoc">Optimizes the layout of the graph for the access pattern our implementation will use.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01088">linear_assignment.h:1088</a></div></div>
<divclass="ttc"id="linear__assignment_8h_html_aeb1d0880abde13d03b5dc361d19d8cf3"><divclass="ttname"><ahref="linear__assignment_8h.html#aeb1d0880abde13d03b5dc361d19d8cf3">DECLARE_int64</a></div><divclass="ttdeci">DECLARE_int64(assignment_alpha)</div><divclass="ttdoc">Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c...</div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_ae3b69f5e71ec0fd7d7afa3b8f4362c60"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#ae3b69f5e71ec0fd7d7afa3b8f4362c60">operations_research::LinearSumAssignment::Graph</a></div><divclass="ttdeci">const GraphType & Graph() const</div><divclass="ttdoc">Allows tests, iterators, etc., to inspect our underlying graph.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00281">linear_assignment.h:281</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a505cde11a037301682460196f8c6b93b"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a505cde11a037301682460196f8c6b93b">operations_research::LinearSumAssignment::SetGraph</a></div><divclass="ttdeci">void SetGraph(const GraphType *graph)</div><divclass="ttdoc">Sets the graph used by the LinearSumAssignment instance, for use when the graph layout can be determi...</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00247">linear_assignment.h:247</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_1LinearSumAssignment_html_af6bc9d1acdf2224915aa2441e11e0012"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#af6bc9d1acdf2224915aa2441e11e0012">operations_research::LinearSumAssignment::ArcAnnotationCycleHandler</a></div><divclass="ttdeci">operations_research::PermutationCycleHandler< typename GraphType::ArcIndex > * ArcAnnotationCycleHandler()</div><divclass="ttdoc">Returns a permutation cycle handler that can be passed to the TransformToForwardStaticGraph method so...</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01082">linear_assignment.h:1082</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html_a5784b0e0c525622091351e1ee4d4e73d"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html#a5784b0e0c525622091351e1ee4d4e73d">operations_research::LinearSumAssignment::ComputeAssignment</a></div><divclass="ttdeci">bool ComputeAssignment()</div><divclass="ttdoc">Computes the optimum assignment.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l01448">linear_assignment.h:1448</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LinearSumAssignment_html"><divclass="ttname"><ahref="classoperations__research_1_1LinearSumAssignment.html">operations_research::LinearSumAssignment</a></div><divclass="ttdoc">This class does not take ownership of its underlying graph.</div><divclass="ttdef"><b>Definition:</b><ahref="linear__assignment_8h_source.html#l00226">linear_assignment.h:226</a></div></div>