Re: [gecode-users] Clockwise constraint

2008-06-04 Thread Guido Tack
Malcolm Ryan wote: > On 03/06/2008, at 7:45 PM, Guido Tack wrote: > >> The problem is here: testing B.in(b) is linear time, so it's just as >> expensive as finding a new b. > > Ah. Is there a way to iterate through the elements of B's domain in > order in time proportional to the number of element

Re: [gecode-users] Clockwise constraint

2008-06-03 Thread Malcolm Ryan
Hmm, I really don't think I understand your code well enough to do this properly. I'm trying to implement a reified A < B < C operator, but I'm really lost. Malcolm ___ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listi

Re: [gecode-users] Clockwise constraint

2008-06-03 Thread Malcolm Ryan
On 03/06/2008, at 7:45 PM, Guido Tack wrote: > Ok, great. If you need help with writing the propagator, or with > interfacing it to Java, let us know! I'd start by looking at the > propagate function of ReEqDom in gecode/int/rel/eq.icc for an > example of a C++ reified propagator. Eek. I

Re: [gecode-users] Clockwise constraint

2008-06-03 Thread Malcolm Ryan
On 03/06/2008, at 7:45 PM, Guido Tack wrote: > The problem is here: testing B.in(b) is linear time, so it's just as > expensive as finding a new b. Ah. Is there a way to iterate through the elements of B's domain in order in time proportional to the number of elements? Malcolm

Re: [gecode-users] Clockwise constraint

2008-06-03 Thread Guido Tack
Malcolm Ryan wrote: > On 03/06/2008, at 6:40 PM, Guido Tack wrote: >> >>> If we kept the smallest value of b >>> between propagations the amortised cost of the computation could be >>> small. >> >> That wouldn't help, because you cannot start checking for values >> starting from that previous smal

Re: [gecode-users] Clockwise constraint

2008-06-03 Thread Malcolm Ryan
On 03/06/2008, at 6:40 PM, Guido Tack wrote: > >> If we kept the smallest value of b >> between propagations the amortised cost of the computation could be >> small. > > That wouldn't help, because you cannot start checking for values > starting from that previous smallest value. Why not? Most

Re: [gecode-users] Clockwise constraint

2008-06-03 Thread Guido Tack
Malcolm Ryan wrote: > Hrm, it seems that the extensional version is going to be inordinately > large. How hard would it be to write a propagator for this specific > constraint X = (A < B < C)? > > If X is known, it can simply devolve into atomic constraints. > If X is unknown, it would just need t

[gecode-users] Clockwise constraint

2008-06-02 Thread Malcolm Ryan
Hrm, it seems that the extensional version is going to be inordinately large. How hard would it be to write a propagator for this specific constraint X = (A < B < C)? If X is known, it can simply devolve into atomic constraints. If X is unknown, it would just need to check that there exists b

Re: [gecode-users] Clockwise constraint

2008-06-02 Thread Guido Tack
Malcolm Ryan wrote: > On 02/06/2008, at 5:18 PM, Guido Tack wrote: >> >> Oh, I somehow didn't see that it's always ternary! In that case you >> might really want to try the extensional constraint. Just implement >> a generator that lists all allowed tuples. > > Nice idea, but really not viable.

Re: [gecode-users] Clockwise constraint

2008-06-02 Thread Malcolm Ryan
On 02/06/2008, at 5:18 PM, Guido Tack wrote: > > Oh, I somehow didn't see that it's always ternary! In that case you > might really want to try the extensional constraint. Just implement > a generator that lists all allowed tuples. Nice idea, but really not viable. In practice the domains ar

Re: [gecode-users] Clockwise constraint

2008-06-02 Thread Guido Tack
Malcolm Ryan wrote: > What I need is a reified version of the pairwise rel(). Then I could > say: > > a < c --> a < b < c > b < a --> b < c < a > c < b --> c < a < b > > Since there is no value of 'a' that satisfies c < a < b, it would have > to deduce that b < c. > > Representing this as (c < a)

Re: [gecode-users] Clockwise constraint

2008-06-02 Thread Malcolm Ryan
What I need is a reified version of the pairwise rel(). Then I could say: a < c --> a < b < c b < a --> b < c < a c < b --> c < a < b Since there is no value of 'a' that satisfies c < a < b, it would have to deduce that b < c. Representing this as (c < a) and (a < b) is not good enough, as t

Re: [gecode-users] Clockwise constraint

2008-06-02 Thread Guido Tack
Malcolm Ryan wrote: I want to make a constraint which represents the order of three values around a ring. Eg: if we have a,b,c \in {1,2,3,4} then I want to represent the constraint: clockwise(a,b,c) == (a < b < c) or (b < c < a) or (c < a < b) I can construct this directly using BExprs, but t

[gecode-users] Clockwise constraint

2008-06-01 Thread Malcolm Ryan
I want to make a constraint which represents the order of three values around a ring. Eg: if we have a,b,c \in {1,2,3,4} then I want to represent the constraint: clockwise(a,b,c) == (a < b < c) or (b < c < a) or (c < a < b) I can construct this directly using BExprs, but the use of 'or' mean