Definition at line 40 of file christofides.h.
Public Types | |
| enum | MatchingAlgorithm { MatchingAlgorithm::MINIMUM_WEIGHT_MATCHING, MatchingAlgorithm::MINIMAL_WEIGHT_MATCHING } |
Public Member Functions | |
| ChristofidesPathSolver (NodeIndex num_nodes, CostFunction costs) | |
| void | SetMatchingAlgorithm (MatchingAlgorithm matching) |
| Sets the matching algorith to use. More... | |
| CostType | TravelingSalesmanCost () |
| Returns the cost of the approximate TSP tour. More... | |
| std::vector< NodeIndex > | TravelingSalesmanPath () |
| Returns the approximate TSP tour. More... | |
|
strong |
| Enumerator | |
|---|---|
| MINIMUM_WEIGHT_MATCHING | |
| MINIMAL_WEIGHT_MATCHING | |
Definition at line 42 of file christofides.h.
| operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::ChristofidesPathSolver | ( | NodeIndex | num_nodes, |
| CostFunction | costs | ||
| ) |
Definition at line 177 of file christofides.h.
|
inline |
Sets the matching algorith to use.
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.
Definition at line 58 of file christofides.h.
| CostType operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::TravelingSalesmanCost | ( | ) |
Returns the cost of the approximate TSP tour.
Definition at line 187 of file christofides.h.
| std::vector< NodeIndex > operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::TravelingSalesmanPath | ( | ) |
Returns the approximate TSP tour.
Definition at line 197 of file christofides.h.