Skip to content

Support native MOI.ZeroOne constraints - #223

Merged
blegat merged 1 commit into
masterfrom
bl/native-zero-one
Nov 6, 2026
Merged

blegat merged 1 commit into
masterfrom
bl/native-zero-one

Conversation

@blegat

@blegat blegat commented Nov 6, 2026

Copy link
Copy Markdown
Member

Closes #222

Represent binary variables using integer columns with bounds intersected
with [0, 1]. Track ZeroOne independently from Integer so direct models do
not expose bridge-internal integrality constraints to JuMP.

Preserve explicit bounds when adding, changing, or deleting binary
constraints, and retain integrality while either discrete constraint
remains. Clear binary state when deleting variables or emptying models.

Add a standalone regression file, included by runtests.jl, and a test
project. Cover bounds in either insertion/deletion order, overlapping
Integer constraints, column reuse, and MOI's ZeroOne conformance tests.

Validation:
- test/test_zero_one.jl: 223 assertions passed with the test project.
- Issue 222 JuMP reproduction: 28 assertions passed for direct and bridged
  direct models, including MILP solves, fixing, LP dual = 1.0, restoring,
  and re-solving.
- Temporary @show @__LINE__ traces confirmed the new code and ZeroOne
  method instances execute; tracing was removed afterward.
- JuliaFormatter 2.14.7 over the repository leaves no unstaged diff.

Fixes #222.
@blegat
blegat merged commit aecf9e0 into master Nov 6, 2026
5 checks passed
@blegat
blegat deleted the bl/native-zero-one branch November 6, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Support MOI.ZeroOne natively so binary variables work in direct_model

1 participant