[gecode-users] Sub expression limits

Neill Clift neillclift at live.com
Mon Sep 21 23:49:36 CEST 2015


Hi,
I am having a blast with Gecode! I have this small system to demonstrate 
something I want to improve in my code:

e[0] == v[0]
e[2] == v[1]
e[4] == v[2]
v[0] >= 1
v[1] + v[0] >= 2
v[2] + v[1] >= 1
v[2] >= 1
v[0] + v[1] + v[2] == 5
e[4] + e[2] + e[0] == b[0]
e[5] + e[2] + e[0] == b[3]

This gives me:
b{[2..5], [1..5], [1..5], [1..5], [0..5], [0..5]} v{[1..4], [0..3], [1..4]}

So the code doesn't see that
e[4] + e[2] + e[0] == b[0]
e[0] == v[0]
e[2] == v[1]
e[4] == v[2]
v[0] + v[1] + v[2] == 5

means that b[0] == 5.

A more complicated case is b[3] must be >= 2.
Is the level of indirection (v -> e -> b) the problem or recognizing an 
inequality is common to two expressions? I am guessing it's the second case.
Is there a way to do this differently to get the better result?
Thanks.
Neill.



More information about the users mailing list