potassco / clingcon

⛓️ Extension of clingo to handle constraints over integers
https://potassco.org/
MIT License
25 stars 4 forks source link

Non-optimal models when minimizing after optimal model. #28

Closed rkaminsk closed 4 years ago

rkaminsk commented 4 years ago

When minimizing with multiple threads it can happen that the optimal model is followed by non-optimal models. With the current API there is no way to prevent this nicely. What would be necessary is a way to discard a model at the last instance.

Answer: 4
permutation(a,c) permutation(b,a)
Valid assignment for constraints found:
bound=16 (a,1)=1 (a,2)=7 (b,1)=0 (b,2)=1 (c,1)=4 (c,2)=11
Cost: 16
Answer: 5
permutation(a,c) permutation(b,a)
Valid assignment for constraints found:
bound=17 (a,1)=1 (a,2)=7 (b,1)=0 (b,2)=1 (c,1)=7 (c,2)=12
Cost: 17
SATISFIABLE
rkaminsk commented 4 years ago

Fixed. (Required adjustments to clingo and clasp.)