Skip to content

Add InfiniteOpt as an Extension - #130

Merged
pulsipher merged 33 commits into
infiniteopt:masterfrom
dnguyen227:infiniteext
Jan 6, 2026
Merged

Add InfiniteOpt as an Extension#130
pulsipher merged 33 commits into
infiniteopt:masterfrom
dnguyen227:infiniteext

Conversation

@dnguyen227

Copy link
Copy Markdown
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
Comment thread src/variables.jl Outdated
Comment thread Project.toml Outdated
Comment thread ext/InfiniteDisjunctiveProgramming.jl Outdated
Comment thread src/psplit.jl Outdated
Comment thread src/utilities.jl Outdated
@dnguyen227
dnguyen227 marked this pull request as draft December 19, 2025 19:24
@codecov-commenter

codecov-commenter commented Dec 21, 2025

Copy link
Copy Markdown

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.

Comment thread .github/workflows/CI.yml Outdated
Comment thread Project.toml
@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
Comment thread ext/InfiniteDisjunctiveProgramming.jl Outdated
Comment thread ext/InfiniteDisjunctiveProgramming.jl Outdated
Comment thread ext/InfiniteDisjunctiveProgramming.jl Outdated
Comment thread ext/InfiniteDisjunctiveProgramming.jl Outdated
Comment thread src/utilities.jl Outdated
Comment thread test/runtests.jl Outdated
Comment thread test/runtests.jl Outdated
Comment thread Project.toml Outdated
Comment thread Project.toml Outdated
Comment thread Project.toml Outdated
@dnguyen227
dnguyen227 requested a review from pulsipher January 4, 2026 20:40

@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.

Just two minor questions

Comment thread ext/InfiniteDisjunctiveProgramming.jl
@dnguyen227
dnguyen227 requested a review from pulsipher January 5, 2026 23:29
@pulsipher
pulsipher merged commit e9e7222 into infiniteopt:master Jan 6, 2026
4 checks passed
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