Skip to content

Is there a better constraint modeling method under Logic programming? #1434

Discussion options

You must be logged in to vote

As explained in the logic programming pages, this is not a recommended way to model that disjunction, as it could be that neither of the conditions are triggered due to numerical tolerances in the solver.

The way to do it robustly is to explicitly list the disjoint cases and trigger with binary variables caseq/case2
F=[F,implies(case1(i), [x_a(i,1)<=x_d(j,5),x_a(i,2)<=x_d(j,5)]) + implies(case2(i),[x_a(i,1)>=x_d(j,5)]) +[case1(i)+case2(i) == 1]

You're not going to get it faster though, generically, as you have a large combinatorial problem

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lzmssyld
Comment options

Answer selected by lzmssyld
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants