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
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
Motivations
to improve “back” propagation
when solving Optimization Problems
in the CP Framework
2 August, 2000 3
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
• 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
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
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)
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
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
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
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
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
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
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)
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))
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
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
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
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
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
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
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)
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
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
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)
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
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
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