Skip to content

Conversation

@dnguyen227
Copy link
Contributor

Working version of #114 .

This adds an extension such that DisjunctiveProgramming is compatible with InfiniteOpt. It overloads the needed functions and provide the InfiniteGDPModel and InfiniteLogical functions.

A basic example is shown below:

using DisjunctiveProgramming, InfiniteOpt, HiGHS

# Create the model
model = InfiniteGDPModel(HiGHS.Optimizer)

# Create the infinite variables
I = 1:4
@infinite_parameter(model, t  [0, 1], num_supports = 100)
@variable(model, 0 <= g[I] <= 10, Infinite(t))

# Add the disjunctions and their indicator variables
@variable(model, G[I, 1:2], InfiniteLogical(t))
@constraint(model, [i  I, j  1:2], 0 <= g[i], Disjunct(G[i, 1]))
@constraint(model, [i  I, j  1:2], g[i] <= 0, Disjunct(G[i, 2]))
@disjunction(model, [i  I], G[i, :])

# Add the logical propositions
@variable(model, W, InfiniteLogical(t))
@constraint(model, G[1, 1]  G[2, 1]  G[3, 1] == W := true)
@constraint(model, 𝔼(binary_variable(W), t) >= 0.95) # incorporate binary variable of logical variable in a nonlogical constraint

# Reformulate and solve 
optimize!(model, gdp_method = Hull())

# check the results
value(W)

As of right now, Hull, BigM, Indicator, and PSplit methods will function. Cutting Planes and Multiple BigM methods will be added in the future.

@dnguyen227 dnguyen227 marked this pull request as ready for review December 17, 2025 04:38
@dnguyen227 dnguyen227 marked this pull request as draft December 19, 2025 19:24
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@dc17a6e). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #130   +/-   ##
=========================================
  Coverage          ?   99.19%           
=========================================
  Files             ?       17           
  Lines             ?     1862           
  Branches          ?        0           
=========================================
  Hits              ?     1847           
  Misses            ?       15           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 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 marked this pull request as ready for review December 22, 2025 17:02
@dnguyen227 dnguyen227 marked this pull request as draft December 22, 2025 17:25
@dnguyen227 dnguyen227 marked this pull request as ready for review December 22, 2025 18:20
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.

3 participants