diff --git a/examples/cpp/uncapacitated_facility_location.cc b/examples/cpp/uncapacitated_facility_location.cc index bd117fb9fd0..caeda5526c5 100644 --- a/examples/cpp/uncapacitated_facility_location.cc +++ b/examples/cpp/uncapacitated_facility_location.cc @@ -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, diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index 64ec86666f8..b5302369840 100644 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -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) diff --git a/ortools/graph/christofides.h b/ortools/graph/christofides.h index 448ade6d702..0945f054caa 100644 --- a/ortools/graph/christofides.h +++ b/ortools/graph/christofides.h @@ -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); @@ -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 @@ -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); @@ -330,7 +333,7 @@ ChristofidesPathSolver::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.