Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/cpp/uncapacitated_facility_location.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ void RunAllExamples(int32_t facilities, int32_t clients, double fix_cost) {
UncapacitatedFacilityLocation(facilities, clients, fix_cost,
MPSolver::GLPK_MIXED_INTEGER_PROGRAMMING);
#endif
#if defined(USE_HIGHS)
LOG(INFO) << "---- Integer programming example with HiGHS ----";
UncapacitatedFacilityLocation(facilities, clients, fix_cost,
MPSolver::HIGHS_MIXED_INTEGER_PROGRAMMING);
#endif
#if defined(USE_SCIP)
LOG(INFO) << "---- Integer programming example with SCIP ----";
UncapacitatedFacilityLocation(facilities, clients, fix_cost,
Expand Down
1 change: 1 addition & 0 deletions makefiles/Makefile.cpp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ detect_cpp:
@echo USE_COINOR = $(USE_COINOR)
@echo USE_SCIP = $(USE_SCIP)
@echo USE_GLPK = $(USE_GLPK)
@echo USE_HIGHS = $(USE_HIGHS)
@echo USE_CPLEX = $(USE_CPLEX)
ifdef GLPK_ROOT
@echo GLPK_ROOT = $(GLPK_ROOT)
Expand Down
11 changes: 7 additions & 4 deletions ortools/graph/christofides.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class ChristofidesPathSolver {
public:
enum class MatchingAlgorithm {
MINIMUM_WEIGHT_MATCHING,
#if defined(USE_CBC) || defined(USE_SCIP)
#if defined(USE_CBC) || defined(USE_SCIP) || defined(USE_HIGHS)
MINIMUM_WEIGHT_MATCHING_WITH_MIP,
#endif // defined(USE_CBC) || defined(USE_SCIP)
#endif // defined(USE_CBC) || defined(USE_SCIP) || defined(USE_HIGHS)
MINIMAL_WEIGHT_MATCHING,
};
ChristofidesPathSolver(NodeIndex num_nodes, CostFunction costs);
Expand Down Expand Up @@ -155,7 +155,7 @@ ComputeMinimumWeightMatching(const GraphType& graph,
return match;
}

#if defined(USE_CBC) || defined(USE_SCIP)
#if defined(USE_CBC) || defined(USE_SCIP) || defined(USE_HIGHS)
// Computes a minimum weight perfect matching on an undirected graph using a
// Mixed Integer Programming model.
// TODO(user): Handle infeasible cases if this algorithm is used outside of
Expand Down Expand Up @@ -211,6 +211,9 @@ ComputeMinimumWeightMatchingWithMIP(const GraphType& graph,
#if defined(USE_SCIP)
MPSolver mp_solver("MatchingWithSCIP",
MPSolver::SCIP_MIXED_INTEGER_PROGRAMMING);
#elif defined(USE_HIGHS)
MPSolver mp_solver("MatchingWithHiGHS",
MPSolver::HIGHS_MIXED_INTEGER_PROGRAMMING);
#elif defined(USE_CBC)
MPSolver mp_solver("MatchingWithCBC",
MPSolver::CBC_MIXED_INTEGER_PROGRAMMING);
Expand Down Expand Up @@ -330,7 +333,7 @@ ChristofidesPathSolver<CostType, ArcIndex, NodeIndex, CostFunction>::Solve() {
result->swap(closure_arcs);
break;
}
#endif // defined(USE_CBC) || defined(USE_SCIP)
#endif // defined(USE_CBC) || defined(USE_SCIP) || defined(USE_HIGHS)
case MatchingAlgorithm::MINIMAL_WEIGHT_MATCHING: {
// TODO(user): Cost caching was added and can gain up to 20% but
// increases memory usage; see if we can avoid caching.
Expand Down
Loading