DM841 - Heuristics and Constraint Programming for Discrete Optimization
Exercise Sheet [pdf format]



Exercise 1

Let V = {{x, y, z} and D(x)={3,4,5}, D(y)={0,1,2,3}, D(z)={1,5}}. Define one or more propagators implementing the constraint xy . Compute the propagator on the constraint store defined. Is the propagator strong idempotent? Is it weak idempotent?



Exercise 2

Define a propagator for x+y=d and then for ax+by=d. Finally, generalize it to the linear equality ∑ai xi = d.



Exercise 3 Usefulness of Weak Idempotency

Assume V = {x, y} and D(x)=[0 .. 3], D(y)= [0 .. 5] Consider the constraint 3x = 2y and the propagator p32

p32 (D)(x) = D(x) ⋂ {⌈(2 minD(y))/3⌉ ,…, ⌊(2 maxD(y))/3⌋}
p32 (D)(y) = D(y) ⋂ {⌈(3 minD(x))/2⌉ , … , ⌊(3 maxD(x))/2⌋}

Apply the propagator three times and state whether the propagator is strong idempotent. If it is not is there a constraint store for which it is weak idempotent?



Exercise 4

In Chapter 22 of the Gecode manual, there is a Gecode implementation of the propagator for x < y. How would you implement a propagator for max(x,y) = z. (You should first read Chapter 22 of the manual. You do not need to effectively implement it but have clear how you would do it.)



Exercise 5

The element constraint models the following very common situation: we have to decide which among four goods to buy; for each good we have a different price; how to propagate the price while the variable is not yet assigned a good?