Académique Documents
Professionnel Documents
Culture Documents
Pierre Lopez
MOGISA
LAAS-CNRS, Toulouse
France
Given:
– a set of n tasks, a set of m resources
(2)
Determine:
where the tasks are located in time ?
(4) A B
(5)
– start-times (1) and
(1) (3) time
– durations (2) or finish-times (3)
how resources are allocated to the tasks ?
– identity and intensity (4)
– sequencing (5) (e.g., A B)
Notations
stk
estk lftk
pk
P. Lopez - April 2009 5
Scheduling Problems
Scheduling with disjunctive resources
– Shop|processors scheduling
one-machine
1 2 3
m parallel machines
m dedicated machines
S 1 2 3 E
– Timetabling 1 2 3
A 33 flow-shop problem
time
Preemptive/non preemptive
?
scheduling
Full-manual is unreasonable
– In front of too many items to manage
– Exceed cognitive capacities of humans, especially for
decision-making under stress
– Mistakes are unavoidable
– Dynamic environment implies painful re-computing
Heuristics
– suited to the structure of the problem at hand, so as to find a solution of acceptable
quality in a computation time as small as possible
– dispatching rules
e.g.: Shortest Processing Time first (SPT)
initial constraints
Constraint Propagation
Operations Research
– tree search solving procedures
– lower and upper bounds for optimal solutions
– propagation rules for resource constraints
initial constraints
Constraint propagation
A constraint
– is a logic expression linking decision variables, each of them taking its
values in a domain
examples: x < y ; A B ; Z {white, black} ; + + = 180
– involves a restriction on the values the variables can take simultaneously
L'agence désire connaître les différentes possibilités qui s'offrent à elle, sachant
qu'elle doit fournir à ses guides les devises en cours dans les pays visités, et que
chaque guide doit bien évidemment en pratiquer la langue.
Euro
Chili
Santiago
Euro
Chili
Santiago
domains (D)
– defined by the limit times Dk = [ estk , lftk – pk ]
(release dates, due dates)
constraints (C)
– routes job j: j1 j2, (j1,j2) Oj and j2 successor of j1
– time lags SS-SF-FS-FF
– resources with limited capacity (disjunctive/cumulative)
machine i: a b, (a,b) Oi
criteria
– minimization of the makespan
– minimization of the weighted number of late jobs
– minimization of the maximum tardiness…
Applications
– Task Scheduling, Resource Allocation
– Temporal / Motion Planning
– Configuration, Design problems
– Transportation, Network optimization, Timetabling
– Biology, Electronics, Music, …
Types of constraints
– qualitative (i before j) / quantitative (start(i) < 8)
– linear (x+y = 3) / non-linear (x*z 5)
– unary (x {A,B,C}) / binary / n-ary ( xi [5..13])
– hard constraints (restrictions), side constraints, soft constraints
(preferences)
Over-constrained problems, Max-CSP
– uncertain, conditional, …
Types of problems
– homogeneous / mixed
Mixer
Vessel Agitator
Is a CSP consistent?
satisfiability …
NP-complete
constraint propagation methods
P1 P2 P3 P4
X1
X1 v1 X1 v2
X1 v3
X4 X4 X4
X3
fail
X2
fail fail
LDS
[Harvey&Ginsberg, 95]
ILDS
[Korf, 96]
1 2 3 4 5 6 7 8 1 1
4 3 2 2
7 6 5 3 4
8 5 6 7 8
In scheduling
– a pb b pa
– a pS S pa
– a pS S pa
– …
prospective
retrospective
backward checking forward checking partial look future full look future instantiated variable
(MAC) Non-instantiated variable
Current instantiation
d'(x1) x1
d(x1)
– detection of a global inconsistency
P. Lopez - April 2009 43
Example of propagation (1)
Initial CSP Propagation 12
45
12345
Dx= Dy= Dz= Dw={1,2,3,4,5} 12345
C2
C1: x + 3 y
C1 12
C2: z = 2 * x 45
C3: w = x * y 2 4
x 12345 12345
y 12345
z 12345 C3
w 12345 1
45
2 4
45
a constraint C2
is non- 1
directional 45
2
45
v1 v2 v3
C2
1 1 v2 > v3 1
– Filtering C1
v1 = v2
2 2 2
v1 v2 v3
C2
1 1 v2 v3 1
– Non-filtering C1
v1 = v2
2 2 2
v1 v2 v3
C2
1 1 v2 > v3 1
– Inconsistency C1
v1 = v2
2 2 2
R,G
Arc-Consistency
2 9
3 4 5 10 11 12
6 7 8
2 4
– 4-Queens 1
2 3
R,G
R,G R,G,B
Based on matching theory over bipartite graphs
Others: diffn, cumulative, sequence, reservoir
P. Lopez - April 2009 52
Application of Constraint Propagation
Before any resolution
– to check the consistency of the problem
– to restrict the search space for a solving procedure
During solving: to prune the search tree
– which level of constraint propagation ?
– on which variables ?
on not-yet instantiated variables connected with an instantiated one
on all not-yet instantiated variables
tradeoff quality vs. CPU time
Efficiency of Constraint Propagation depends on the type of
constraints
– Path-consistency is complete for Simple Temporal Problems
(constraint 1 simple interval)
– CPLEX
delivers high-performance optimisers for solving linear, mixed-integer and
quadratic programming problems in mission-critical resource allocation
applications
– CP Optimizer
uses domain reduction and constraint propagation to efficiently solve
problems that are highly combinatorial with highly logical
content—problems that are usually difficult or impossible to represent with
linear expressions
© ILOG
Optimize/Solve block
– Problem specifications (CSP or optimization problem)
[Search block]
– How the search is to be conducted
// Data
int n=... ;
// chessboard size from data files
range Position = 1..n ;
// interval of values
// Variable
dvar int reine[Position] ;
// one queen per row assigned to a column
// Solving
subject to
{
forall(i,j in Position: j > i)
// exploration with symmetry breaking
{
abs(reine[j] - reine[i]) != (j - i) ;
// not in same diagonal
reine[i] != reine [j] ;
// not in same column
} ;
} ;
// Data
int n=… ;
int p[1..n]=… ;
int d[1..n]=… ;
float w[1..n]=… ;
// Decision variables
dvar int+ C[j in 1..n] in 0..sum(i in 1..n) p[i] ;
dvar int+ s[j in 1..n] in 0..sum(j in 1..n) p[j] ;
// Objective function
minimize
sum(j in 1..n) w[j]*maxl(0,C[j]-d[j])
// Constraints
subject to{
forall(j in 1..n){
C[j]-s[j]==p[j] ;
forall(k in 1..n: k>j) (C[j] <= s[k]) || (C[k] <= s[j]) ;
} ;
} ;
// Data
int n=… ;
int p[1..n]=… ;
int d[1..n]=… ;
float w[1..n]=… ;
// Decision variables
dvar int+ C[j in 1..n] in 0..sum(i in 1..n) p[i] ;
dvar int+ position[j in 1..n] in 1..n ;
// Objective function
minimize
sum(j in 1..n) w[j]*maxl(0,C[j]-d[j])
// Constraints
subject to{
forall(j,k in 1..n: k>j) position[j] != position[k] ;
forall(j,k in 1..n: j!=k) position[j] > position[k] => C[k] <= C[j]-p[j];
forall(j in 1..n) position[j] == 1 => C[j] == p[j] ;
} ;
// Data
int n=… ;
int p[1..n]=… ;
int d[1..n]=… ;
float w[1..n]=… ;
// Decision variables
dvar int+ C[j in 1..n] in 0..sum(i in 1..n) p[i] ;
dvar int+ position[j in 1..n] in 1..n ;
// Objective function
minimize
sum(j in 1..n) w[j]*maxl(0,C[j]-d[j])
// Constraints
subject to{
allDifferent(position) ;
forall(j,k in 1..n: j!=k) position[j] > position[k] => C[k] <= C[j]-p[j] ;
forall(j in 1..n) position[j] == 1 => C[j] == p[j] ;
} ;
// Data
int n=… ;
int p[1..n]=… ;
int d[1..n]=… ;
float w[1..n]=… ;
// Decision variables
dvar int+ C[j in 1..n] in 0..sum(i in 1..n) p[i] ;
dvar int+ position[j in 1..n] in 1..n ;
// Objective function
minimize
sum(j in 1..n) w[j]*maxl(0,C[j]-d[j])
// Constraints
subject to{
forall(j in 1..n) position[j] == 1 => C[j] == p[j] ;
alldifferent(position) ;
forall(j,k in 1..n: j!=k){
position[j] > position[k] => C[k] <= C[j]-p[j] ;
position[j] == position[k]+1 => C[k] == C[j]-p[j] ;
} ;
} ;
// Data
int n=… ;
int p[1..n]=… ;
int d[1..n]=… ;
float w[1..n]=… ;
// Decision variables
dvar int+ C[j in 1..n] in 0..sum(i in 1..n) p[i] ;
dvar int+ position[j in 1..n] in 1..n ;
// Objective function
minimize
sum(j in 1..n) w[j]*maxl(0,C[j]-d[j])
// Constraints
subject to{
forall(j in 1..n) position[j] == 1 => C[j] == p[j] ;
alldifferent(position) ;
forall(j,k in 1..n: j!=k){
position[j] > position[k] <=> C[k] <= C[j]-p[j] ;
position[j] == position[k]+1 <=> C[k] == C[j]-p[j] ;
} ;
// Job numbers in non-decreasing processing times order
forall(j in 1..n){
forall(k in 1..n){
position[j] == k && j<=k => C[j] >= sum(l in 1..k) p[l] ;
position[j] == k && j>k => C[j] >= p[j]+sum(l in 1..k-1) p[l] ;
} ;
} ;
} ;
Decision-aid
limitation of possible actions, explicitation of available freedom
degrees, characterization of sets of feasible solutions
reactive behavior (based on dynamic CSPs) suited to the model
evolution
practical importance of side constraints not always integrated in
the initial formulation because not easily formalizable, too much
context-dependent…
adding a constraint put in question the solutions but
conservation of deductions (constraints additivity / incremental
nature)
removing a constraint put in question the deductions obtained
from the propagation but conservation of solutions
Operations Research
– tree search solving procedures
– lower and upper bounds for optimal solutions
– propagation rules for resource constraints
Solving procedure
– truncated backtrack: heuristics for backjumping and
truncating
(M ,[5,7]) (M ,[8,14])
job 1 1 (M ,[5,10]) 4
(M ,[9,12]) 3 (M ,[3,6])
2 1
(M ,[6,10]) (M ,[3,7])
job 2 1 2 (M ,[2,4])
(M ,[2,4]) (M ,[5,10]) 3
2 4
P. Lopez - April 2009 81
Constraints in scheduling
pi
cumulative
DAG
allocation
resource 1
?
? resource 2
task i
? resource 3
P. Lopez - April 2009 82
Propagation of time constraints
task 3
1. Elimination rule:
• lftj - esti < pi + pj i not before j task 2
3. Propagation task 2
task 1
t
– Conjunctive precedences
ascending/descending sets
EFF/LSL
t1 t2
Global operations
– decision refutation
by simple propagation on the global problem
– shaving
– singleton arc-consistency
AC(X, D, C)
for x X and for v Dx
xv sti [esti, ], < lfti-pi
AC(X, D, C {x v})
if inconsistency
C C {¬ (x v)} sti [+1, lfti-pi] (i.e., esti +1)
AC(X, D, C)
L. Péridy (1996)
Toàn Phan Huy (2000)
P. Torres & P. Lopez (2000)
+ proof of optimality and optimal solution of FT10 in 1 node
+ improving of best known lower bounds on very large instances (SWV,
YN)
+ reduction of the number of nodes in a factor up to 10000…
+ reduction of CPU time in a factor up to 4
+ optimal solving of open shop instances (Hurink, Taillard)
But…
– can also induce a very important increasing of CPU time
Tk Pk
k
jpi
iTk, jPk, AND Mj Mj \ {k}
ipj
Logical constraint (A.start > B.end) (B.start > A.end) A.start – B.end + xAB.bigM 0
B.start – A.end + (1 – xAB).bigM 0
OFs
pano
Panoplie en cours
de construction
Panoplie + P1 (Pano,P1)
Panoplie + P2
(Pano,P2) >> (Pano,P1)
– Précédences conjonctives
Ensembles ascendants/descendants
EFF/LSL
tangage
roulis
Mars
– Netlander
4 sondes martiennes, 1 orbiteur relais
expériences diverses (études géophysique et météorologique)
• une dizaine d’instruments par sonde
• fonctionnement indépendant ou en réseau
– Optimisation des boucles de programmation
– Planif. optim. des télécoms sondes d'exploration-orbiteur (optimisation)
P. Lopez - April 2009 – Planif. des expériences sur un horizon donné (aide à la décision) 105
Netlander : Boucles de programmation
Sonde martienne exécution du plan de travail ...
fenêtres de
visibilité
orbiteur/sonde
fenêtres de
visibilité
Terre/orbiteur
scientifiques
scientifiques
P. Lopez - April 2009 106
Netlander : Modèle de
communications orbiteur/sondes
Programme Linéaire en Nombres Entiers
Xs,t = 1 si l’orbiteur communique avec la sonde s au pas de temps t, 0 sinon
(s=1..4, t=1..T)
Max s,t Xs,t
T
s.c.
Xs,t = 0 t Is ,s=1..4
s Xs,t 1 t=1..T
Is ensemble des pas
de temps t auxquels la sonde s ne
t+dmin “voit” pas l’orbiteur
=t+1 Xs, dmin.(Xs,t+1-Xs,t ) t=1..(T-dmin), s=1..4
Xs,t Xs,t-1 à chaque pas de temps t, l’orbiteur communique
t=(T-dmin+1)..T, s=1..4 avec au
plus une sonde
t+dr-1
=t+1 Xs, dr.(1-Xs,t-1+Xs,t ) t=2..(T-dr+1), s=1..4
j +1
t=ji i s Xs,t D1 i=1..J-1
li+1
t=li s Xs,t D2(li,li+1) i=1..L-1
ki+1
t=ki Xs,t D3s(ki,ki+1) i=1..(Ks-1), s=1..4
– expériences sélectionnées E Ec ; E = E1 E2
– iE1 : sti et fti instanciées ; iE2 : sti et fti non instanciées
– Si E = E1, alors un plan de travail est défini
NRJ
• Consommation des
d’une
ressources
expérience
parpar
intervalle
intervalle
de de
temps
temps
: :
expériences de E1 : évaluation de la consommation exacte
expériences de E2 : encadrement par les consommations obligatoire
minimale
et maximale
P. Lopez - April 2009 110
Mode de renouvellement de la MdM d’une sonde
Ressource consommable et renouvelable
– ressource doublement contrainte [Blazewicz et al. 01]
– évaluation du processus de renouvellement
M1
m
M0 co
M2
m
co
temps
fc0
fc
0
sc1 fcfc
1
1
sc2 fc
fc2
2
4
st4 ft4
fci fci+1 temps
Mi
Mi+1 Csup
fci,fci+1
Mi+1 Cinf
temps
P. Lopez - April 2009 113
Exemple de planification
2 Ordonnancement
st2 ft2 partiel
3
4
st4 ft4
fcj fcj+1 temps
Mj
Mj+1 Csup
Mj+1 Cinf
Mj+1 CC
Cinfinf
inf
temps
1
st1 ft1
2
st2 ft2
3
st3 ft3
4
st4 ft4
fcj fcj+1 temps
Mj
temps