Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <hamiltonian_path.h>
Public Types | |
typedef uint32_t | Integer |
typedef Set< Integer > | NodeSet |
Public Member Functions | |
PruningHamiltonianSolver (CostFunction cost) | |
PruningHamiltonianSolver (int num_nodes, CostFunction cost) | |
CostType | HamiltonianCost (int end_node) |
Returns the cost of the Hamiltonian path from 0 to end_node. | |
Definition at line 876 of file hamiltonian_path.h.
uint32_t operations_research::PruningHamiltonianSolver< CostType, CostFunction >::Integer |
PruningHamiltonianSolver computes a minimum Hamiltonian path from node 0 over a graph defined by a cost matrix, with pruning. For each search state, PruningHamiltonianSolver computes the lower bound for the future overall TSP cost, and stops further search if it exceeds the current best solution. For the heuristics to determine future lower bound over visited nodeset S and last visited node k, the cost of minimum spanning tree of (V \ S) ∪ {k} is calculated and added to the current cost(S). The cost of MST is guaranteed to be smaller than or equal to the cost of Hamiltonian path, because Hamiltonian path is a spanning tree itself.
(user): Use generic map-based cache instead of lattice-based one.
(user): Use SaturatedArithmetic for better precision.
Definition at line 892 of file hamiltonian_path.h.
Set<Integer> operations_research::PruningHamiltonianSolver< CostType, CostFunction >::NodeSet |
Definition at line 893 of file hamiltonian_path.h.
|
explicit |
Definition at line 931 of file hamiltonian_path.h.
operations_research::PruningHamiltonianSolver< CostType, CostFunction >::PruningHamiltonianSolver | ( | int | num_nodes, |
CostFunction | cost ) |
Definition at line 936 of file hamiltonian_path.h.
CostType operations_research::PruningHamiltonianSolver< CostType, CostFunction >::HamiltonianCost | ( | int | end_node | ) |
Returns the cost of the Hamiltonian path from 0 to end_node.
Definition at line 1005 of file hamiltonian_path.h.