jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.17k stars 390 forks source link

[docs] fix bounds in big-M examples of tips_and_tricks.jl #3721

Closed odow closed 3 months ago

odow commented 3 months ago

Follow-up to #3720

@remi-garcia how is this?

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.42%. Comparing base (af30cde) to head (2e6afd9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3721 +/- ## ======================================= Coverage 98.42% 98.42% ======================================= Files 43 43 Lines 5825 5825 ======================================= Hits 5733 5733 Misses 92 92 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

remi-garcia commented 3 months ago

It is better, it is consistent that way. But I am wondering why in

In addition, if the variables involved have finite domains, then JuMP can automatically reformulate an indicator into a mixed-integer program.

variables must have a finite domain and not just upper bounds in case of <= and lower bounds in case of >=.

I will try to have a look at the JuMP reformulation as I think that it is possible to have JuMP to automatically reformulate an indicator into a mixed-integer program whenever there is the right bound and not just with finite domains.

odow commented 3 months ago

I will try to have a look at the JuMP reformulation as I think that it is possible to have JuMP to automatically reformulate an indicator into a mixed-integer program whenever there is the right bound and not just with finite domains.

Yes, that's possible. I just went with the simplest thing.

The relevant bridge is https://github.com/jump-dev/MathOptInterface.jl/blob/master/src/Bridges/Constraint/bridges/indicator_to_milp.jl