Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e8fb40f
WIP Multi-Big M
dnguyen227 Jun 19, 2025
0f7ad32
Deleting mbm copy.jl as it's not needed anymore
dnguyen227 Jun 19, 2025
c2e07a9
Added code coverage.
dnguyen227 Jun 19, 2025
2b25f70
More test cases
dnguyen227 Jun 23, 2025
dce303e
Testing MBM type
dnguyen227 Jun 23, 2025
5a1c0b2
working ver
dnguyen227 Jun 23, 2025
783d7af
Code coverage 100% for mbm.jl file.
dnguyen227 Jun 23, 2025
fdbe64c
Added comments, full code coverage on mbm.jl file TO BE TESTED
dnguyen227 Jun 24, 2025
db73d2f
Code coverage tested to be 100%. Further documentation for mbm te…
dnguyen227 Jun 25, 2025
0f40895
Delete src/codecoverage.jl
dnguyen227 Jun 25, 2025
0ae3623
Update datatypes.jl
dnguyen227 Jun 25, 2025
0044ea4
Updated documentation, JuMP. calls.
dnguyen227 Jul 28, 2025
56ca380
More JuMP. additions
dnguyen227 Jul 28, 2025
9830edb
Works with AbstractVariableRef
dnguyen227 Aug 7, 2025
2010800
Made _copy_variable function
dnguyen227 Aug 7, 2025
151abec
_copy_variable function added.
dnguyen227 Aug 10, 2025
10ca5d7
Updated _copy_variable()
dnguyen227 Sep 3, 2025
c6d3cba
Generalizing datatypes.
dnguyen227 Sep 15, 2025
340e56e
style: remove empty lines before function definition
dnguyen227 Sep 15, 2025
81e17fa
Initial commit for VariableProperties and _variable_from_properties.
dnguyen227 Sep 18, 2025
18f5eef
80 Character Edit
dnguyen227 Sep 18, 2025
c7a9bcf
Merge branch 'make_variable' of https://github.com/dnguyen227/Disjunc…
dnguyen227 Sep 19, 2025
332a06c
todo: Revise make_variable once more then merge branches.
dnguyen227 Sep 19, 2025
f1d6792
Merge remote-tracking branch 'infiniteopt/DisjunctiveProgramming.jl/m…
dnguyen227 Sep 22, 2025
c3d949e
updated mbm to work with new variable creation.
dnguyen227 Sep 22, 2025
1422c7f
fixed datatypes in _maximize_M
dnguyen227 Sep 22, 2025
8ce7338
updated mbm to have consistent arguments with its dispatch. fixed iss…
dnguyen227 Sep 23, 2025
55a9e76
updated tests.
dnguyen227 Sep 24, 2025
f47f140
removed instances of float64 to generalize
dnguyen227 Sep 24, 2025
6901951
indentation change, and generalizing replace_variables_in_constraint …
dnguyen227 Sep 25, 2025
061ed12
Changed _replace_variables_in_constraint and _constraint_to_objective…
dnguyen227 Sep 25, 2025
1451a82
created utilities file for more general helper functions,
dnguyen227 Sep 25, 2025
4981334
change in interval constraints handling
dnguyen227 Sep 26, 2025
8e53941
deleting comment
dnguyen227 Sep 26, 2025
34fdbbd
Change to MBM datatype as well as internal addition. More tests added.
dnguyen227 Sep 29, 2025
0393282
additional argument added for documentation
dnguyen227 Sep 29, 2025
ff89262
remove space edit
dnguyen227 Sep 30, 2025
1727f39
updated nonlienar test case for test__replace_variables_in_constraint
dnguyen227 Sep 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ The following reformulation methods are currently supported:

3. [Indicator](https://jump.dev/JuMP.jl/stable/manual/constraints/#Indicator-constraints): This method reformulates each disjunct constraint into an indicator constraint with the Boolean reformulation counterpart of the Logical variable used to define the disjunct constraint.

4. [MBM](https://doi.org/10.1016/j.compchemeng.2015.02.013): The multiple big-m method creates multiple M values for each disjunct constraint. The 'MBM' struct is created with the following required argument:

- `optimizer`: Optimizer to use when solving subproblems to determine M values. This is a required value.
- `default_M`: Default big-M value to use if no big-M is specified for a logical variable (1e9).

## Release Notes

Prior to `v0.4.0`, the package did not leverage the JuMP extension capabilities and was not as robust. For these earlier releases, refer to [Perez, Joshi, and Grossmann, 2023](https://arxiv.org/abs/2304.10492v1) and the following [JuliaCon 2022 Talk](https://www.youtube.com/watch?v=AMIrgTTfUkI).
Expand Down
3 changes: 2 additions & 1 deletion src/DisjunctiveProgramming.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Reexport.@reexport using JuMP

# Use Meta for metaprogramming
using Base.Meta

# Create aliases
import JuMP.MOI as _MOI
import JuMP.MOIU.CleverDicts as _MOIUC
Expand All @@ -22,8 +21,10 @@ include("macros.jl")
include("reformulate.jl")
include("bigm.jl")
include("hull.jl")
include("mbm.jl")
include("indicator.jl")
include("print.jl")
include("utilities.jl")

# Define additional stuff that should not be exported
const _EXCLUDE_SYMBOLS = [Symbol(@__MODULE__), :eval, :include]
Expand Down
34 changes: 34 additions & 0 deletions src/datatypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,40 @@ struct BigM{T} <: AbstractReformulationMethod
end
end

"""
MBM{O, T, L <: LogicalVariableRef} <: AbstractReformulationMethod

A type for using the multiple big-M reformulation approach for disjunctive constraints.

**Fields**
- `optimizer::O`: Optimizer to use when solving mini-models (required).
- `default_M::T`: Default big-M value to use if no big-M is specified for a logical variable (1e9).
"""
mutable struct MBM{O, T} <: AbstractReformulationMethod
optimizer::O
default_M::T

# Constructor with optimizer (required) and optional default_M
function MBM(optimizer::O, default_M::T = 1e9) where {O, T}
new{O, T}(optimizer, default_M)
end
end

mutable struct _MBM{O, T, M <: JuMP.AbstractModel} <: AbstractReformulationMethod
optimizer::O
M::Dict{LogicalVariableRef{M}, T}
default_M::T
conlvref::Vector{LogicalVariableRef{M}}

function _MBM(method::MBM{O, T}, model::M) where {O, T, M <: JuMP.AbstractModel}
new{O, T, M}(method.optimizer,
Dict{LogicalVariableRef{M}, T}(),
method.default_M,
Vector{LogicalVariableRef{M}}()
)
end
end

"""
Hull{T} <: AbstractReformulationMethod

Expand Down
Loading
Loading