jean-charles regin michel rueher [email protected] [email protected] ilog sophia antipolis université de...

28
Jean-Charles REGIN Michel RUEHER [email protected] [email protected] ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining a sum constraint and binary inequalities 2 August, 2000 1

Post on 21-Dec-2015

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Jean-Charles REGIN Michel RUEHER

[email protected] [email protected]

ILOG Sophia Antipolis Université de Nice – Sophia Antipolis

A global constraint combining a sum constraint and binary

inequalities

2 August, 2000 1

Page 2: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Global constraint IS

Combination of:

A sum constraint: y=xi

andbinary Inequalities: xi xj + cij

Example:

x1 + x2 = y & x1 x2 + 1

2 August, 2000 2

Page 3: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Motivations

to improve “back” propagation

when solving Optimization Problems

in the CP Framework

2 August, 2000 3

Page 4: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Optimization Problems

• Objective function : a sum z=xi

• CP Framework

solving a sequence of decision problems (B&B) where z < z* (each solution must be better than the previous one) Local consistency algorithms on each constraintpoorly propagate (not very effective)

Global constraint IS :to improve the back propagation when the

bounds of z are modified

2 August, 2000 4

Page 5: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

• Minimizing mean flow time

F=1/n j=1…n (Cj-rj) • Minimizing tardiness

D=1/n j=1…n Dj Where • Dj=max(Cj-dj,0)

• Cj , rj , dj : completion time, ready time, and duration of task Tj

• Difference constraints : precedence/distance constraints between the tasks

2 August, 2000 5

Applications in deterministic scheduling problems

Page 6: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

D(x1)=[0,6] D(x2)=[1,7] D(y)=[1,13]

C1: x1 + x2 =y C2: x1 x2 - 1

• This system is arc consistent : each value belongs to a solution of every constraint

• If the lower bound of y is set to 6 this system remains arc consistent

no pruning can be achieved

2 August, 2000 6

Example 1

Page 7: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

D(x1)=[0,6] D(x2)=[1,7] D(y)=[6,13]

C1: x1 + x2 =y C2: x1 x2 - 1

However, when x2 belongs to [1,3]

C1 cannot be satisfied

Global constraint IS will delete [1,3] from the domain D(x2)

2 August, 2000 7

Example 1 (continued)

Page 8: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Constraint Sum : y= j=1…n xj

Inequalities Ineq : {xj - xj cji (i,j [1,n])}

Domain constraints Dom : {lj xj uj (i [1,n])}

Global constraint IS = {Sum} Dom Ineq

Algorithm (scheme):

If a bound of x is modified Filtering Dom Ineq by interval consistency

If a bound of some y is modified Filtering Sum by interval consistency

Updating the bounds of every xj with respect to IS

2 August, 2000 8

Summary of our framework

Page 9: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Filtering Sum by interval consistency :

0(n)

Filtering Ineq by interval consistency :

0(mn)

Filtering IS by interval consistency :

O(n(m + nlogn))

2 August, 2000 9

Summary of our frameworkContribution

Page 10: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Sum constraint

y=xi is interval consistent iff:

(1) min(y) j=1…n min(xj)

(2) max(y) j=1…n max(xj)

(3) xi : min(xi) min(y) - j i max(xj)

(4) xi : max(xi) max(y) - j i min(xj)

2 August, 2000 10

Page 11: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Sum constraint (continued)

Checking interval consistency of y=xi is in 0(n)

(3) xi : min(xi) min(y) - j i max(xj)

j i max(xj)= j=1…n max(xj)- max(xi)

2 August, 2000 11

Page 12: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Binary inequalities

• Filtering by AC complexity depends on the size of the domains

• Filtering by interval consistency can be achieved in O(mn) simple temporal CSP (Dechter et al)

2 August, 2000 12

Page 13: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Simple Temporal CSP

Shortest path : (s,xj) (s,xi)

+ c (xi,xj)

Distance Graph G=(N,E)N: source node s with D(s) ={0}

+ one node for each variableE: xi xj + cji arc (xj, xi) with cost cji D(x) =[minx, maxx]

s x – min(x) arc (x,s) with cost -min(x)

x s + max(x) arc (s,x) with cost max(x)

2 August, 2000 13

Page 14: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Example

D(xi) =[1,6]D(xj) =[2,5]

xj xi - 3

s

i

j

-16

5

-2

-3

2 August, 2000 14

Distance graph (continued)

Page 15: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

xi is interval consistant if

D(xi) =[-(xi,s) , (s,xi )]

Example

D(xi) =[1 5,6]D(xj) =[2,5 3]xj xi - 3

s

i

j

-1 -5

65 3

-2

-3

2 August, 2000 15

Distance graph (continued)

Computing shortest path : 0(nm)

but after ONE computation we can use reduced costs 0(m+nlog(n))

Page 16: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

IS constraint (Sum & binary Inequalities)

(3) xi: min(xi) min(y) - ji max (xj)

is too weak to enforce interval consistency on IS

Example:D(x1)=[0,6] D(x2)=[1,7] D(y)=[6,13]

C1: x1 + x2 =y C2: x1 x2 - 1

min(x2) min(y) - max (x1) = 0

although IS cannot be satisfied when x1 3

2 August, 2000 16

Page 17: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

IS constraint (Sum & binary Inequalities)

Interval consistent iff:• min(y) i=1…n min(xi)

• max(y) i=1…n max(xi)

(3b) xi: min(xi) min(y)

- ji max xi min(xi) (xj)

(4b) xi: max(xi) max(y)

- ji min xi max(xi) (xj)

max xi min(xi) (xj) : maximum value of D(xj)

which satisfies Ineq when xi is set to min(xi)

2 August, 2000 17

Page 18: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

IS constraint (Sum & binary Inequalities)

(3b) xi: min(xi) min(y)

- ji max xi min(xi) (xj)

Example:D(x1)=[0,6] D(x2)=[1,7] D(y)=[6,13]

C1: x1 + x2 =y C2: x1 x2 - 1

min(x2) min(y) - max x2 min(x2) (x1) = 4

2 August, 2000 18

Page 19: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

How to compute min(xi) ?

(3b) xi: min(xi) min(y)

- ji max xi min(xi) (xj)

xi = min(y) - j i max xi xi (xj)

2 August, 2000 19

Page 20: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing xi

max (xj)=min((s,xj), xi +  ’(xi,xj)

) (1) xi xi

where  ’(xi,xj)) is the shortest path from xi to xj in G-{s}

and thus

xi = min(y) - j i min((s,xj), xi +  ’(xi,xj)

) (2)

2 August, 2000 20

max (xj) depends only on the

upper-bounds of the variables xk that belong to a shortest path from s to xj

Page 21: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing min(xi) (continued) xi = min(y) - j i min((s,xj)

, xi +  ’(xi,xj)) (2)

2 August, 2000 21

algorithm(1) Computing  ’(xi,xj)

) for all j i and be (s,xj)- (xi,xj)

=j

(2) L sorted sorted list of j

S {xj : j 0} S is the set of the xj’s for which

min((s,xj), xi +  ’(xi,xj)

) = (s,xj)

Loop xi = min(y) - j i min((s,xj)

, xi +  ’(xi,xj))

S S {xj : j xi }

until of S does no more change

Page 22: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing min(xi) (continued) 2 August, 2000 22

(xi,xj) can be computed on the graph of

reduced costs of G-{s} in O(nlogn) Identifying the shortest paths from xi to xj which go

through s iteration step : O(nlogn)

Filtering of IS by interval consistency :

O(n(m + nlogn))

(no propagation step is required when min(xi) is increased)

Page 23: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Extensions

Works also for ixi=y

(3b) xi 1 (min(y) - ji j (xi,xj))

|X|

Works also if all the variables do not occur in the sum constraint

2 August, 2000 23

Page 24: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Conclusion

An original combination and an efficient algorithm for a new global constraint

to improve propagation

in optimization problems

Further work : implementation &

experimentation

2 August, 2000 24

Page 25: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing min(xi) (continued) xi 1 (min(y) - ji (xi,xj)

)

|X|

2 August, 2000 25

(xi,xj) can be computed on the graph of

reduced costs of G-{s} Identifying the shortest paths from xi to xj which go

through s iteration step : O(nlogn)

Filtering of IS by interval consistency :

O(n(m + nlogn))

(no propagation step is required when min(xi) is increased)

Page 26: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing xi

max (xj)=min((s,xj), xi + (xi,xj)

) (1)xi xi

and thus

max (xj) xi + (xi,xj) (2)

xi xi

and

xi 1 (min(y) - ji (xi,xj)) (3)

|X|

2 August, 2000 26

max (xj) depends only on the

upper-bounds of the variables xk that belong to a shortest path from s to xj

Page 27: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing min(xi) (continued)max (xj)= xi + (xi,xj)

(2)xi min(xi)

2 August, 2000 27

Proof (scheme)Two cases :1. xi belongs to a shortest path from s to xj

when xi is set to the value of xi we are searching for

max xi min(xi)(xj)=xi + (xi,xj)

2. xi does not belong to a shortest from s to xj

(whatever value is assigned to xi)

xi =min(xi) =- (xi,s) max xi min(xi)(xj)= (s,xj)

=xi + (xi,s) + (s,xj)

and s belongs to a shortest path from s to xj

Page 28: Jean-Charles REGIN Michel RUEHER regin@ilog.fr rueher@essi.fr ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining

Computing min(xi) (improvement)

3b) requires

xi = 1 (min(y) - j i (xi,xj))

|X|

2 August, 2000 28

• (xi,xj) can be approximated by its lower bound

max(xj)-max(xi)

• Computation can be stopped earlier