<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00453">453</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<trclass="memdesc:aa5992cec63596c5d6c2ed51fc4f7c9c6"><tdclass="mdescLeft"> </td><tdclass="mdescRight"><aclass="el"href="classoperations__research_1_1HamiltonianPathSolver.html">HamiltonianPathSolver</a> computes a minimum Hamiltonian path starting at node 0 over a graph defined by a cost matrix. <ahref="#aa5992cec63596c5d6c2ed51fc4f7c9c6">More...</a><br/></td></tr>
<trclass="memdesc:a553d0693bed2f847684666077241647e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Replaces the cost matrix while avoiding re-allocating memory. <ahref="#a553d0693bed2f847684666077241647e">More...</a><br/></td></tr>
<trclass="memdesc:a6415d912bcce7f3d61e502d9c0047957"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the cost of the Hamiltonian path from 0 to end_node. <ahref="#a6415d912bcce7f3d61e502d9c0047957">More...</a><br/></td></tr>
<trclass="memitem:ac6c5e2c56d2c4c7cbf18d8d6cd26f1ff"><tdclass="memItemLeft"align="right"valign="top">std::vector< int > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classoperations__research_1_1HamiltonianPathSolver.html#ac6c5e2c56d2c4c7cbf18d8d6cd26f1ff">HamiltonianPath</a> (int end_node)</td></tr>
<trclass="memdesc:ac6c5e2c56d2c4c7cbf18d8d6cd26f1ff"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the shortest Hamiltonian path from 0 to end_node. <ahref="#ac6c5e2c56d2c4c7cbf18d8d6cd26f1ff">More...</a><br/></td></tr>
<trclass="memdesc:a6d4e7053b1ca9bb72ca86712ba83ed56"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the end-node that yields the shortest Hamiltonian path of all shortest Hamiltonian path from 0 to end-node (end-node != 0). <ahref="#a6d4e7053b1ca9bb72ca86712ba83ed56">More...</a><br/></td></tr>
<trclass="memdesc:a488b92cff7785ca75270e3480f6b3ac2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the cost of the TSP tour. <ahref="#a488b92cff7785ca75270e3480f6b3ac2">More...</a><br/></td></tr>
<trclass="memitem:ae52acd5c3aa779486356b63d3c264f8b"><tdclass="memItemLeft"align="right"valign="top">std::vector< int > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classoperations__research_1_1HamiltonianPathSolver.html#ae52acd5c3aa779486356b63d3c264f8b">TravelingSalesmanPath</a> ()</td></tr>
<trclass="memdesc:ae52acd5c3aa779486356b63d3c264f8b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the TSP tour in the vector pointed to by the argument. <ahref="#ae52acd5c3aa779486356b63d3c264f8b">More...</a><br/></td></tr>
<trclass="memdesc:a2278e850be8943c1bf2ec68e5a81d5ed"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns true if there won't be precision issues. <ahref="#a2278e850be8943c1bf2ec68e5a81d5ed">More...</a><br/></td></tr>
<trclass="memdesc:af71c1510258301efccfc6e948ea06a82"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns true if the cost matrix verifies the triangle inequality. <ahref="#af71c1510258301efccfc6e948ea06a82">More...</a><br/></td></tr>
<p><aclass="el"href="classoperations__research_1_1HamiltonianPathSolver.html">HamiltonianPathSolver</a> computes a minimum Hamiltonian path starting at node 0 over a graph defined by a cost matrix. </p>
<p>The cost function need not be symmetric. When the Hamiltonian path is closed, it's a Hamiltonian cycle, i.e. the algorithm solves the Traveling Salesman Problem. Example: std::vector<std::vector<int>> cost_mat; ... fill in cost matrix <aclass="el"href="classoperations__research_1_1HamiltonianPathSolver.html">HamiltonianPathSolver</a><int, std::vector<std::vector<int>>> mhp(cost_mat); ///< no computation done printf("%d\n", mhp.TravelingSalesmanCost()); ///< computation done and stored In 2010, 26 was the maximum solvable with 24 Gigs of RAM, and it took several minutes. With this 2014 version of the code, one may go a little higher, but considering the complexity of the algorithm (n*2^n), and that there are very good ways to solve TSP with more than 32 cities, we limit ourselves to 32 cites. This is why we define the type NodeSet to be 32-bit wide. </p><dlclass="todo"><dt><b><aclass="el"href="todo.html#_todo000033">Todo:</a></b></dt><dd>(user): remove this limitation by using pruning techniques. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00475">475</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00476">476</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
</div>
</div>
<h2class="groupheader">Constructor & Destructor Documentation</h2>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00606">606</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00611">611</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Returns the end-node that yields the shortest Hamiltonian path of all shortest Hamiltonian path from 0 to end-node (end-node != 0). </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00830">830</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<p>Replaces the cost matrix while avoiding re-allocating memory. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00627">627</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00633">633</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<p>Returns the cost of the Hamiltonian path from 0 to end_node. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00836">836</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<p>Returns the shortest Hamiltonian path from 0 to end_node. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00843">843</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<p>Stores HamiltonianPath(BestHamiltonianPathEndNode()) into *path. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00850">850</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<p>Returns true if there won't be precision issues. </p>
<p>This is always true for integers, but not for floating-point types. </p>
<p>We compute the min and max for the cost matrix.</p>
<p>We determine if the range of the cost matrix is going to make the algorithm not robust because of precision issues. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00784">784</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00857">857</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<tdclass="memname">std::vector< int ><aclass="el"href="classoperations__research_1_1HamiltonianPathSolver.html">operations_research::HamiltonianPathSolver</a>< CostType, CostFunction >::TravelingSalesmanPath </td>
<td>(</td>
<tdclass="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><divclass="memdoc">
<p>Returns the TSP tour in the vector pointed to by the argument. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00864">864</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00870">870</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
<p>Returns true if the cost matrix verifies the triangle inequality. </p>
<pclass="definition">Definition at line <aclass="el"href="hamiltonian__path_8h_source.html#l00809">809</a> of file <aclass="el"href="hamiltonian__path_8h_source.html">hamiltonian_path.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>