[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ePruningHamiltonianSolver\u003c/code\u003e class is used for solving the Hamiltonian path problem in C++, aiming to find the shortest path that visits all nodes exactly once.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods such as \u003ccode\u003eHamiltonianCost\u003c/code\u003e to retrieve the cost of the path and constructors to initialize the solver with the problem's cost function and number of nodes.\u003c/p\u003e\n"],["\u003cp\u003eUsers can leverage this class by providing a cost function that defines the cost between any two nodes and utilizing its methods to determine the optimal Hamiltonian path and its associated cost.\u003c/p\u003e\n"]]],["The `PruningHamiltonianSolver` class in C++ offers methods for calculating Hamiltonian paths. The `HamiltonianCost` method computes the cost of a path from node 0 to a specified `end_node`, returning the cost as `CostType`. The class constructor `PruningHamiltonianSolver` can be initialized with a `CostFunction` or with the number of nodes (`num_nodes`) and a `CostFunction`. These methods are part of calculating hamiltonian path in the graph.\n"],null,["# PruningHamiltonianSolver\n\nC++ Reference: class PruningHamiltonianSolver\n=============================================\n\n\nNote: This documentation is automatically generated.\n\n| Method ||\n|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|\n| [`HamiltonianCost`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/hamiltonian_path.h#L901) | Return type: `CostType ` Arguments: `int end_node` Returns the cost of the Hamiltonian path from 0 to end_node. |\n| [`PruningHamiltonianSolver`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/hamiltonian_path.h#L897) | Return type: `explicit ` Arguments: `CostFunction cost` \u003cbr /\u003e |\n| [`PruningHamiltonianSolver`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/hamiltonian_path.h#L898) | \u003cbr /\u003e Arguments: `int num_nodes, CostFunction cost` \u003cbr /\u003e |"]]