235 lines
15 KiB
HTML
235 lines
15 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_1ChristofidesPathSolver.html">ChristofidesPathSolver</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_1ChristofidesPathSolver-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction > Class Template Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <<a class="el" href="christofides_8h_source.html">christofides.h</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:ad44822002f75a6f478a62e107d880018"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ad44822002f75a6f478a62e107d880018">MatchingAlgorithm</a> { <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ad44822002f75a6f478a62e107d880018a99c5fe202c37dcd8ed9cc60926a4f525">MatchingAlgorithm::MINIMAL_WEIGHT_MATCHING</a>
|
|
}</td></tr>
|
|
<tr class="separator:ad44822002f75a6f478a62e107d880018"><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:a4c46f50f1d26cb5d1945fee66db56029"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#a4c46f50f1d26cb5d1945fee66db56029">ChristofidesPathSolver</a> (<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> num_nodes, CostFunction costs)</td></tr>
|
|
<tr class="separator:a4c46f50f1d26cb5d1945fee66db56029"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a76c636e1d48da64087686dd06bc45519"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#a76c636e1d48da64087686dd06bc45519">SetMatchingAlgorithm</a> (<a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ad44822002f75a6f478a62e107d880018">MatchingAlgorithm</a> matching)</td></tr>
|
|
<tr class="memdesc:a76c636e1d48da64087686dd06bc45519"><td class="mdescLeft"> </td><td class="mdescRight">Sets the matching algorith to use. <a href="#a76c636e1d48da64087686dd06bc45519">More...</a><br /></td></tr>
|
|
<tr class="separator:a76c636e1d48da64087686dd06bc45519"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ada30f267a0dea4a4f25fcce1a6158438"><td class="memItemLeft" align="right" valign="top">CostType </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ada30f267a0dea4a4f25fcce1a6158438">TravelingSalesmanCost</a> ()</td></tr>
|
|
<tr class="memdesc:ada30f267a0dea4a4f25fcce1a6158438"><td class="mdescLeft"> </td><td class="mdescRight">Returns the cost of the approximate TSP tour. <a href="#ada30f267a0dea4a4f25fcce1a6158438">More...</a><br /></td></tr>
|
|
<tr class="separator:ada30f267a0dea4a4f25fcce1a6158438"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8db7cbf56d8882ecefcb1f88ff20c755"><td class="memItemLeft" align="right" valign="top">std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#a8db7cbf56d8882ecefcb1f88ff20c755">TravelingSalesmanPath</a> ()</td></tr>
|
|
<tr class="memdesc:a8db7cbf56d8882ecefcb1f88ff20c755"><td class="mdescLeft"> </td><td class="mdescRight">Returns the approximate TSP tour. <a href="#a8db7cbf56d8882ecefcb1f88ff20c755">More...</a><br /></td></tr>
|
|
<tr class="separator:a8db7cbf56d8882ecefcb1f88ff20c755"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><h3>template<typename CostType, typename ArcIndex = int64, typename NodeIndex = int32, typename CostFunction = std::function<CostType(NodeIndex, NodeIndex)>><br />
|
|
class operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction ></h3>
|
|
|
|
|
|
<p class="definition">Definition at line <a class="el" href="christofides_8h_source.html#l00040">40</a> of file <a class="el" href="christofides_8h_source.html">christofides.h</a>.</p>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="ad44822002f75a6f478a62e107d880018"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad44822002f75a6f478a62e107d880018">◆ </a></span>MatchingAlgorithm</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename CostType , typename ArcIndex = int64, typename NodeIndex = int32, typename CostFunction = std::function<CostType(NodeIndex, NodeIndex)>> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ad44822002f75a6f478a62e107d880018">operations_research::ChristofidesPathSolver::MatchingAlgorithm</a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">strong</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="ad44822002f75a6f478a62e107d880018a99c5fe202c37dcd8ed9cc60926a4f525"></a>MINIMAL_WEIGHT_MATCHING </td><td class="fielddoc"></td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="christofides_8h_source.html#l00042">42</a> of file <a class="el" href="christofides_8h_source.html">christofides.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a4c46f50f1d26cb5d1945fee66db56029"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4c46f50f1d26cb5d1945fee66db56029">◆ </a></span>ChristofidesPathSolver()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename CostType , typename ArcIndex , typename NodeIndex , typename CostFunction > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>< CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction >::<a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">ChristofidesPathSolver</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>num_nodes</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">CostFunction </td>
|
|
<td class="paramname"><em>costs</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="christofides_8h_source.html#l00177">177</a> of file <a class="el" href="christofides_8h_source.html">christofides.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a76c636e1d48da64087686dd06bc45519"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a76c636e1d48da64087686dd06bc45519">◆ </a></span>SetMatchingAlgorithm()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename CostType , typename ArcIndex = int64, typename NodeIndex = int32, typename CostFunction = std::function<CostType(NodeIndex, NodeIndex)>> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>< CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction >::SetMatchingAlgorithm </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ad44822002f75a6f478a62e107d880018">MatchingAlgorithm</a> </td>
|
|
<td class="paramname"><em>matching</em></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>Sets the matching algorith to use. </p>
|
|
<p>A minimum weight perfect matching (MINIMUM_WEIGHT_MATCHING) guarantees the 3/2 upper bound to the optimal solution. A minimal weight perfect matching (MINIMAL_WEIGHT_MATCHING) finds a locally minimal weight matching which does not offer any bound guarantee but, as of 1/2017, is orders of magnitude faster than the minimum matching. By default, MINIMAL_WEIGHT_MATCHING is selected. </p><dl class="todo"><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>(user): Change the default when minimum matching gets faster. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="christofides_8h_source.html#l00058">58</a> of file <a class="el" href="christofides_8h_source.html">christofides.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ada30f267a0dea4a4f25fcce1a6158438"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ada30f267a0dea4a4f25fcce1a6158438">◆ </a></span>TravelingSalesmanCost()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename CostType , typename ArcIndex , typename NodeIndex , typename CostFunction > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">CostType <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>< CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction >::TravelingSalesmanCost </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the cost of the approximate TSP tour. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="christofides_8h_source.html#l00187">187</a> of file <a class="el" href="christofides_8h_source.html">christofides.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8db7cbf56d8882ecefcb1f88ff20c755"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8db7cbf56d8882ecefcb1f88ff20c755">◆ </a></span>TravelingSalesmanPath()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename CostType , typename ArcIndex , typename NodeIndex , typename CostFunction > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>< CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction >::TravelingSalesmanPath </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the approximate TSP tour. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="christofides_8h_source.html#l00197">197</a> of file <a class="el" href="christofides_8h_source.html">christofides.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="christofides_8h_source.html">christofides.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|