Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction > Class Template Reference

Detailed Description

template<typename CostType, typename ArcIndex = int64_t, typename NodeIndex = int32_t, typename CostFunction = std::function<CostType(NodeIndex, NodeIndex)>>
class operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >

Definition at line 56 of file christofides.h.

#include <christofides.h>

Public Types

enum class  MatchingAlgorithm { MINIMUM_WEIGHT_MATCHING , MINIMUM_WEIGHT_MATCHING_WITH_MIP , MINIMAL_WEIGHT_MATCHING }

Public Member Functions

 ChristofidesPathSolver (NodeIndex num_nodes, CostFunction costs)
void SetMatchingAlgorithm (MatchingAlgorithm matching)
absl::StatusOr< CostType > TravelingSalesmanCost ()
absl::StatusOr< const std::vector< NodeIndex > & > TravelingSalesmanPath ()
absl::Status Solve ()

Member Enumeration Documentation

◆ MatchingAlgorithm

template<typename CostType, typename ArcIndex = int64_t, typename NodeIndex = int32_t, typename CostFunction = std::function<CostType(NodeIndex, NodeIndex)>>
enum class operations_research::ChristofidesPathSolver::MatchingAlgorithm
strong
Enumerator
MINIMUM_WEIGHT_MATCHING 
MINIMUM_WEIGHT_MATCHING_WITH_MIP 
MINIMAL_WEIGHT_MATCHING 

Definition at line 58 of file christofides.h.

Constructor & Destructor Documentation

◆ ChristofidesPathSolver()

template<typename CostType, typename ArcIndex, typename NodeIndex, typename CostFunction>
operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::ChristofidesPathSolver ( NodeIndex num_nodes,
CostFunction costs )

Definition at line 240 of file christofides.h.

Member Function Documentation

◆ SetMatchingAlgorithm()

template<typename CostType, typename ArcIndex = int64_t, typename NodeIndex = int32_t, typename CostFunction = std::function<CostType(NodeIndex, NodeIndex)>>
void operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::SetMatchingAlgorithm ( MatchingAlgorithm matching)
inline

Definition at line 73 of file christofides.h.

◆ Solve()

template<typename CostType, typename ArcIndex, typename NodeIndex, typename CostFunction>
absl::Status operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::Solve ( )

Definition at line 273 of file christofides.h.

◆ TravelingSalesmanCost()

template<typename CostType, typename ArcIndex, typename NodeIndex, typename CostFunction>
absl::StatusOr< CostType > operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::TravelingSalesmanCost ( )

Definition at line 251 of file christofides.h.

◆ TravelingSalesmanPath()

template<typename CostType, typename ArcIndex, typename NodeIndex, typename CostFunction>
absl::StatusOr< const std::vector< NodeIndex > & > operations_research::ChristofidesPathSolver< CostType, ArcIndex, NodeIndex, CostFunction >::TravelingSalesmanPath ( )

Definition at line 262 of file christofides.h.


The documentation for this class was generated from the following file: