Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to constraint variables to binary or integer values. #14

Merged
merged 9 commits into from
Dec 21, 2023

Conversation

stelmo
Copy link
Member

@stelmo stelmo commented Dec 17, 2023

Allows construction of MILPs

@stelmo
Copy link
Member Author

stelmo commented Dec 17, 2023

/format

triggered by @stelmo on PR #14
Copy link

✔️ Auto-formatting triggered by this comment succeeded, commited as 725ed51

Copy link

codecov bot commented Dec 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (250bf55) 100.00% compared to head (df4e357) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #14   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          196       196           
=========================================
  Hits           196       196           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@exaexa exaexa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few comments, will fix/merge later

src/bound.jl Outdated Show resolved Hide resolved
src/bound.jl Outdated Show resolved Hide resolved
src/bound.jl Outdated Show resolved Hide resolved
src/bound.jl Outdated Show resolved Hide resolved
docs/src/mixed-integer-optimization.jl Outdated Show resolved Hide resolved
@exaexa
Copy link
Member

exaexa commented Dec 18, 2023

OK so, this is gonna be harder:

  • JuMP and other systems don't really seem to support actual integer CONSTRAINTS, just integer VARIABLES. That kinda sucks from the algebraic point of view but what can we do, solver reality is harsh.
  • there are very many thinkable types of constraints and their interpretations -- I can think of few representations just for the integers: (bool, choice from vector, choice from range, free integer, powers of 2, approximate free integer with error term on it, .......)

In the long term I suggest we remove the closed type family Bound and convert it to open, just as was done for Value. That prevents us from forcing a given MILP representation to people, and allows everyone to treat the MILPs as they seem fit. The modification of actual CT source code will thus stay minimal and the functionality will be preserved.

For the current state, I think the easiest way of supporting integer constraints is to just smash in an extra JuMP variable and an equality bound (in the end that would be the same). That should go to the tutorial.

Also, we should re-think the Floatiness of the whole CTs at that point (people might just want to get integers out).

@exaexa exaexa added enhancement New feature or request documentation Improvements or additions to documentation 🪄 hexed by MILPs 🪄 this gonna be hard labels Dec 18, 2023
@stelmo
Copy link
Member Author

stelmo commented Dec 21, 2023

Okay, I think opening it to integer constraints is definitely more general.

@exaexa exaexa self-assigned this Dec 21, 2023
@exaexa
Copy link
Member

exaexa commented Dec 21, 2023

@stelmo can you review here?

edit: technically you can't for M$ reasons, pls just ack. :D

Copy link
Member Author

@stelmo stelmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me!

@exaexa exaexa merged commit 8df256b into master Dec 21, 2023
5 checks passed
@exaexa exaexa deleted the sew-milp branch December 21, 2023 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request 🪄 hexed by MILPs 🪄 this gonna be hard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants