6616 Commits

Author SHA1 Message Date
Florian Klink
b5a2f8ac40 math_opt: only run SCIP tests if enabled
Usage of SCIP library can be disabled in CMake build by setting
-DUSE_SCIP=OFF.

However, the tests were still run unconditionally, showing test failures like this:

```
/build/source/ortools/math_opt/solver_tests/test_models_test.cc:29: Failure
Value of: Solve(*model, SolverType::kGscip)
Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 9 (absolute error <= 1.0000000000000001e-05))
  Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled

[  FAILED  ] SmallModelTest.Integer (2 ms)
[ RUN      ] SmallModelTest.Continuous
[       OK ] SmallModelTest.Continuous (1 ms)
[----------] 2 tests from SmallModelTest (3 ms total)

[----------] 2 tests from DenseIndependentSetTest
[ RUN      ] DenseIndependentSetTest.Integer
/build/source/ortools/math_opt/solver_tests/test_models_test.cc:40: Failure
Value of: Solve(*model, SolverType::kGscip)
Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 7 (absolute error <= 1.0000000000000001e-05))
  Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled

[  FAILED  ] DenseIndependentSetTest.Integer (0 ms)
[ RUN      ] DenseIndependentSetTest.Continuous
[       OK ] DenseIndependentSetTest.Continuous (1 ms)
[----------] 2 tests from DenseIndependentSetTest (2 ms total)

[----------] 1 test from DenseIndependentSetHint5Test
[ RUN      ] DenseIndependentSetHint5Test.HintIsFeasibleWithObjective5
/build/source/ortools/math_opt/solver_tests/test_models_test.cc:59: Failure
Value of: Solve(*model, SolverType::kGscip)
Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 5 (absolute error <= 1.0000000000000001e-05))
  Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled

[  FAILED  ] DenseIndependentSetHint5Test.HintIsFeasibleWithObjective5 (0 ms)
[----------] 1 test from DenseIndependentSetHint5Test (0 ms total)

[----------] 2 tests from IndependentSetCompleteGraphTest
[ RUN      ] IndependentSetCompleteGraphTest.Integer
/build/source/ortools/math_opt/solver_tests/test_models_test.cc:65: Failure
Value of: Solve(*model, SolverType::kGscip)
Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 1 (absolute error <= 1.0000000000000001e-05))
  Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled

[  FAILED  ] IndependentSetCompleteGraphTest.Integer (0 ms)
```

