Skip to content

Initial DisjunctionSet raising functions. - #152

Draft
dnguyen227 wants to merge 1 commit into
infiniteopt:masterfrom
dnguyen227:disjunction_set_to_gdp
Draft

dnguyen227 wants to merge 1 commit into
infiniteopt:masterfrom
dnguyen227:disjunction_set_to_gdp

Conversation

@dnguyen227

@dnguyen227 dnguyen227 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

This PR adds the ability to raise our new DisjunctionSet into JuMP constraints. This opens the door for other packages to pass us DisjunctionSet for reformulation without us having to create the MOI duplicate in DisjunctiveAlgorithms.jl. This is more so for other packages to hand us their GDP problem and we take care of the reformulation.

If for whatever reason a modeler wanted to use it directly, here is an example.

using JuMP, DisjunctiveProgramming, HiGHS

m = Model()
@variable(m, 0 <= x <= 9)
@variable(m, y, Bin)
@objective(m, Max, x)

@constraint(m, [1, y, 1 - y, x, x] in DisjunctionSet([[MOI.LessThan(2.0)], [MOI.GreaterThan(8.0)]]))

model = GDPModel()
MOI.copy_to(backend(model), backend(source)) 
set_optimizer(model, HiGHS.Optimizer)
optimize!(model, gdp_method = Hull())

@dnguyen227

dnguyen227 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

In the end I'd like to make a PR with Bilevel.jl to add a disjunctive mode. Not fully scoped out but a PR with them would look like

mutable struct DisjunctionMode{T} <: AbstractBilevelSolverMode{T}
    function DisjunctionMode()
        return new{Float64}()
    end
end

And then we'd dispatch on their add_complement function.

function BilevelJuMP.add_complement(
    mode::BilevelJuMP.DisjunctionMode{T},
    m,
    comp::BilevelJuMP.Complement,
    idxmap_primal,
    idxmap_dual,
    copy_names::Bool,
    pass_start::Bool,
) where {T}

Code for disjunctive form of a complement.

    return c
end

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.74%. Comparing base (bae7c2c) to head (938a9ff).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #152   +/-   ##
=======================================
  Coverage   99.73%   99.74%           
=======================================
  Files          23       23           
  Lines        2659     2729   +70     
=======================================
+ Hits         2652     2722   +70     
  Misses          7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dnguyen227
dnguyen227 force-pushed the disjunction_set_to_gdp branch from 08547b8 to 938a9ff Compare November 9, 2026 01:23

This branch has not been deployed

No deployments
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