<ahref="hamiltonian__path_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="preprocessor">#ifndef OR_TOOLS_GRAPH_HAMILTONIAN_PATH_H_</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="preprocessor">#define OR_TOOLS_GRAPH_HAMILTONIAN_PATH_H_</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> </div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">// Solves the Shortest Hamiltonian Path Problem using a complete algorithm.</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment">// The algorithm was first described in</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment">// M. Held, R.M. Karp, A dynamic programming approach to sequencing problems,</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment">// J. SIAM 10 (1962) 196-210</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment">// The Shortest Hamiltonian Path Problem (SHPP) is similar to the Traveling</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment">// Salesperson Problem (TSP).</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment">// You have to visit all the cities, starting from a given one and you</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment">// do not need to return to your starting point. With the TSP, you can start</span></div><divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</
<divclass="ttc"id="classoperations__research_1_1HamiltonianPathSolver_html_a8acc60c87190fac89379315aa08ce7a5"><divclass="ttname"><ahref="classoperations__research_1_1HamiltonianPathSolver.html#a8acc60c87190fac89379315aa08ce7a5">operations_research::HamiltonianPathSolver::HamiltonianPath</a></div><divclass="ttdeci">std::vector< int > HamiltonianPath(int end_node)</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00843">hamiltonian_path.h:843</a></div></div>
<divclass="ttc"id="classoperations__research_1_1HamiltonianPathSolver_html_a326a998ed18bedda49bd2cab5cbd4079"><divclass="ttname"><ahref="classoperations__research_1_1HamiltonianPathSolver.html#a326a998ed18bedda49bd2cab5cbd4079">operations_research::HamiltonianPathSolver::TravelingSalesmanPath</a></div><divclass="ttdeci">std::vector< int > TravelingSalesmanPath()</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00864">hamiltonian_path.h:864</a></div></div>
<divclass="ttc"id="classoperations__research_1_1Set_html_abbfaa99a45c4a90475cb2f5138f9a162"><divclass="ttname"><ahref="classoperations__research_1_1Set.html#abbfaa99a45c4a90475cb2f5138f9a162">operations_research::Set::Singleton</a></div><divclass="ttdeci">static Set Singleton(Integer n)</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00151">hamiltonian_path.h:151</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LatticeMemoryManager_html_a63013a8b3122900ec1a3c2557b044977"><divclass="ttname"><ahref="classoperations__research_1_1LatticeMemoryManager.html#a63013a8b3122900ec1a3c2557b044977">operations_research::LatticeMemoryManager::Offset</a></div><divclass="ttdeci">uint64 Offset(Set s, int node) const</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00431">hamiltonian_path.h:431</a></div></div>
<divclass="ttc"id="classoperations__research_1_1Set_html_a3382ddf3a1f05b9ded21ddb7b0013f78"><divclass="ttname"><ahref="classoperations__research_1_1Set.html#a3382ddf3a1f05b9ded21ddb7b0013f78">operations_research::Set::operator!=</a></div><divclass="ttdeci">bool operator!=(const Set &other) const</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00202">hamiltonian_path.h:202</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SetRangeIterator_html_ab199aaba95428b8647f6bfdd83ecb68c"><divclass="ttname"><ahref="classoperations__research_1_1SetRangeIterator.html#ab199aaba95428b8647f6bfdd83ecb68c">operations_research::SetRangeIterator::operator++</a></div><divclass="ttdeci">const SetRangeIterator & operator++()</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00240">hamiltonian_path.h:240</a></div></div>
<divclass="ttc"id="classoperations__research_1_1ElementIterator_html_a6eb44ef439441ada8ffaaf6ee33a9c40"><divclass="ttname"><ahref="classoperations__research_1_1ElementIterator.html#a6eb44ef439441ada8ffaaf6ee33a9c40">operations_research::ElementIterator::operator++</a></div><divclass="ttdeci">const ElementIterator & operator++()</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00115">hamiltonian_path.h:115</a></div></div>
<divclass="ttc"id="classoperations__research_1_1LatticeMemoryManager_html_acb6e0aff2eba8a7f537cd62595fbab01"><divclass="ttname"><ahref="classoperations__research_1_1LatticeMemoryManager.html#acb6e0aff2eba8a7f537cd62595fbab01">operations_research::LatticeMemoryManager::OffsetDelta</a></div><divclass="ttdeci">uint64 OffsetDelta(int card, int added_node, int removed_node, int rank) const</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00310">hamiltonian_path.h:310</a></div></div>
<divclass="ttc"id="classoperations__research_1_1Set_html_a062c0acf17a051b885ad211acad31079"><divclass="ttname"><ahref="classoperations__research_1_1Set.html#a062c0acf17a051b885ad211acad31079">operations_research::Set::MaxCardinality</a></div><divclass="ttdeci">static const int MaxCardinality</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00135">hamiltonian_path.h:135</a></div></div>
<divclass="ttc"id="classoperations__research_1_1Set_html_a191fa6bb5261ddd97d311ccc1d90fe7c"><divclass="ttname"><ahref="classoperations__research_1_1Set.html#a191fa6bb5261ddd97d311ccc1d90fe7c">operations_research::Set::begin</a></div><divclass="ttdeci">ElementIterator< Set > begin() const</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00198">hamiltonian_path.h:198</a></div></div>
<divclass="ttc"id="classoperations__research_1_1SetRangeWithCardinality_html_ac227945449c4f8144b6c92afd6ae2156"><divclass="ttname"><ahref="classoperations__research_1_1SetRangeWithCardinality.html#ac227945449c4f8144b6c92afd6ae2156">operations_research::SetRangeWithCardinality::SetRangeWithCardinality</a></div><divclass="ttdeci">SetRangeWithCardinality(int card, int max_card)</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00263">hamiltonian_path.h:263</a></div></div>
<divclass="ttc"id="classoperations__research_1_1Set_html_a67d03a6e5178376e21bdfa720680e447"><divclass="ttname"><ahref="classoperations__research_1_1Set.html#a67d03a6e5178376e21bdfa720680e447">operations_research::Set::end</a></div><divclass="ttdeci">ElementIterator< Set > end() const</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00201">hamiltonian_path.h:201</a></div></div>
<divclass="ttc"id="classoperations__research_1_1Set_html_ae7cd733dab92b86a3aaac89c4d49503f"><divclass="ttname"><ahref="classoperations__research_1_1Set.html#ae7cd733dab92b86a3aaac89c4d49503f">operations_research::Set::FullSet</a></div><divclass="ttdeci">static Set FullSet(Integer card)</div><divclass="ttdef"><b>Definition:</b><ahref="hamiltonian__path_8h_source.html#l00146">hamiltonian_path.h:146</a></div></div>