Skip to content

Handle finite disjunct constraints in an InfiniteGDP model for MBM - #146

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

dnguyen227 wants to merge 3 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

,

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 (be8e24b).

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

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