<ahref="christofides_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">// ChristofidesPathSolver computes an approximate solution to the Traveling</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment">// Salesman Problen using the Christofides algorithm (c.f.</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment">// https://en.wikipedia.org/wiki/Christofides_algorithm).</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">// Note that the algorithm guarantees finding a solution within 3/2 of the</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment">// optimum. Its complexity is O(n^2 * log(n)) where n is the number of nodes.</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> </div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="preprocessor">#ifndef OR_TOOLS_GRAPH_CHRISTOFIDES_H_</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="preprocessor">#define OR_TOOLS_GRAPH_CHRISTOFIDES_H_</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> </div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="preprocessor">#include "absl/container/flat_hash_map.h"</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="preprocessor">#include "ortools/base/integral_types.h"</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="preprocessor">#include "ortools/base/logging.h"</span></div><divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <s
<divclass="ttc"id="one__tree__lower__bound_8h_html_af86d4c4e6a18908cda194651a9ab7beb"><divclass="ttname"><ahref="one__tree__lower__bound_8h.html#af86d4c4e6a18908cda194651a9ab7beb">degrees</a></div><divclass="ttdeci">trees with all degrees equal w the current value of degrees</div><divclass="ttdef"><b>Definition:</b><ahref="one__tree__lower__bound_8h_source.html#l00034">one_tree_lower_bound.h:34</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html_a3175c0c8e9fc36a30b70b6b9c132474a"><divclass="ttname"><ahref="namespaceoperations__research.html#a3175c0c8e9fc36a30b70b6b9c132474a">operations_research::ComputeMinimumWeightMatchingWithMIP</a></div><divclass="ttdeci">std::vector< typename GraphType::ArcIndex > ComputeMinimumWeightMatchingWithMIP(const GraphType &graph, const WeightFunctionType &weight)</div><divclass="ttdoc">Computes a minimum weight perfect matching on an undirected graph using a Mixed Integer Programming m...</div><divclass="ttdef"><b>Definition:</b><ahref="christofides_8h_source.html#l00107">christofides.h:107</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html_aa63055860fc53f8eed56d23d2571c180"><divclass="ttname"><ahref="namespaceoperations__research.html#aa63055860fc53f8eed56d23d2571c180">operations_research::BuildEulerianTourFromNode</a></div><divclass="ttdeci">std::vector< NodeIndex > BuildEulerianTourFromNode(const Graph &graph, NodeIndex root)</div><divclass="ttdoc">Builds an Eulerian tour/circuit/cycle starting and ending at node root on an undirected graph.</div><divclass="ttdef"><b>Definition:</b><ahref="eulerian__path_8h_source.html#l00116">eulerian_path.h:116</a></div></div>
<divclass="ttc"id="classoperations__research_1_1ChristofidesPathSolver_html_a76c636e1d48da64087686dd06bc45519"><divclass="ttname"><ahref="classoperations__research_1_1ChristofidesPathSolver.html#a76c636e1d48da64087686dd06bc45519">operations_research::ChristofidesPathSolver::SetMatchingAlgorithm</a></div><divclass="ttdeci">void SetMatchingAlgorithm(MatchingAlgorithm matching)</div><divclass="ttdoc">Sets the matching algorith to use.</div><divclass="ttdef"><b>Definition:</b><ahref="christofides_8h_source.html#l00058">christofides.h:58</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_1ChristofidesPathSolver_html_a8db7cbf56d8882ecefcb1f88ff20c755"><divclass="ttname"><ahref="classoperations__research_1_1ChristofidesPathSolver.html#a8db7cbf56d8882ecefcb1f88ff20c755">operations_research::ChristofidesPathSolver::TravelingSalesmanPath</a></div><divclass="ttdeci">std::vector< NodeIndex > TravelingSalesmanPath()</div><divclass="ttdoc">Returns the approximate TSP tour.</div><divclass="ttdef"><b>Definition:</b><ahref="christofides_8h_source.html#l00197">christofides.h:197</a></div></div>
<divclass="ttc"id="classoperations__research_1_1ChristofidesPathSolver_html_ada30f267a0dea4a4f25fcce1a6158438"><divclass="ttname"><ahref="classoperations__research_1_1ChristofidesPathSolver.html#ada30f267a0dea4a4f25fcce1a6158438">operations_research::ChristofidesPathSolver::TravelingSalesmanCost</a></div><divclass="ttdeci">CostType TravelingSalesmanCost()</div><divclass="ttdoc">Returns the cost of the approximate TSP tour.</div><divclass="ttdef"><b>Definition:</b><ahref="christofides_8h_source.html#l00187">christofides.h:187</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="namespaceoperations__research_html_ab1cf773de0cae72d0c44efe5b8f4bb89"><divclass="ttname"><ahref="namespaceoperations__research.html#ab1cf773de0cae72d0c44efe5b8f4bb89">operations_research::IsEulerianGraph</a></div><divclass="ttdeci">bool IsEulerianGraph(const Graph &graph)</div><divclass="ttdoc">Returns true if a graph is Eulerian, aka all its nodes are of even degree.</div><divclass="ttdef"><b>Definition:</b><ahref="eulerian__path_8h_source.html#l00040">eulerian_path.h:40</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html_a33a2f4c26fd60cd0fa98257b571c974f"><divclass="ttname"><ahref="namespaceoperations__research.html#a33a2f4c26fd60cd0fa98257b571c974f">operations_research::BuildPrimMinimumSpanningTree</a></div><divclass="ttdeci">std::vector< typename Graph::ArcIndex > BuildPrimMinimumSpanningTree(const Graph &graph, const ArcValue &arc_value)</div><divclass="ttdoc">Implementation of Prim's mininumum spanning tree algorithm (c.f.</div><divclass="ttdef"><b>Definition:</b><ahref="minimum__spanning__tree_8h_source.html#l00117">minimum_spanning_tree.h:117</a></div></div>