Vous êtes sur la page 1sur 117

Constraint Programming

Pierre Lopez
MOGISA
LAAS-CNRS, Toulouse
France

P. Lopez - April 2009 1


Outline of the course
 Objectives: Overview of basis concepts related to constraint reasoning for
decision problems
propagation/satisfaction/programming
 Introduction: Combinatorial Optimization
Definition / Methods / Illustration on scheduling problems
 Constraint-based Problems and Models: CSPs
Definition / CP / CSP / Examples / Variants
 Underlying Methods for Constraint-based Models Processing
Tree Search / Constraint propagation
 Constraint Programming Systems
Classification / ILOG OPL / Scheduling example / Benefits/Drawbacks
 CSP for time and resource constraints
Propagation of time constraints / of resource constraints / energetic reasoning
 Applications

P. Lopez - April 2009 2


Introduction

P. Lopez - June 2008 3


Framework:
Combinatorial Optimization Problems
 Combinatorial Optimization Problem = COP
– criterion (criteria) to optimize
– under numerous, various constraints
 Industrial examples
– Routing problems
– Network optimization (informatics, telecoms, space missions…)
– Project management
– Work organization in manufacturing
– Timetabling
– Configuration, design problems
 High complexity (NP-hard)
– Exponential growth (in the size of data)
of CPU time

P. Lopez - April 2009 4


Example of a COP: Scheduling Problem

 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

 Scheduling with cumulative resources


– renewable/non renewable
– doubly-constrained resources Manpower

time
 Preemptive/non preemptive
?
scheduling 

P. Lopez - April 2009 6


“Job-shop”: 10 jobs - 10 machines (FT10)

P. Lopez - April 2009 7


Solving a COP: Manual resolution

 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

 “Minimal” Decision Support Systems (DSS)


– Maintain, by consistency checking, a satisfiable set of
constraints
– Without any context-based knowledge
– All the constraints do not need to be modeled
– Getting free the human of maintaining the consistency, without
being unlikely to make errors

P. Lopez - April 2009 8


Human-System Cooperation for an adapted DSS
 Human and Technical System = 2 cognitive centers
 Decision distribution
– Static or dynamic (at Human’s initiative)
– Incomplete symmetry
 System: global maintenance of modeled constraints, off-context decision
 Human: integration of non-modeled constraints, context-based local decision
 Information sharing
– Human: knowledge and know-how (non-formal constraints)
– System: computation results display
 Decision support (System)
– Characterization of a set of feasible solutions
– State indicators
– Explanation policies in case of failure/wipe out
– Subproblem optimization
 Anticipating decisions
– Predictability on the result of an action (forecasting)
– Robust decisions to limit backtracks and renegotiation

P. Lopez - April 2009 9


Solving a COP: Exact methods
 Specific results
proper to each type of problem
e.g., Johnson’s algorithm for the F2 | prmu | Cmax
 Direct methods
– Mixed Integer Programming
+ Easy modeling; Efficient solvers; Optimal solution
 No information on the solution environment; CPU time consuming
 Tree-search procedures
– Chronological or Dynamic Backtracking
– Best-First Branch & Bound
– Truncated Procedures
 Limited Discrepancy Search
 Beam Search
 Branch & Greed
+ Exploration method
 CPU time consuming; Implementation

P. Lopez - April 2009 10


Solving a COP: Approximate methods

 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)

+ Easy implementation and Fast


 Approximate solution without performance guarantee
 Metaheuristics
– general framework of resolution
– unique solution
 constructive methods: greedy/myopic algorithms
 local search: Tabu search, simulated annealing
– population of solutions
 evolutionary methods: genetic algorithms, ACO
+ Fast and give good feasible solutions
 Approximate solution without performance guarantee; Settings

P. Lopez - April 2009 11


Paradigm of Constraint Programming (1)

new constraint (due to:


Human decision or
Subproblem Decision Making
optimization)

Problem Statement Problem Description (CSP)

initial constraints
Constraint Propagation

new constraint (due to: Model


evolution or Inference) and
propagation

P. Lopez - April 2009 12


Constraints: Historical View
 AI
– CSPs (picture processing): Montanari ’74, Waltz ’75, Freuder ’78
– ALICE: J.-L. Laurière ’76 (J. Pitrat)
 Scheduling: Constraint-Based Analysis
– Paris 6 University: J. Carlier ’75
– LAAS: J. Erschler, F. Roubellat, J.-P. Vernhes ’76
– CMU: M.S. Fox, S. Smith ’83
 Constraint Programming Systems (since 1985)
– CHIP, CLP(...), ECLiPSe, ILOG Solver, Oz, Prolog IV, …
 1996: Constraints: An International Journal (Ed. Freuder)
 Conferences: CP (’98) (& many satellite workshops) , CP-
AI-OR, Workshops IJCAI, AAAI, ECAI, ICAPS…
 2001: 4C (E. Freuder)

P. Lopez - April 2009 13


Some related books...
 Constraint Processing  Logic-based Methods for
R. Dechter Optimization
Morgan Kaufmann, 2003 J. Hooker
Wiley, 2000
 Foundations of Constraint
Satisfaction  The OPL Optimization
E. Tsang Programming Language
Academic Press, 1993 P. Van Hentenryck
MIT Press, 1999
 Intelligence artificielle et
informatique théorique  Constraint-based Scheduling
J.-M. Alliot & T. Schiex P. Baptiste, C. Le Pape, & W.
Cépaduès, 1993 (2nd ed. 2002) Nuijten
(in French) Kluwer, 2001

P. Lopez - April 2009 14


Constraint-based Problems and Models

P. Lopez - June 2008 15


Paradigm of Constraint Programming (2)

Constraint programming is based on:

 Constraint Satisfaction Problems


– local consistency rules for temporal constraints
– heuristic search strategies

 Operations Research
– tree search solving procedures
– lower and upper bounds for optimal solutions
– propagation rules for resource constraints

P. Lopez - April 2009 16


Paradigm of Constraint Programming (3)
new constraint (decision)
Search method

Problem statement Problem description (CSP)

initial constraints
Constraint propagation

new constraint (propagation)

 Clear separation between


– problem statement in terms of variables and constraints to be fulfilled
– logic deduction process over the constraints
– problem solving procedures (instantiation of variables)
P. Lopez - April 2009 17
Constraint Satisfaction Problem (1)

 Constraint Satisfaction Problem or CSP = (X,D,C)


– X finite set of variables
– D domains: finite set of values for each variable
– C finite set of constraints: relations over the set of
variables, of a given arity (arity  2  binary CSP)

 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

P. Lopez - April 2009 18


Constraint Satisfaction Problem (2)

 A solution is a set of instantiations (a tuple of values)…


– … which satisfies all the constraints (consistent)…

 Example in cryptoarithmetics: SEND + MORE = MONEY


> Sol=[S,E,N,D,M,O,R,Y],
domain([E,N,D,O,R,Y],0,9), domain([S,M],1,9),
1000*S + 100*E + 10*N + D +
1000*M + 100*O + 10*R + E #=
10000*M + 1000*O + 100*N + 10*E + Y,
all_different(Sol),
labeling(Sol).

> Sol = [9,5,6,7,1,0,8,2]


9567 + 1085 = 10652
P. Lopez - April 2009 19
Constraint Satisfaction Problem (3)
 n-queens problem
 To place n chess queens on a board with n  n squares so that these
queens do not threaten each other
 Example: 4-queens problem
– X={x1,x2,x3,x4} ;
– Di ={1,2,3,4} with i = 1..4 ;
– 2 queens cannot be on the same:
 column
 row
 diagonal

P. Lopez - April 2009 20


n-queens problem modeling
 1st version
 Queen i  row yi, column xi

 2nd version, clever


 exactly ONE queen per row

– Let xi be the column in which the queen of row i is placed


– i, 1  i  n : 1  xi  n
 i,j, 1  i,j  n , i < j : xi  xj not in the same column
 i,j, 1  i,j  n , i < j : |xi  xj|  j  i not in the same diagonal

 Non-linear constraints (disequality)

P. Lopez - April 2009 21


Exemple (P. David) : Enoncé
Une agence de voyage propose 5 destinations à ses clients : Paris, Londres,
Washington, New-York et Santiago du Chili, et dispose de 3 guides pour les
accompagner : Alice, Bernard et Claude, tels que :

– Alice souhaite se rendre à Paris ou New-York, mais est exclusivement


francophone ;
– Bernard connaît l'Anglais et le Français, mais refuse de se rendre à Santiago
(il accepte en revanche toutes les autres destinations) ;
– Claude ne parle que l'Espagnol, et n'envisage pas d'autre destination que
New-York.

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.

Hypothèse : on ne parle que l’Anglais à New-York.

P. Lopez - April 2009 22


Exemple : CSP à 5 variables et 5 contraintes
 Ensemble des variables  Les 5 relations associées
{ GUIDES, VILLES, PAYS, MONNAIES, rel GUIDES-VILLES
LANGUES } ; = { (A,Paris) , (A,New-York) , (B,Paris) ,
(B,Londres) , (B,Washington) , (B,New-York) ,
 Les cinq domaines associés (C,New-York) }
dom (GUIDES) = { Alice (A), Bernard (B), Claude rel GUIDES-LANGUES
(C) } = { (A,Français) , (B,Français) , (B,Anglais) ,
dom (VILLES) = { Paris, Londres, Washington, New- (C,Espagnol) }
York, Santiago } rel VILLES-PAYS
dom (PAYS) = { France, GB, USA, Chili} = { (Paris,France) , (Londres,GB) ,
dom (MONNAIES) = {, £, $, Pes} (Washington,USA) , (New-York,USA) ,
dom (LANGUES) = { Français, Anglais, Espagnol } (Santiago,Chili) }
rel PAYS-MONNAIES
 Ensemble des contraintes = { (France,) , (GB,£) , (USA,$) , (Chili,Pes) }