Fix this, by conditionalizing these tests on USE_SCIP.
2025-08-01 14:53:43 +02:00
Laurent Perron
32bd8e0209 [CP-SAT] small cleanup, more work on linear2 2025-07-31 13:57:50 -07:00
Laurent Perron
9fa9bd4da4 [CP-SAT] better dtime for scheduling constraints; connect the time limit in the repair_hint mode; fix #4743 2025-07-29 09:07:13 -07:00
Laurent Perron
a3fc2000e4 Merge pull request #4737 from pavlomuts/highs_solution_hint
Pass solution hint to HiGHS from mathopt
2025-07-29 05:44:53 -07:00
Laurent Perron
13e2a14ab6 wrap flat matrices 2025-07-28 10:34:48 -07:00
Laurent Perron
87a66e6239 update python typing 2025-07-28 10:34:20 -07:00
Laurent Perron
99ede3bbde [CP-SAT] more polishing on the python API; fix #4733; improve linear2 processing 2025-07-28 10:34:04 -07:00
Laurent Perron
374cc3e596 polish code 2025-07-27 15:29:20 -07:00
Laurent Perron
a0e25debc5 [CP-SAT] extend support for enforcement literals in constraints 2025-07-26 21:29:40 +02:00
Laurent Perron
8b4c79dd75 [CP-SAT] Python: rewrite support for variable numbers of arguments 2025-07-26 21:29:09 +02:00
Laurent Perron
f2cf147e79 [CP-SAT] rewrite and speed up the python layer; extend support for enforcement literals to more constraints 2025-07-24 23:51:00 +02:00
Guillaume Chatelet
99694439f1 Remove duplicated load statement 2025-07-24 16:39:17 +00:00
Guillaume Chatelet
6759325e87 Fix load statements 2025-07-24 16:37:06 +00:00
Guillaume Chatelet
5ffb66cdce Fix bazel load rules 2025-07-24 10:10:29 +02:00
Corentin Le Molgat
a7f49a2585 backport from main
* rename swig files .i in .swig
* update constraint_solver and routing
* backport math_opt changes
* move dynamic loading to ortools/third_party_solvers
2025-07-23 23:12:34 +02:00
Corentin Le Molgat
03e2551e61 set_cover: backport from main 2025-07-23 15:06:59 +02:00
Corentin Le Molgat
4151254eba sat: backport from main 2025-07-23 15:04:05 +02:00
Guillaume Chatelet
cddd80e8e2 Backport string_view_migration.h 2025-07-23 15:04:05 +02:00
Guillaume Chatelet
447ce0b3e2 Fix bazel load rules 2025-07-23 09:05:10 +00:00
Pavlo Muts
fd1443e820 Implement setting of partial solution, activate corresponding tests 2025-07-22 19:29:26 +02:00
Pavlo Muts
97636fdec7 test: enable primal only warm starts for Highs LP model solve parameters 2025-07-22 13:29:46 +02:00
Pavlo Muts
0ab3f0fabd setSolution() from Highs accepts solution hint 2025-07-22 10:49:51 +02:00
Corentin Le Molgat
d344fd265a cmake: fix build when using -DUSE_SCIP=OFF 2025-07-21 11:56:27 +02:00
Corentin Le Molgat
3b6336a63c cmake: fix build when using -DUSE_SCIP=OFF 2025-07-21 11:48:13 +02:00
Guillaume Chatelet
8098080ff3 Merge pull request #4735 from google/backport_string_view_migration
Backport string_view_migration.h
2025-07-21 10:01:20 +02:00
Guillaume Chatelet
924ba73402 Fix
* Re-introduce it in base/ BUILD.bazel
* Add explicit deps in every target using it
2025-07-18 16:18:11 +00:00
Guillaume Chatelet
46f73b3d35 Backport trivial changes 2025-07-18 16:43:00 +02:00
Guillaume Chatelet
7db9c0e956 Backport string_view_migration.h 2025-07-18 11:59:34 +00:00
Guillaume Chatelet
d869a1fd4c Backport trivial changes 2025-07-18 08:11:03 +00:00
Laurent Perron
04d0dbc606 [CP-SAT] optimize the python layer 2025-07-17 17:51:53 +02:00
Laurent Perron
8ca9d11491 Merge branch 'main' of github.com:google/or-tools 2025-07-17 12:55:59 +02:00
Laurent Perron
0720713896 [CP-SAT] simplify python proto generation workflow 2025-07-17 12:55:17 +02:00
Mizux Seiha
1f042bf9b4 cleanup bin_packing_cft 2025-07-17 09:47:34 +02:00
Thibaut Cuvelier
2ef89ae3b8 Move the sample bin-packing solver from algorithms to set_cover, the only place it is used.
The main reason is that we have several solvers, including some being open-sourced, in the `packing/` folder.
2025-07-17 01:47:31 +02:00
Laurent Perron
442b71c829 sort 2025-07-16 17:42:09 +02:00
Laurent Perron
ed8f74273c fix python cp-sat under bazel 2025-07-16 17:41:50 +02:00
Laurent Perron
a42647f9cf improve 2d packing 2025-07-16 17:41:33 +02:00
Laurent Perron
d14aa7a85a cleanups 2025-07-16 17:41:16 +02:00
Laurent Perron
e5dc796ef6 [CP-SAT] remove the use of python protobufs; use proxies to C++ protobufs instead; this changes slightly the API of these proto for parameters 2025-07-16 16:55:49 +02:00
rs-blade
58f3c54580 Add MPConstraint::Clear() to C# wrapper 2025-07-15 14:08:48 +02:00
Francesco Cavaliere
3aea3a8656 Column generation Bin Packing heuristic based on CFT (#4639)
* Laid down outer refinement tentative integration with existing code
* Fixed Refinement design, (still figuring out a clean way to integrate it)
* Adding base object accessor function to views
* Completed `ResetToIdentitySubModel` for `CoreModel` and `SubModelView`
* Minor numerical issues strenghtening
* Time statistics
* Improved subgradient stability with numerically challenging cases
* Removed subgradient stabilization (issues with core updates)
* Forcing core update at subgradient end
* Replacing std::cout with VLOGs
* Housekeeping
* CoreUpdate more robust to potential full-model changes
* Skip CoreUpdate when columns are rougthly the same number of rows
* Full-model does not require row-view anymore
* Added cft example
* More torough `FullToSubModelInvariantCheck`
* Better management of empty columns
* Improved `FullToSubModelInvariantCheck`
* Refactored `FullToCoreModel` column selection
* Minor `FullToCoreModel` cleaning
* Refactored `FullToCoreModel` to simplify extention with column generation
* BinPacking model
* Bin Packing instance readers
* Simple best fit greedy heuristic
* Simple initial bin generation
* Bin set
* Initial work on Bin Packing - Set Cover core model generator
* Simple knapsack greedy heuristic
* Simple Branch and bound for Knapsack (from Pisinger)
* Dyamic column generation in core model update
* CFT based bin packing heuristic example
* Split initial bin generation with randomized one
* Updated `bin_packing_cft.cc` example
* Fixed some problems with BPP column generation
* Added small test to bin_packing example
2025-07-10 18:03:17 +02:00
Corentin Le Molgat
14b7d49b96 glop: Update README.md 2025-07-10 11:40:51 +02:00
Corentin Le Molgat
91cbda4aea flatzinc: backport from main branch 2025-07-09 14:24:17 +02:00
Corentin Le Molgat
1d0ff09af8 ortools: backport from main branch 2025-07-09 14:24:01 +02:00
Corentin Le Molgat
9144637624 ortools: cleanup export form google3 2025-07-09 14:14:34 +02:00
Mizux Seiha
24eb888d2e doxygen: update docs 2025-07-09 14:13:52 +02:00
Corentin Le Molgat
052d57da07 doxygen: Improve C++ ref manual
* Had to use absolute paths otherwise `ortools/<dir>` conflict with `build/ortools/<dir>`
* rework Doxygen main page following devsite C++ ref overview.
* improve doxygen c++ cache
  note: doxygen log specify the ideal cache size according to the previous run.
2025-07-09 14:13:46 +02:00
Corentin Le Molgat
3445c9233f cpp: Add DoxygenLayout.xml
move "detailedDescription" to top to follow devsite layout convention
2025-07-09 14:13:41 +02:00
Corentin Le Molgat
781ead7283 ortools: export from google3 2025-07-09 14:13:35 +02:00
Corentin Le Molgat
a99e559734 ortools: cleanup export form google3 2025-07-09 13:53:39 +02:00