Hi,
This is not really question specific to gecode, but since there are 
presumably a lot of constraint-savvy people on this list, I'll ask anyway:

I have a finite set variable X, with domain {0..N-1} (though I could 
replace it by an array of booleans if that turns out to be more 
convenient). Every element i in the domain of X has a certain weight, 
w(i) (which is in the range 0..K; K is typically small). I want to post 
the constraint

Y = min_{i in X} w(i)  if X is non-empty
     0                  if X is empty.

Y is used in an expression that is minimised, so upper-bounding it 
(which would be simple) is not enough. The best I've been able to come 
up with is to write something like

(i in X) & (forall j s.t. w(j) < w(i) : not(j in X)) -> (Y = w(i)).

Does anyone know of a better way to formulate it?

Thanks,
                        /[EMAIL PROTECTED]

_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to