Skip to content

MBM/Hull on InfiniteGDP disjunctions where constraints carry different infinite parameters (or none) - #146

Open
dnguyen227 wants to merge 5 commits into
infiniteopt:masterfrom
dnguyen227:infgdp_finite_disjuncts
Open

dnguyen227 wants to merge 5 commits into
infiniteopt:masterfrom
dnguyen227:infgdp_finite_disjuncts

Conversation

@dnguyen227

@dnguyen227 dnguyen227 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

While sampling M values for InfGDP problems, the possibility of finite disjunction constraints was not considered. Small fix applied here.

using DisjunctiveProgramming, InfiniteOpt, HiGHS
model = InfiniteGDPModel(HiGHS.Optimizer)
@infinite_parameter(model, t in [0, 1], num_supports = 11)
@variable(model, 0 <= x <= 10, Infinite(t))   # operating variable
@variable(model, 0 <= d <= 10)                # design variable
@variable(model, Y[1:2], Logical)

@constraint(model, x >= 1 - t)
@constraint(model, d >= 3, Disjunct(Y[1]))    # finite: no infinite variable
@constraint(model, d >= 5, Disjunct(Y[2]))
@disjunction(model, Y)
@objective(model, Min, d + ∫(x, t))

optimize!(model, gdp_method = MBM(HiGHS.Optimizer))

Upon running you'd get

Unrecognized sampler value ExhaustiveSampler() for MBM on an infinite model

ALSO ADDED

  • Variable/constraint carries the indicator's parameters (x(t) or x(t, xi) under Y(t)): unchanged
  • Finite indicator, infinite constraints (x(xi) <= xi under finite Y): unchanged other than fixing error.
  • Variable has fewer parameters (finite d under Y(t), z(t) under Y(t, xi)): was wrong for MBM, MBM-GP and Hull; now the copy contains the indicator's parameters.
  • Parameters partly or not at all shared (v(xi) under Y(t)): was wrong; now the copy contains the union.

The workflow is per variable, so d + x(t) <= 2 - 2t under Y(t) copies d and leaves x(t) alone.

using DisjunctiveProgramming, InfiniteOpt, HiGHS

model = InfiniteGDPModel(HiGHS.Optimizer)
@infinite_parameter(model, t ∈ [0, 1], supports = [0.0, 0.25, 0.5, 0.75, 1.0])
@variable(model, 0 <= d <= 3)                    # finite
@variable(model, Y[1:2], InfiniteLogical(t))     # indicator over t
@constraint(model, d <= 2 - 2t, Disjunct(Y[1]))
@constraint(model, d <= 1 + 2t, Disjunct(Y[2]))
@disjunction(model, Y)
@objective(model, Max, d)

optimize!(model, gdp_method = BigM(10.0)); objective_value(model)          # 1.5
optimize!(model, gdp_method = MBM(HiGHS.Optimizer)); objective_value(model)  # was 1.0
optimize!(model, gdp_method = Hull()); objective_value(model)              # was 1.0

At each t the better disjunct gives d <= max(2 - 2t, 1 + 2t), so the optimum is min_t max(...) = 1.5.

No work needed for MBM-GP because it samples based on sub problems made from the MBM code.

The extension routed every disjunct constraint of an InfiniteModel
through the per-support M sampler, which only accepts an array of
transcribed objectives. A disjunct constraint with no infinite
variables transcribes to a single expression and raised
"Unrecognized `sampler` value" for both the exhaustive and the GP
sampler, whether the disjunction had other infinite constraints or
not. raw_M now solves such a constraint's single M subproblem
directly and skips the sampler.
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (eca397e) to head (7ca2445).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #146   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files          21       21           
  Lines        2265     2284   +19     
=======================================
+ Hits         2258     2277   +19     
  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

Copy link
Copy Markdown
Contributor Author

@pulsipher ready for review

@pulsipher

Copy link
Copy Markdown
Collaborator

Please merge with main to get to resolve conflicts

@dnguyen227 dnguyen227 changed the title Handle finite disjunct constraints in an InfiniteGDP model for MBM MBM/Hull on InfiniteGDP disjunctions where constraints carry different infinite parameters Oct 1, 2026
@dnguyen227 dnguyen227 changed the title MBM/Hull on InfiniteGDP disjunctions where constraints carry different infinite parameters MBM/Hull on InfiniteGDP disjunctions where constraints carry different infinite parameters (or none) Oct 1, 2026
@dnguyen227

Copy link
Copy Markdown
Contributor Author

@pulsipher ready for another look.

Not sure why I can't request review on this PR specifically (the button just isn't there).

@pulsipher pulsipher left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, just want to make the tests a little more robust.

Comment on lines +1231 to +1233
optimize!(model, gdp_method = BigM(10.0))
@test termination_status(model) == MOI.OPTIMAL
@test objective_value(model) ≈ 1.5 atol = 1e-6

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all the tests, can we check more than the objective value to make sure that it is reformulating correctly, not that it just runs.

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.

2 participants