Skip to content

Xpress: empty bound check not working -- fixed#5158

Open
Tahira-2 wants to merge 1 commit intogoogle:mainfrom
Tahira-2:fix/xpress-empty-bounds
Open

Xpress: empty bound check not working -- fixed#5158
Tahira-2 wants to merge 1 commit intogoogle:mainfrom
Tahira-2:fix/xpress-empty-bounds

Conversation

@Tahira-2
Copy link
Copy Markdown

@Tahira-2 Tahira-2 commented May 8, 2026

Title: Xpress: handle empty integer bounds (fixes #5085)

Problem
The MathOpt parametrised test FractionalBoundsContainNoInteger skipped Xpress because integer variables with unrounded bounds like [0.5, 0.6] are rejected by Xpress at variable creation: Xpress rounds the bounds on input, sees [1, 0], and refuses to add the column. SCIP, GLPK, and HiGHS instead return TerminationReason::kInfeasible.

Fix
Mirrors GLPK's EmptyIntegerBoundsResult() pattern:

In AddNewVariables, detect integer variables where lb <= ub && ceil(lb) > floor(ub). For those, substitute [0, 0] in the bounds passed to Xpress (so it accepts the column) and remember the original bounds in a new empty_integer_bounds_vars_ member.
In Solve(), after the existing ListInvertedBounds check, short-circuit with ResultForIntegerInfeasible(...) if any such variable was recorded — without invoking the optimizer. The original lb/ub flow into the user-facing detail message.
Remove the GTEST_SKIP for kXpress in the test.
Files touched
ortools/math_opt/solvers/xpress_solver.{h,cc} — detection + early-return
ortools/math_opt/solvers/BUILD.bazel — added //ortools/math_opt/core:empty_bounds dep
ortools/math_opt/solver_tests/mip_tests.cc — re-enable the test for Xpress
CMake's solver target is built via a recursive glob, so no CMake change is needed.

Test plan
CI: compile + run all non-Xpress solver tests (covered automatically)
Local Xpress run of FractionalBoundsContainNoInteger — needs an Xpress license; cc @Mizux for verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant