Files
ortools-clone/docs/cpp_graph/classoperations__research_1_1ChristofidesPathSolver.html
Laurent Perron 6230c8e7a4 polish cpp doc
2019-07-12 13:25:23 -07:00

239 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&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classoperations__research_1_1ChristofidesPathSolver.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classoperations__research_1_1ChristofidesPathSolver-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">operations_research::ChristofidesPathSolver&lt; CostType, ArcIndex, NodeIndex, CostFunction &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename CostType, typename ArcIndex = int64, typename NodeIndex = int32, typename CostFunction = std::function&lt;CostType(NodeIndex, NodeIndex)&gt;&gt;<br />
class operations_research::ChristofidesPathSolver&lt; CostType, ArcIndex, NodeIndex, CostFunction &gt;</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><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 &#160;</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#ad44822002f75a6f478a62e107d880018ab66d0823917c9351a4cb68dff77f445a">MatchingAlgorithm::MINIMUM_WEIGHT_MATCHING</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a76c636e1d48da64087686dd06bc45519"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ada30f267a0dea4a4f25fcce1a6158438"><td class="memItemLeft" align="right" valign="top">CostType&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a8db7cbf56d8882ecefcb1f88ff20c755"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> &gt;&#160;</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">&#160;</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">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="ad44822002f75a6f478a62e107d880018"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad44822002f75a6f478a62e107d880018">&#9670;&nbsp;</a></span>MatchingAlgorithm</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CostType , typename ArcIndex = int64, typename NodeIndex = int32, typename CostFunction = std::function&lt;CostType(NodeIndex, NodeIndex)&gt;&gt; </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="ad44822002f75a6f478a62e107d880018ab66d0823917c9351a4cb68dff77f445a"></a>MINIMUM_WEIGHT_MATCHING&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="ad44822002f75a6f478a62e107d880018a99c5fe202c37dcd8ed9cc60926a4f525"></a>MINIMAL_WEIGHT_MATCHING&#160;</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 &amp; Destructor Documentation</h2>
<a id="a4c46f50f1d26cb5d1945fee66db56029"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c46f50f1d26cb5d1945fee66db56029">&#9670;&nbsp;</a></span>ChristofidesPathSolver()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CostType , typename ArcIndex , typename NodeIndex , typename CostFunction &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>&lt; CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction &gt;::<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>&#160;</td>
<td class="paramname"><em>num_nodes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">CostFunction&#160;</td>
<td class="paramname"><em>costs</em>&#160;</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">&#9670;&nbsp;</a></span>SetMatchingAlgorithm()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CostType , typename ArcIndex = int64, typename NodeIndex = int32, typename CostFunction = std::function&lt;CostType(NodeIndex, NodeIndex)&gt;&gt; </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>&lt; CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction &gt;::SetMatchingAlgorithm </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html#ad44822002f75a6f478a62e107d880018">MatchingAlgorithm</a>&#160;</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#_todo000004">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">&#9670;&nbsp;</a></span>TravelingSalesmanCost()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CostType , typename ArcIndex , typename NodeIndex , typename CostFunction &gt; </div>
<table class="memname">
<tr>
<td class="memname">CostType <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>&lt; CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction &gt;::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">&#9670;&nbsp;</a></span>TravelingSalesmanPath()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CostType , typename ArcIndex , typename NodeIndex , typename CostFunction &gt; </div>
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> &gt; <a class="el" href="classoperations__research_1_1ChristofidesPathSolver.html">operations_research::ChristofidesPathSolver</a>&lt; CostType, <a class="el" href="namespaceoperations__research.html#a31d858394c5eed1fa21edc3da47047c1">ArcIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, CostFunction &gt;::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><!-- doc-content -->
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
</html>