C = { cGUIDES-VILLES , cGUIDES-LANGUES , cVILLES-PAYS , rel PAYS-LANGUES
cPAYS-MONNAIES , cPAYS-LANGUES } = { (France,Français) , (GB,Anglais) ,
(USA,Anglais) , (Chili,Espagnol) }

P. Lopez - April 2009 23


Exemple : Représentation

Euro

Chili

Santiago

P. Lopez - April 2009 24


Exemple : Solutions

 5 solutions liées à des instanciations consistantes

– (A, Paris, France, , Français)


– (B, Paris, France, , Français)
– (B, Londres, GB, £, Anglais)
– (B, Washington, USA, $, Anglais)
– (B, New-York, USA, $, Anglais)

P. Lopez - April 2009 25


1 instanciation consistante

Euro

Chili

Santiago

P. Lopez - April 2009 26


Constraint Satisfaction Problem (4)
 Dealing with optimization:
COP = < {variables}, {constraints}, [criteria] >
a COP can be defined as an instance of a CSP  CSOP
A solution is a tuple of values…
– … which reaches the extremum of criteria (optimal)…

 The criterion is integrated as a constrained variable


criterion_expression < value_of_the_best_solution
(minimization problem)
 restart the resolution
 if an inconsistency arises, the latest found solution is optimal

P. Lopez - April 2009 27


CSP, COP: Example in scheduling
 decision variables (X)
– start times stk

 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…

P. Lopez - April 2009 28


Variants of CSP (1)

 Applications
– Task Scheduling, Resource Allocation
– Temporal / Motion Planning
– Configuration, Design problems
– Transportation, Network optimization, Timetabling
– Biology, Electronics, Music, …

P. Lopez - April 2009 29


Variants of CSP (2)
 Types of variables
– Boolean / discrete / numeric, set, active/inactive

 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

P. Lopez - April 2009 30


Product configuration

Mixer

Vessel Agitator

Cooler Condensor Engine Impeller Shaft

•Variables can be active or inactive


•Activation (conditional) constraints
cond(X1,…,Xn)  activate(Xj)
[Mittal&Falkenhainer, 90; Boi&Faltings, 03]

P. Lopez - April 2009 31


Underlying Methods for
Constraint-based Models Processing

P. Lopez - June 2008 32


Questions associated to a CSP

 Is a CSP consistent?
 satisfiability …
NP-complete
 constraint propagation methods

 What is a solution – feasible or optimal – of a CSP?


 satisfaction or optimization …
NP-hard in the general case
 tree search methods

P. Lopez - April 2009 33


Tree search for CSPs
 Natural way to decompose
P
v=1 v=2 v=3 v=4

P1 P2 P3 P4

 Tree depth limited by n, but size may be huge:


n i 
   D j  O(d n )

i= 0  j=1 

 Resolution: Depth-First Search


test and generate (Backtrack algorithm): check a constraint violation
after instantiation of all the variables inherent to the constraint

P. Lopez - April 2009 34


Backtrack Algorithm

X1
X1  v1 X1  v2
X1  v3
X4 X4 X4

X3
fail

X2
fail fail

Main drawback: exponential complexity


SOLUTIONS CSP of n variables, domains of cardinal d, m constraints:
dn terminal states, evaluation of mdn constraints: O(mdn)

P. Lopez - April 2009 35


Truncated Search Methods: LDS
 Principle of Limited Discrepancy Search (LDS) [Harvey &
Ginsberg 95]
– Binary tree
– Search Heuristic  initial path

• Bad choice in Heuristic


Not a solution Do a deviation (a discrepancy)
/ initial path

Count the number of times the heuristic is not followed


• Good heuristic
– Few discrepancies
– Good set of solutions for a small number of discrepancies
P. Lopez - April 2009 36
LDS: Principle
 Example: 3 binary variables
– Tree Expansion
 Left son  0 divergence
 Right son  1 divergence

P. Lopez - April 2009 37


LDS / ILDS / DDS / …

 M=0  M=1  M=2

LDS
[Harvey&Ginsberg, 95]

ILDS
[Korf, 96]

 ILDS less redundant than LDS

DDS Restrict discrepancies till a given depth in the iteration


[Walsh, 97]

P. Lopez - April 2009 38


DFS / LDS / DDS

DFS LDS DDS: Depth-bounded discrepancy search

1 2 3 4 5 6 7 8 1 1

4 3 2 2

7 6 5 3 4

8 5 6 7 8

P. Lopez - April 2009 39


Different ways for branching

 The previous way is:


– X  v1  X  v2  X  v3  …

 For binary trees:


– standard labeling: X = 1  X  1
– domain splitting: X < 3  X  3
– variable ordering: X < Y  X  Y

 In scheduling
– a pb  b pa
– a pS  S pa
– a pS  S pa
– …

P. Lopez - April 2009 40


Improving Backtrack algorithm

 Modification of the algorithm


– in order to detect, at a lower cost and as soon as possible, the
inconsistency of the current instantiation

 Definition of ordering heuristics


– order on the instantiation of
 Variables: e.g, first-fail (dom), most-constrained (dom/deg)
 Values: min_conflict (suppress the least number of values for not yet
instantiated variables)

 Deduction of the search space


– using properties of local consistency or filtering algorithms or constraint
propagation techniques)
– before (or during) the search for a solution

P. Lopez - April 2009 41


Retrospective vs. prospective schemes
in Backtrack
– retrospective scheme (backward checking): chronological or intelligent
backtracking, e.g.:
• backjumping (go back to the closest variable connected with a constraint to the
variable in conflict)
• nogoods recording (recording of a set of instantiations that cannot lead to any
solution; w.r.t. trashing phenomenon)
+ prospective scheme (look-ahead schemes): uses results of filtering
exploiting them during the search, e.g. FC or MAC
order of instantiations

prospective

retrospective

backward checking forward checking partial look future full look future instantiated variable
(MAC) Non-instantiated variable
Current instantiation

P. Lopez - April 2009 42


Constraint propagation
 Set of techniques allowing
– the consistency checking of a solution
– a consistency enforcing by filtering the values of the variables which do not
belong to any solution
 domain reduction  deduction of new
x2 constraints

d(x2) x=y yz


d'(x2) x xz z

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

P. Lopez - April 2009 44


Example of propagation (2)
 Initial CSP
Dx= Dy= Dz={1,2,3,…,10}
C1: x + 3  y
C2: y + 2 = z
C3: z = 2*x
 Propagation
C1: Dx = {1,…,7}, Dy = {4,…,10}
C2: Dy = {4,…,8}, Dz = {6,…,10}
C3: Dz = {6,8,10}, Dx = {3,4,5}
C1: Dy = {6,7,8}
C2: Dz = {8,10}
C3: Dx = {4,5}
C1: Dy = {7,8}
C2: z = 10
C3: x = 5
C1: y = 8
P. Lopez - April 2009 45
Arc-Consistency: the most used of
Constraint Propagation techniques
 Context: binary CSP
Pb=(X,D,C) with X={x}, D={Dx}, C={Cxx'}

 (x,y) arc-consistent AC-3 algorithm


iff for each value of L  {(i,j) | Cij  C}
Dx there exists a while L  
compatible value in remove pair (k,m) from L
Dy if Revise(k,m)
L  L  {(i,k) |  Cik  C, i  k, i  m}
 the value is supported
Revise(i,j): Boolean
modif  false
for v  Di
if  v'  Dj s.t. {i  v, j  v'} consistent
Di  Di – {v}
O(md3) modif  true
[O(md2) -optimal- for AC-4] return modif

P. Lopez - April 2009 46


Example of Arc-Consistency
inconsistent (filtered) instantiantion
 Order v1, v2, v3
arc-consistent instantiantion

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

P. Lopez - April 2009 47


Different levels of Constraint Propagation

R,G
   Arc-Consistency

R,G R,G R,G,B




 Path-Consistency  
R,G,B
 
R,G,B  R,G,B
Q
Q
 k-Consistency
Q

P. Lopez - April 2009 48


Backtrack: 3-queens problem
 Backward Checking

2 9

3 4 5 10 11 12

6 7 8

P. Lopez - April 2009 49


Backtrack: 3-queens problem
 Forward Checking

2 4

P. Lopez - April 2009 50


Backtrack: n-queens problem
 Forward Checking + Arc-Consistency

– 3-Queens 1 no solution for n = 3

– 4-Queens 1

2 3

P. Lopez - April 2009 51


Global constraints

 Capture a relation among a set of variables

 Ex: set of binary disequality constraints among all variables


X1  X2 , X1  X3 , …, Xk-1  Xk
all_different({X1,…,Xk})={(d1,…,dk)|i,ji,diDi,djdi}

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)

P. Lopez - April 2009 53


Constraint Programming Systems
(Tools for CSPs)

P. Lopez - June 2008 54


Constraint Programming Systems (1)
 You do not have to program all the previous techniques
from scratch!

 You can use existing constraint solvers (packages)…

 These packages provide:


– implementation of data structures for modeling variables’ domains and
constraints
– filtering algorithms for many constraints
– basic search strategies
– etc.

P. Lopez - April 2009 55


Constraint Programming Systems (2)

 Pioneer: Constraint Logic Programming


1982-90: Prolog II, CLP(R), CHIP, Prolog III

 [Fernandez & Hill, JAIR, 2000]: 2 types of systems:


– glass box (propagation scheme can be specified by the user)
 clp(FD), SICStus, IF/Prolog, CHR, gnuProlog
– black box (control of propagation is beyond the user)
 Mozart (Oz), ECLiPSe, ILOG ODM (Solver/Scheduler), B-Prolog

 CLAIRE, CHOCO, FaCiLe

P. Lopez - April 2009 56


Constraint Programming Systems (3)
 Others… see:
 Newsgroup: comp.constraints (FAQ)
 Roman Barták: http://kti.ms.mff.cuni.cz/~bartak/constraints/
 Distinction between each system
– Free / Commercial
– Glass box / Black box
– Object-Oriented Programming
– Syntax: Prolog, C++, Java, OCaml, …, own
– Kind of variables
– Kind of constraints
– Methods available to solve / to propagate
– Integration with OR packages (CPLEX, Xpress-MP, …)
– …

P. Lopez - April 2009 57


ILOG OPL: A complete set of engines and tools
 Engines

– Implementation of most powerful Combinatorial Optimisation /


Constraint Satisfaction Constraint / Scheduling techniques

– 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

P. Lopez - April 2009 58


ILOG OPL Development Studio: An overview

© ILOG

P. Lopez - April 2009 59


ILOG OPL: A complete set of engines and tools
 Tools
– OPL-CPLEX Development System
 development environment for building, debugging and tuning optimisation
models across the full range of planning and scheduling problems
 takes advantage of CPLEX's and CP Optimiser's advanced features
– Optimization Decision Manager (ODM)
 a specialized application development tool that helps users build and deploy
decision support applications
 perform "What-If?" analysis through scenario creation and comparison
 understand the optimized plan or schedule
 modify recommended plans and schedules
– Use recommendations as a starting point. Freeze part of a solution to resolve it,
or manually modify a plan or schedule
 work with Excel
– Import input data from Excel spreadsheets

P. Lopez - April 2009 60


© ILOG

P. Lopez - April 2009 61


© ILOG

P. Lopez - April 2009 62


An OPL program
 Declarations/Initializations block
– Data structures
– Intializing/reading data

 Optimize/Solve block
– Problem specifications (CSP or optimization problem)

 [Search block]
– How the search is to be conducted

P. Lopez - April 2009 63


n-queens problem in OPL
// N-QUEENS PROBLEM
using CP ;

// 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
} ;
} ;

P. Lopez - April 2009 64


1||wjTj scheduling problem in OPL
// SINGLE MACHINE WEIGHTED TARDINESS SCHEDULING - MODEL 1
using CP ;

// 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]) ;
} ;
} ;

P. Lopez - April 2009 65


1||wjTj scheduling problem in OPL
// SINGLE MACHINE WEIGHTED TARDINESS SCHEDULING - MODEL 2
using CP ;

// 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] ;
} ;

P. Lopez - April 2009 66


1||wjTj scheduling problem in OPL
// SINGLE MACHINE WEIGHTED TARDINESS SCHEDULING - MODEL 2’
using CP ;

// 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] ;
} ;

P. Lopez - April 2009 67


1||wjTj scheduling problem in OPL
// SINGLE MACHINE WEIGHTED TARDINESS SCHEDULING - MODEL 2’’
using CP ;

// 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] ;
} ;
} ;

P. Lopez - April 2009 68


1||wjTj scheduling problem in OPL
// SINGLE MACHINE WEIGHTED TARDINESS SCHEDULING - MODEL 2 revised (LB included)
using CP ;

// 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] ;
} ;
} ;
} ;

P. Lopez - April 2009 69


Model comparison for a given instance
1|n=7|wjTj

Model 1 Model 2 Model 2’ Model 2’’ Model 2


(start times (position (allDifferent) (adjacent revised
and Xor) variable) positions) (with LB)
Variables 14 14 14 14 14

Constraints 78 171 150 276 767

Branches 2.277 8.618 8.618 11.675 3.970

Fails 1.191 4.305 4.305 5.810 2.022

Nodes 1.087 4.314 4.314 5.866 1.949


(#br  #fa + 1)
CPU time (s) 0,06 0,20 0,20 0,34 0,15

P. Lopez - April 2009 70


Model comparison for a given instance
1|n=11|wjTj

Model 1 Model 2 Model 2’ Model 2’’ Model 2


(start times (position (allDifferent) (adjacent revised
and Xor) variable) positions) (with LB)
Variables 22 22 22 22 22

Constraints 188 421 366 696 1.907

Branches 2.201.956 106.437.984 106.437.984 50.859.787 949.664

Fails 1.100.409 53.212.220 53.212.220 25.427.845 474.424

Nodes 1.011.548 53.225.765 53.225.765 25.431.943 475.241


(#br  #fa + 1)
CPU time (s) 80,2 3.108,4 3.054,9 3.151,5 66,8

P. Lopez - April 2009 71


Why using Constraint-based framework ?

P. Lopez - June 2008 72


Benefits of Constraint-based framework (1)
 declarative nature of constraints
 representation close to original problem
– variables = problem entities
– constraints: not necessarily translated in linear inequalities

 importance of satisfiability problems


 modularity (distinction analysis/resolution)
 flexibility of devised systems

 adaptation of algorithms to the types of constraints


 efficiency for some problems (scheduling, strongly
symmetrical programs…)

P. Lopez - April 2009 73


Benefits of Constraint-based framework (2)

 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

P. Lopez - April 2009 74


Drawbacks of Constraint-based framework
 modeling
 modeler (OPL, Kalis)

 performances, efficiency of basis techniques to solve large


scale problems
 determination of lower bounds and design of suited propagation
mechanisms

 completeness of deductions, genericity of reasonings


 structures to implement propagation rules (lattice of task intervals)

 sacrifice of general characteristics of a programming


language to favor sophisticated and dedicated primitives
 libraries

P. Lopez - April 2009 75


Overview

P. Lopez - June 2008 76


Summary on CP

Constraint programming is based on:

 Constraint Satisfaction Problems


– local consistency rules for temporal constraints
– heuristic search strategies

 Operations Research
– tree search solving procedures
– lower and upper bounds for optimal solutions
– propagation rules for resource constraints

P. Lopez - April 2009 77


Part of works of MOGISA Group (1)
 Constraint-based Analysis for task scheduling and resource allocation
– time and resource constraints
– 2 complementary approaches
 Necessary Conditions of feasibility
 Sufficient Conditions of feasibility

 NC: Constraint Propagation Mechanisms


– critical set of conflicting tasks
– energetic reasoning
– integration of time and resource constraint propagation: graph model, new
constraint propagation processes (time and resource reasoning)
– integration of Artificial Intelligence (CSP) and Operational Research
(Combinatorial Optimization) methods
 A set of solutions not proved inconsistent

 Temporal structures to apply constraint propagation


– Temporal decomposition, clustering, lattice of task intervals
P. Lopez - April 2009 78
Part of works of MOGISA Group (2)
 SC: robust & flexible scheduling
– groups of permutable tasks
– dominance conditions (of feasibility or optimality)
 Temporal reasoning
 sets of consistent solutions

 Solving procedure
– truncated backtrack: heuristics for backjumping and
truncating

 Temporal uncertainty in scheduling


– dynamic controllability
– dynamic sequentiability

P. Lopez - April 2009 79


CSP for time and resource constraints...

P. Lopez - June 2008 80


Mixed Scheduling Problems

 Mixed scheduling & allocation problems


 Resources
 non premptive
 disjunctive or cumulative
 heterogeneous and polyvalent
 Allocation: set of possible resources
 resource-dependent processing times
 for k, task duration not constant: pi,k  [pi,kmin, pi,kmax]

 Example: Flexible Job Shop

(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

 Time constraints  Resource constraints


 sharing
sti fti
esti lfti
disjunctive

pi
cumulative
DAG
 allocation
resource 1
?
? resource 2
task i
? resource 3
P. Lopez - April 2009 82
Propagation of time constraints

 Consistency enforcing of a temporal CSP (TCSP)


– variables = times
– constraints = distances (under the form of intervals) between 2 times
(binary constraints)

 Simple temporal problems (STP)


– constraint  1 simple interval
– graph algorithms (AC#, PC#, Bellman, Ford, Floyd-Warshall…)
– polynomial and complete  [p+u, q+v]
[20,40]
[20,50]
[x,y][10,50]
X1 X2
 General TCSPs
[p, q]
[10,20] [u, v]
[10,20]
– constraint  disjunction of intervals X3
– path consistency: PC2, ULT, LPC…
A Simple Temporal Network: Xj-Xi  [aij, bij]
– polynomial but incomplete

P. Lopez - April 2009 83


Example of time and resource
propagation in scheduling
 Deduction rule dedicated to est2 lft2
disjunctive pairs tasks

task 3
1. Elimination rule:
• lftj - esti < pi + pj  i not before j task 2

• disjunctive problem  j before i task 1


t

2. Domain reduction: tasks Propagation

• adjustments of esti and lftj


task 3

3. Propagation task 2

task 1
t

P. Lopez - April 2009 84


Propagation of resource constraints (1)

 Local operations - edge-finding


– Disjunctive pairs

– Conjunctive precedences

 ascending/descending sets

 EFF/LSL

– Non-conjunctive precedences (‘Not-


First’ / ‘Not-Last’)

P. Lopez - April 2009 85


Local operations: extended formulation
 Prise en compte de toutes les informations temporelles
– ex : une contrainte entre sti et ftj peut être plus restrictive que la différence entre
domaines temporels...
 Nouvelle formulation exploitant les résultats d’un graphe potentiels-
bornes minimal
sti fti sti fti
graphe minimal obtenu par
OU propagation de type
stj ftj consistance de chemins (FW) stj ftj
a’ > 0  i non avant j [a’,b’]
 recouvre la proposition classique ( lftj - estj < pj + pj  i non avant j )
 Raisonnement
– étendu (NRJ)
– extensible à d’autres règles d’élimination

P. Lopez - April 2009 86


Energetic reasoning
 integration of time and resource constraints (concept of
“work”) considering energetic balances
– between tasks and resources
– over time intervals

t1 t2

ai  Maximum available energy over [t1,t2]


W(t1,t2) = A  (t2-t1)

 Consumption of i starting at ti over [t1,t2]


w(i, t1,t2) = ai  max[0,min(t2,ti+pi)-max(t1,ti)]
esti lfti

P. Lopez - April 2009 87


Global consistency

 Every feasible schedule must satisfy


[t1,t2], iT w(i, t1,t2)  W(t1,t2)
otherwise
if  [t1,t2] s.t.  iT w(i, t1,t2) > W(t1,t2)
then no feasible schedule

 Applying this latest rule to particularized tasks induces the


following local deductions:
– relative locations between tasks (immediate selection, minimum
distance)
– absolute locations of tasks (forbidden times, time-bound adjustments)

P. Lopez - April 2009 88


Propagation of resource constraints (2)

 Global operations
– decision refutation
by simple propagation on the global problem
– shaving
– singleton arc-consistency

Skeleton of a SAC algorithm

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)

P. Lopez - April 2009 89


Some results on global operations

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

P. Lopez - April 2009 90


Propagation of resource constraints -
Allocation (1)

Tk Pk
k

 The basis assumption


– durations and intensities may depend on the resource allocated

P. Lopez - April 2009 91


Propagation of resource constraints -
Allocation (2)
 Principles of cross-propagation rules
– each time a task i is assigned to a resource k, try to tighten the time
domains of tasks already assigned to k
– each time the time domain of task i is reduced, remove any inconsistent
allocation alternative
 either because it is not time-feasible
– the slack left by tasks already assigned to k is too small
 or it is is not energy-feasible
– the energy left by tasks already assigned to k is too small

jpi
  iTk,  jPk, AND  Mj  Mj \ {k}
ipj

  jPk, pjk  [pjmin, pjmax]FW  Mj  Mj \ {k}

P. Lopez - April 2009 92


Propagation and searching (1)

 Chronological backtracking algorithm


with a variable and value ordering heuristics
stack of contexts = empty
select a good candidate variable to instantiate (e.g., the most constrained)
select a good value (e.g., the less constraining)
push the context on the stack (record)
propagate time and resource constraints
if the problem is no longer consistent
then if the stack is not empty
then pop the previous context (restore)
until all variables have a value or the stack is empty (inconsistency)

P. Lopez - April 2009 93


Propagation and searching (2)
 Some branching schemes for minimizing makespan
1/ Select the most constrained resource slack(i p j )
not yet entirely scheduled
est i
2/ Min-slack/Max-slack
 select an unordered pair lft j
with the smallest slack (i p j or j p i) lft j  est i  (p i + p j )
 create two problems for each relation
2’/ Binary search
 select a task (e.g., with the most outlying domain)
 create two problems for each half of the domain
3/ Propagate time and resource constraints

Repeat 1, 2-2’, 3, until all resources are scheduled

P. Lopez - April 2009 94


Applications

P. Lopez - June 2008 95


CP vs. IP scheduling constraint formulations
CP IP
Inequalities with Boolean
variable MachineA  MachineB MachineA + MachineB = 1
(MachineX=1 if job assigned)

Inequalities with integer variable MachineA  MachineB MachineA – MachineB + xAB.bigM  0


(MachineX=job_number_assigned) MachineB – MachineA + (1 – xAB).bigM  0

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

Global constraint alldifferent(Machine) m(m-1) constraints and m(m-1)/2 indicator


variables

Other global constraints diffn, cumulative, sequence, …


reservoir

P. Lopez - April 2009 96


SCOOP : un Système Coopératif
pour l’Ordonnancement de Production

P. Lopez - June 2008 97


SCOOP : Position du problème
 Atelier PTC de Dassault Aviation, St-Cloud
 Pièces de Tôlerie Cambrée (Mirage 2000, Falcon, Rafale)
– 20000 pièces / mois
 40 types
 3000 références
 12 gammes de fabrication
– 5 postes de fabrication
 ENGAGEMENT EN DECOUPE
(mise en panoplies et détourage)
 Essuyage, ébavurage, ajustage
 Traitement thermique (recuits, trempe)
 Cambrage
 Chaudronnerie
 Atelier de type job shop avec recirculation

 Peu automatisé - Opérateur humain prépondérant


– Réalisation manuelle de certaines opérations
– Prise de décision dans un environnement incertain et perturbé
P. Lopez - April 2009 98
Mise en panoplies

P. Lopez - April 2009 99


SCOOP : L’engagement
 Contraintes de regroupement
– Pièces de même type regroupées en panoplies
– Fenêtre d’une panoplie = intersection des fenêtres des pièces de la
panoplie
– Durée d’une panoplie = somme des durées de découpe

OFs

pano

– Surface totale des pièces regroupées < 80% de la surface totale


– Contraintes d’imbrication géométrique

– Plusieurs panoplies en disjonction

P. Lopez - April 2009 100


SCOOP : Méthodologie
 Propagation de contraintes de ressources
 Règles d’élimination du type « edge-finding »
 Analyse de données pour un classement hiérarchique pour l’affectation de pièces
aux panoplies
– Détermination de distances entre pièces et panoplies en construction basées sur la perte de
marge
– Plus la distance est grande, moins l’affectation est prioritaire
Pièce P1
Pièce P2

Panoplie en cours
de construction

Panoplie + P1 (Pano,P1)
Panoplie + P2
(Pano,P2) >> (Pano,P1)

– Distance infinie en cas d’incompatibilité

 BILAN : Implémentation par un outil de PPC avec primitives graphiques


avancées  maquette de système interactif

P. Lopez - April 2009 101


Propagation de contraintes de ressources

 Opérations locales - edge-finding


– Paires de disjonction

– Précédences conjonctives

 Ensembles ascendants/descendants

 EFF/LSL

– Précédences non conjonctives (‘Not-First’


/ ‘Not-Last’)

P. Lopez - April 2009 102


Ecrans SCOOP

P. Lopez - April 2009 103


Optimisation de missions spatiales

P. Lopez - June 2008 104


Applications spatiales
 Terre
– SkyBridge : Optimisation des ressources satellites
dans les constellations (handoffs)

– Pléiades : Programmation de prises de vue d’un


satellite d’observation (contraintes stéréo) lacet

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
 

Orbiteur martien Stockage des données dans le buffer de l’orbiteur

fenêtres de
 

   


visibilité
 
 
 

 
 
Terre/orbiteur


Centre des Préparation Mise à jour du Préparation


opérations au d’un plan de plan de travail d’un nouveau
sol travail plan de travail

 



 


 

 
 


 

 

 

 
 


   
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

Xs,t  {0;1} t =1..T, s=1..4

P. Lopez - April 2009 107


Netlander : Résolution de la
planification des communications orbiteur/sondes
 Utilisation d’un solveur commercial (CPLEX)
– simplexe + Branch & Bound
– solution optimale sur un horizon de 30 jours pour 3 orbites de test fournies par le CNES
1 sol ( jour martien) = 24 heures 37 minutes, 1 p.d.t. (pas de temps) = 2 minutes
nuit  sonde non ensoleillée

temps solution moyenne (p.d.t.


(sec.) (nombre p.d.t.) /sol et /sonde)
Scénario 1 jour 80 695 5,9
jour et nuit 86 1705 14,6
Scénario 2 jour 73 257 2,2
jour et nuit 74 638 5,5
Scénario 3 jour 75 724 6,2
jour et nuit 79 1710 14,7

!! durée préconisée par sol et par sonde : entre 20 et 30 pas de temps !!


 L’optimisation a permis d’éliminer complètement un scénario et de contraindre les 2
P. Lopez autres a une utilisation obligatoire des communications de jour ET de nuit
- April 2009 108
Netlander : Planification des expériences

 Problème mal défini mais assurément combinatoire


– critère d’optimisation indéfini
– contraintes de réalisation des expériences mal connues
 Objectif : guider l’élaboration de plans de travail réalisables compte tenu de la
connaissance actuelle du système
– aide à la décision
– évaluation de l’occupation des ressources en jeu (MdM, électricité)

P. Lopez - April 2009 109


Évaluation de la consommation d’une expérience
 Définition d’un plan de travail en cours d’élaboration
– expériences élémentaires candidates Ec sur un horizon T
dui
dui
i E21 i
expérience
esti i i==0i([t,t’][sti,fti]) lfti
i = i([t,t’]dui)
sti t fti t’ temps

– 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

place mémoire disponible

M1
m
M0  co
M2
m
 co

temps
fc0
fc
0
sc1 fcfc
1
1
sc2 fc
fc2
2

 intervalles de temps significatifs : [fci fci+1]


ressource consommable sur chaque intervalle considéré
P. Lopez - April 2009 111
Courbes de charge de la MdM d’une sonde

4
st4 ft4
fci fci+1 temps


 Mi
     Mi+1 Csup
  
 fci,fci+1
Mi+1 Cinf

fci sci+1 fci+1 temps

P. Lopez - April 2009 112


Raisonnement énergétique
• Règles de
de propagation
propagationdedecontraintes
contraintes[Lopez
[Lopez
91]91]


– inconsistance
inconsistance globale
globale : raisonnement sur la courbe de charge minimale
(Csup) tel que M  < i i ,  plan non réalisable
 plan
• réalisable
 tel que M < i i  plan non réalisable
  M  > i i,   plan réalisable pour toute instanciation des

 planmodifier
en courscertaines instanciations de E
réalisable
expériences de E2 : raisonnement1 sur la courbe de charge
maximale
 éliminer inf)expériences de E
(Cdes
2

•  , M >    plan réalisable pour toute instanciation des
 i i
 inconsistances locales
expériences de E2
M i < i ,  i n’est pas réalisable avec le plan E en cours
M

 décaler l’exécution de i si i E1


M
 réduire la durée de i si i E1 CC sup
inf
 modifier des expériences de E1 exécutées sur 
 éliminer des expériences de E2 temps

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

P. Lopez - April 2009 114


Plan solution

1
st1 ft1
2
st2 ft2
3
st3 ft3
4
st4 ft4
fcj fcj+1 temps

Mj

Mj+1 Cinf = Csup

temps

P. Lopez - April 2009 115


BILAN
 Spécification d’un outil d’aide à l’élaboration des plans de
travail des sondes  ébauche pour la négociation entre les
différents scientifiques engagés dans la mission (« Principal
Investigators »)

 Plan solutions flexibles


– Flexibilité séquentielle
– Flexibilité temporelle
 sur les dates
 sur les durées i (min(dui, lfti-esti)-dui)/n
– Flexibilité sur la consommation des ressources
Différence entre les évaluations minimale et maximale de la charge des
ressources
j j . (Mj-Mj) / H

P. Lopez - April 2009 116


P. Lopez - April 2009 117

Vous aimerez peut-être aussi