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

linearize alters number of solutions #400

Closed
Wout4 opened this issue Aug 18, 2023 · 1 comment · Fixed by #401
Closed

linearize alters number of solutions #400

Wout4 opened this issue Aug 18, 2023 · 1 comment · Fixed by #401

Comments

@Wout4
Copy link
Collaborator

Wout4 commented Aug 18, 2023

Due to auxiliary variables being created on the rhs of an implication, the number of solutions can increase after linearize

@Wout4
Copy link
Collaborator Author

Wout4 commented Aug 18, 2023

example code:

iv = intvar(1,2, shape=1)
bv = boolvar()
cons = [(Minimum([iv])!=1) == bv]
print(Model(cons).solveAll('ortools'))
print(Model(cons).solveAll('gurobi',solution_limit=3)) #more solutions according to gurobi
print(linearize_constraint(only_bv_implies(flatten_constraint(cons))))
cons = linearize_constraint(only_bv_implies(flatten_constraint(cons))) #its because of linearize (big m)
print(Model(cons).solveAll('ortools'))

@Wout4 Wout4 linked a pull request Sep 5, 2023 that will close this issue
@Wout4 Wout4 closed this as completed in #401 Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant