Integrating Operations Research Algorithms in Constraint

Download Report

Transcript Integrating Operations Research Algorithms in Constraint

Integrating Operations Research
Algorithms in Constraint
Programming
Claude Le Pape
ILOG S.A.
1
CPAIOR’02 School on Optimization
C. Le Pape
ILOG Optimization Suite
ILOG
OPL
Studio
ILOG
CPLEX
ILOG
Scheduler
Hybrid
ILOG
ILOG
Dispatcher Configurator
ILOG Solver
ILOG Concert Technology
2
CPAIOR’02 School on Optimization
C. Le Pape
Outline
• Introduction
• Problem decomposition
• Constraint propagation
– Propagation of global constraints
– Objective functions
– What ifs
• Search
• Conclusion
3
CPAIOR’02 School on Optimization
C. Le Pape
Discrete Optimization (1)
• A combination of choices to make (decision
variables)
–
–
–
–
4
Distribute objects into bins (tasks to people)
Sequence and schedule tasks
Design routes between given points
Complex combination, e.g., assign deliveries of
customers to trucks and drivers, schedule the
deliveries for each driver, and design the routes
to be followed
CPAIOR’02 School on Optimization
C. Le Pape
Discrete Optimization (2)
• Constraints between these choices
– Capacity and geometry of bins
– Precedence, delays, incompatibilities between
tasks
– Route network topology and capacity
– Complex constraints, e.g., big trucks are not
allowed on Market Street from 9 to 11 a.m. on
Wednesdays
5
CPAIOR’02 School on Optimization
C. Le Pape
Discrete Optimization (3)
• One or more optimization criteria
–
–
–
–
–
–
6
Don’t spend too much (minimize cost)
Earn as much as possible (maximize income)
Don’t be late (minimize tardiness)
Don’t be early (minimize earliness)
Don’t take risks (quality, security, robustness)
Make sure everybody is happy (satisfaction and
equilibrium between individual preferences)
CPAIOR’02 School on Optimization
C. Le Pape
Mathematical Model (1)
• Mathematical definition of variables
– Decision variables
– Intermediate variables
– Optimization variables
• Mathematical definition of constraints
Mathematical definition of solutions:
assignments of values to variables that
satisfy the constraints
7
CPAIOR’02 School on Optimization
C. Le Pape
Mathematical Model (2)
• Mathematical definition of an ordering
relation between solutions
– Often a partial definition: some elements of
comparison often lie in the head of the user
Mathematical definition of optimal
solutions: solutions that are not dominated
according to the ordering relation
8
CPAIOR’02 School on Optimization
C. Le Pape
Problem Solving
• Three main classes of techniques
– Linear Programming and Mixed Integer
Programming
– Constraint Programming
– Local Search
9
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (1)
• Explicit problem definition
– Linear constraints
– Real (floating point) and integer variables
– One optimization criterion
• Separation between problem definition and problem
solving
• The continuous relaxation (when fractional values are
allowed for integer variables) is solvable in polynomial
time
 Bound on optimization criterion
 Guidance for solving the MIP problem by branch-and-bound
(rounding, cuts, …)
10
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (2)
11
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (3)
12
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (4)
13
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (5)
14
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (6)
15
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (7)
16
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (8)
17
CPAIOR’02 School on Optimization
C. Le Pape
Mixed Integer Programming (9)
18
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (1)
range Boolean 0..1;
int fixed = ...;
enum Warehouses ...;
int nbStores = ...;
range Stores 0..nbStores-1;
int capacity[Warehouses] = ...;
int supplyCost[Stores,Warehouses] = ...;
var Boolean open[Warehouses];
var Boolean supply[Stores,Warehouses];
19
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (2)
minimize
sum(w in Warehouses) fixed * open[w]
+ sum(w in Warehouses, s in Stores)
supplyCost[s,w] * supply[s,w]
subject to {
forall(s in Stores)
sum(w in Warehouses) supply[s,w] = 1;
forall(w in Warehouses, s in Stores)
supply[s,w] <= open[w];
forall(w in Warehouses)
sum(s in Stores) supply[s,w]
<= capacity[w];
};
20
CPAIOR’02 School on Optimization
C. Le Pape
Constraint Programming
• Explicit problem definition
• Separation between problem definition and problem solving
• Systematic deduction of the consequences of made decisions
(constraint propagation)
Partial constraint propagation  development of heuristic search
algorithms to generate and optimize solutions
• Incremental constraint propagation (with global fix point semantics)
• Localized definition of the constraint propagation process (each
constraint propagates independently of other constraints)  many
different types of constraints viewed as as many sub-problems
21
CPAIOR’02 School on Optimization
C. Le Pape
Constraint Programming
Problem
definition
New constraints
(decisions)
Problem specification
or partial solution in
terms of constraints
Initial constraints
Dynamic changes
Deduced constraints
Contradictions
22
Decision-making
(and retracting)
Constraint
propagation
CPAIOR’02 School on Optimization
C. Le Pape
Example: Propagation
Variables:
x in [1..3]
y in [1..3]
z in [1..3]
23
Constraints:
x-y=1
y<z
x != z
x-y=1
x in [2..3]
y in [1..2]
z in [1..3]
y<z
x in [2..3]
y in [1..2]
z in [2..3]
x != z
x in [2..3]
y in [1..2]
z in [2..3]
CPAIOR’02 School on Optimization
C. Le Pape
Example: Decision-Making
Variables:
x in [2..3]
y in [1..2]
z in [2..3]
y=2
Constraints:
x-y=1
y<z
x != z
x=3
y=2
z=3
FAILURE
Backtrack
y=1
24
x=2
y=1
z=3
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (1)
int fixed = ...;
int nbStores = ...;
enum Warehouses ...;
range Stores 0..nbStores-1;
int capacity[Warehouses] = ...;
int supplyCost[Stores,Warehouses] = ...;
int maxCost = max(s in Stores, w in Warehouses)
supplyCost[s,w];
var int open[Warehouses] in 0..1;
var Warehouses supplier[Stores];
var int cost[Stores] in 0..maxCost;
25
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (2)
minimize
sum(s in Stores) cost[s]
+ sum(w in Warehouses) fixed * open[w]
subject to {
forall(s in Stores)
cost[s] = supplyCost[s,supplier[s]];
forall(s in Stores )
open[supplier[s]] = 1;
forall(w in Warehouses)
sum(s in Stores) (supplier[s] = w)
<= capacity[w];
};
26
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (3)
search {
forall(s in Stores ordered
by decreasing regretdmin(cost[s]))
tryall(w in Warehouses ordered
by increasing supplyCost[s,w])
supplier[s] = w;
generateSeq(open);
};
27
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (1)
Masonry (7)
Carpentry (3)
Windows (1)
Roofing (1)
Plumbing (8)
Ceilings (3)
Facade (2)
Garden (1)
Painting (2)
Moving (1)
28
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (2)
0
5
10
15
20
Masonry
Plumbing
Carpentry
R.
W.
Ceilings
Facade
G.
Paint.
M.
29
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (3)
• "Plumber" = "Roofer"
• Solution: Order "Plumbing" and "Roofing"
• Heuristic choice
For example, "Plumbing" before "Roofing"
30
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (4)
0
5
10
15
20
Masonry
Plumbing
Carpentry
R.
W.
Ceilings
Facade
G.
Paint.
M.
31
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (5)
0
5
10
15
20
Masonry
Plumbing
Carpentry
R.
W.
Ceilings
Facade
G.
Paint.
M.
32
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (6)
0
5
10
15
20
Masonry
Plumbing
Carpentry
R.
W.
Ceilings
Facade
G.
Paint.
M.
33
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (7)
0
5
10
15
20
Masonry
Plumbing
Carpentry
R.
W.
Ceilings
Facade
G.
Paint.
M.
34
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (8)
Constraint propagation consists in
incrementally
updating characteristics of a partial problem solution
when an additional constraint is added
These characteristics may be:
– indicators of contradictions
– domains of variables (relational propagation)
– the overall set of constraints (logic/algebraic propagation)
35
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (9)
Particular case: arc-consistency
A constraint propagation technique enforces arc-consistency if
and only if when propagation stops the following statement holds:
for every constraint c(v1 ... vn)
for every variable vi
for every value vali in the domain of vi
there are values val1 ... vali-1 vali+1 ... valn
in the domains of v1 ... vi-1 vi+1 ... vn
such that val1 ... vali-1 vali vali+1 ... valn satisfy c
Considering a constraint as a sub-problem, arc-consistency
consists of removing all the values that do not belong to any
solution of the sub-problem
36
CPAIOR’02 School on Optimization
C. Le Pape
Incrementality Principle (10)
Non-monotonic constraint propagation consists in
incrementally
updating characteristics of a partial problem solution
when a constraint is added or retracted
Non-monotonic constraint propagation implies the cancellation (hence
the identification) of the consequences of the retracted constraints
Non-monotonic constraint propagation is not used as much as
"monotonic" constraint propagation (for complexity reasons)
37
CPAIOR’02 School on Optimization
C. Le Pape
Locality Principle (1)
• Each constraint (or constraint type) "includes" all the
information necessary to enable its propagation and, in
particular, to determine whether it is satisfied or not as
soon as all its variables are instantiated
• The constraint propagation methods associated with a
constraint (or constraint type) are a priori independent
of the methods associated with other constraints
38
CPAIOR’02 School on Optimization
C. Le Pape
Locality Principle (2)
• Example: temporal constraints and resource
constraints
User: "Plumber" = "Roofer"
User: "Moving" must end before 20
Temporal constraint: "Plumbing" must end before 17
Disjunctive resource constraint: "Plumbing" must
precede "Roofing"
– Temporal constraint: "Moving" cannot end before 19
–
–
–
–
39
CPAIOR’02 School on Optimization
C. Le Pape
Locality Principle (3)
0
5
10
15
20
Masonry
Plumbing
Carpentry
R.
W.
Ceilings
Facade
G.
Paint.
M.
40
CPAIOR’02 School on Optimization
C. Le Pape
Locality Principle (4)
Resource sub-problem
Temporal
Resource
Resource sub-problem
sub-problem
allocation
sub-problem
Resource sub-problem
Cost function sub-problem
41
CPAIOR’02 School on Optimization
C. Le Pape
MIP/CP: Most Important Points
MIP
CP
• Linear constraints
• One relaxation of the
global problem
• Guidance from the
optimal solution of the
relaxed problem
• Cuts
• Any constraints
• Linked relaxations of
multiple sub-problems
• Guidance from the
possible solutions of the
relaxed sub-problems
• Redundant constraints
• Scheduling example:
hard to deal with
resource constraints
• Scheduling example:
hard to deal with
« sum » cost functions
42
CPAIOR’02 School on Optimization
C. Le Pape
Local Search
• Operators to move from solutions to other
(neighbor) solutions (or from populations of
solutions to populations of solutions)
• Search control strategy (meta-heuristic)
• Many different types: simulated annealing,
tabu search, genetic algorithms, …
43
CPAIOR’02 School on Optimization
C. Le Pape
Main Issues (1)
• Mixed Integer Programming
– Is the continuous relaxation a good
approximation of the convex envelope of the
solutions?
– Can the formulation of the problem be
iteratively modified to make the optimal
solution of the continuous relaxation converge
toward the optimal solution of the initial
problem?
44
CPAIOR’02 School on Optimization
C. Le Pape
Main Issues (2)
• Constraint Programming
– Are the critical constraints propagating well?
– Is a tight bound on the optimization criterion
efficiently translated (by propagation) into
constraints that effectively guide the search
toward a solution?
45
CPAIOR’02 School on Optimization
C. Le Pape
Main Issues (3)
• Local Search
– Is the neighborhood topology consistent with
the optimization criterion?
– Are the operators connecting (in a few steps)
good solutions with better solutions, without
downgrading the solution too much in
intermediate steps?
46
CPAIOR’02 School on Optimization
C. Le Pape
Outline
• Introduction
• Problem decomposition
• Constraint propagation
– Propagation of global constraints
– Objective functions
– What ifs
• Search
• Conclusion
47
CPAIOR’02 School on Optimization
C. Le Pape
Problem Decomposition
Complete
model
48
Sub-model 1
Solver 1
Sub-model 2
Solver 2
Sub-model 3
Solver 3
CPAIOR’02 School on Optimization
C. Le Pape
Sequential Decomposition
• Solve sub-problem 1
• Impose the solution of sub-problem 1 and
solve sub-problem 2
• Infer characteristics of « good » solutions of
sub-problem 1
• Iterate
49
CPAIOR’02 School on Optimization
C. Le Pape
Column Generation
• Principle
– Generate candidate solution components
– Find the optimal combination of these components
– Infer characteristics of « good » solution components to
add
– Iterate
• Examples
– Train scheduling
– Crew scheduling
– Routing
50
CPAIOR’02 School on Optimization
C. Le Pape
Example: Inventory Management
Warehouse
order 1
Buy
Rent
order 2
order 3
How to satisfy orders with a MINIMAL COST ?
51
CPAIOR’02 School on Optimization
C. Le Pape
Example
Stock = 4
st(o1) = 0, et(o1) = 35, rq(o1) = 2
st(o2) = 5, et(o2) = 30, rq(o2) = 3
st(o3) = 32, et(o3) = 87, rq(o3) = 5
rq(o1)=2
rq(o2)=3
0
52
5
rq(o3)=5
32
CPAIOR’02 School on Optimization
87
100
C. Le Pape
Demand Curve
7
6
5
4
3
2
1
Demand
Stock
05
53
30 32 35
87
CPAIOR’02 School on Optimization
100
C. Le Pape
Basic Model
• alloc(o): set of resources assigned to the order o
from existing stock
• rent(o): set of resources assigned to the order o
from external rental
• Note: rq(o) = |alloc(o)| + |rent(o)|
A solution is a valuation of the functions alloc and rent
54
CPAIOR’02 School on Optimization
C. Le Pape
Costs
• Crent: cost for rental per item per time unit
• Cafix: fixed cost of allocation from existing stock
• Catd: time-dependent cost for each allocation
Goal: Minimize the total cost
SoO |rent(o)| * Crent(r) * duration(o)
+ |alloc(o)| * (Cafix(r) + Catd(r) * duration(o))
55
CPAIOR’02 School on Optimization
C. Le Pape
Example
Solution 1 (cost = 4840)
0 5
32
Optimal solution (cost = 3820)
87
100
0 5
32
87
rent
stock
56
CPAIOR’02 School on Optimization
C. Le Pape
100
Maintenance Constraints
• No resource is used more than Utime time
units without maintenance
• No more than Mnumber resources are in
maintenance at the same time
• Cost of each maintenance: Cmaint
57
CPAIOR’02 School on Optimization
C. Le Pape
Substitution of Resources
• A resource can be replaced by a resource of
another type
• Hierarchy of resource types
R1
R2
CPAIOR’02 School on Optimization
R3
C. Le Pape
Complexity Results
 Core problem
Polynomial
(maximum flow of minimum cost)
 Core problem with maintenance
NP-hard
(multiprocessor scheduling problem)
 Core problem with substitution
(list coloring on interval graphs)
59
CPAIOR’02 School on Optimization
NP-hard
C. Le Pape
Problem Decomposition
Original problem
Resource allocation problem
(problem without maintenance)
Linear programming
60
Scheduling problem
(maintenance scheduling)
Cooperation
CPAIOR’02 School on Optimization
Constraint programming
C. Le Pape
Mixed Integer Programming (1)
crane
allocation
problem
core
problem
select
maintenance
intervals
maintenance
schedule
99% cost
1% cost
Polynomial
NP-hard
80 vars
40 constrs
61
select
cranes
1000 vars
630 constrs
6000 vars
4000 constrs
45000 vars
32000 constrs
CPAIOR’02 School on Optimization
C. Le Pape
maintenance
problem
Mixed Integer Programming (2)
crane allocation
80 vars
40 constrs
1000 vars
630 constrs
maintenance scheduling
6000 vars
4000 constrs
45000 vars
32000 constrs
1 node
30 nodes
1200 nodes
> 20 000 nodes
> 20 000 nodes
62
CPAIOR’02 School on Optimization
C. Le Pape
Hybrid Algorithms (1)
LINEAR PROGRAMMING
Solve the (core) resource allocation problem
HEURISTIC ALGORITHM
Select resource items for each order
CONSTRAINT PROGRAMMING
Solve the resulting maintenance scheduling problem
On failure, tighten the resource allocation problem and iterate
63
CPAIOR’02 School on Optimization
C. Le Pape
Hybrid Algorithms (2)
Tightness of the crane allocation problem:
• Extend the duration of all tasks (add the maintenance duration)
• Extend the duration of the conflict task
Tightness:
Resource allocation cost:
Maint. scheduling cost:
dur(o)
dur(o) + 1*dur(m)
dur(o) + 2*dur(m)
dur(o) + 3*dur(m)
dur(o) + 4*dur(m)
87 927 919
88 022 342
89 123 491
90 211 387
91 910 152
2501
Final result: 4.5% above the lower bound 87 927 919
64
CPAIOR’02 School on Optimization
C. Le Pape
Hybrid Algorithms (3)
PRE-PROCESSING
Tighten core problem to anticipate maintenance
LINEAR PROGRAMMING
Solve tightened resource allocation problem
HEURISTIC ALGORITHM
Select resource items for each order
LINEAR PROGRAMMING
Solve resource allocation + pre-scheduling problem
CONSTRAINT PROGRAMMING
Solve the resulting maintenance scheduling problem
65
CONSTRAINT PROGRAMMING
Heuristically
improve
(repair)
the solution C. Le Pape
CPAIOR’02
School on
Optimization
Hybrid Algorithms (4)
Instance
B*
G*
GA*7
GA*+
66
LP + check
CP + LS
LP + CP
(Sparc 20)
(Pentium Pro 200) (Pentium Pro 200)
Deviation
CPU Deviation
CPU Deviation
CPU
0.00%
3.2
0.34%
< 60
0.00%
<1
1.43%
9.7
0.44%
2.5
1.01%
23.9
10.41%
215.4 10.35%
67.2
16.84%
189.2 13.40%
160.9
CPAIOR’02 School on Optimization
C. Le Pape
Hybrid Algorithms (5)
• Other hybrid algorithms, including column
generation, provided « good » solutions
• Some instances remain « hard »
• Details available in [Caseau & Kökény 98,
Baptiste et al. 98]
67
CPAIOR’02 School on Optimization
C. Le Pape
Outline
• Introduction
• Problem decomposition
• Constraint propagation
– Propagation of global constraints
– Objective functions
– What ifs
• Search
• Conclusion
68
CPAIOR’02 School on Optimization
C. Le Pape
Global Constraints (1)
V11
V12
V10
V2
V9
V3
V8
V4
V7
69
O(n2) binary constraints
Weak constraint propagation
V1
V6
V5
One global constraint
Strong constraint propagation
CPAIOR’02 School on Optimization
C. Le Pape
Global Constraints (2)
• Adaptation and integration of an operations
research algorithm in a global constraint
• Three types of inferences (as in standard
constraint propagation):
– Conflict (the constraint cannot be satisfied)
– Reduction of the domains of the variables
– Inferred constraints (cuts)
70
CPAIOR’02 School on Optimization
C. Le Pape
Global Constraints: Examples (1)
• Collection of linear constraints (general or particular form)
– Detect conflicts
– Find variables with fixed values
– Find bounds of variables
– Infer additional constraints (cuts)
LP/MIP
CP
Linear
Programming
HYBRID
Constraint Propagation
Integer
Programming
71
Search Programming
CPAIOR’02 School on Optimization
C. Le Pape
Global Constraints: Examples (2)
• All-different [Régin 94, …]
• Disjunctive resource constraint: edge-finding [Nuijten 94,
Caseau & Laburthe 94, Baptiste & Le Pape 95, …]
• Preemptive resource constraint: mixed edge-finding
[Le Pape & Baptiste 98]
• Cumulative resource constraint: edge-finding and energetic
reasoning [Nuijten 94, Caseau & Laburthe 96,
Baptiste, Le Pape & Nuijten 99, …]
• Hamiltonian circuit constraint [Caseau & Laburthe 97]
• …
72
CPAIOR’02 School on Optimization
C. Le Pape
Global Constraints: Examples (3)
Preemptive job-shop scheduling [Le Pape & Baptiste 99]
16,00%
14,00%
12,00%
Timetable DFS-E-JK
Timetable DFS-B-JK
10,00%
Timetable LDS-E-JK
Timetable LDS-B-JK
8,00%
Edge-finder DFS-E-JK
Edge-finder DFS-B-JK
6,00%
Edge-finder LDS-E-JK
Edge-finder LDS-B-JK
4,00%
2,00%
0,00%
1
73
2
3
4
5
6
7
8
9
CPAIOR’02 School on Optimization
10
C. Le Pape
Objective Functions
• Minimize COST = F(V1, V2, …, Vn)
• Apply an operations research algorithm to a
relaxation of the problem
– Global lower bound at the root of the search tree
– Lower bound LB at each node of the search tree
– Characteristics of solutions with COST < LB + D
inferred from the optimal solution of the relaxed
problem and « reduced costs »
74
CPAIOR’02 School on Optimization
C. Le Pape
Objective Functions: Examples
• Minimize the number of late activities on one
machine [Baptiste, Le Pape & Péridy 98]
– Lower bound
• Minimize the sum of transition times on parallel
machines [Focacci, Laborie & Nuijten 00]
– Lower bound
– Exploit reduced costs to reduce the domains of
variables
75
CPAIOR’02 School on Optimization
C. Le Pape
ILOG HYBRID (1)
•
•
76
All linear constraints of a model are captured.
At each node of search:
– All linear constraints added (decisions, deductions)
and all domain reductions inferred are captured and
passed to the LP solver which solves the new linear
program.
– A relaxed optimal solution as well as optimality
information such as reduced cost and dual values is
provided.
– Variable bounds are tightened using reduced cost.
– Pseudo costs are available for branching.
CPAIOR’02 School on Optimization
C. Le Pape
ILOG HYBRID (2)
Lower bound
Relaxed optimal solution
LP
Hybrid
CP
Domain reductions
Linear constraints added
during search
The relaxed optimal solution can be used in the CP search heuristic
to guide the search.
Domain reductions and linear constraints from the CP engine tighten
the linear relaxation.
77
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (1)
range Boolean 0..1;
int fixed = ...;
int nbStores = ...;
enum Warehouses ...;
range Stores 0..nbStores-1;
int capacity[Warehouses] = ...;
int supplyCost[Stores,Warehouses] = ...;
int maxCost = max(s in Stores, w in Warehouses)
supplyCost[s,w];
var
var
var
var
78
Boolean open[Warehouses];
Boolean supply[Stores,Warehouses];
Warehouses supplier[Stores];
int cost[Stores] in 0..maxCost;
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (2)
minimize with linear relaxation
sum(w in Warehouses) fixed * open[w]
+ sum(w in Warehouses, s in Stores)
supplyCost[s,w] * supply[s,w]
subject to {
forall(s in Stores)
sum(w in Warehouses) supply[s,w] = 1;
…
forall(s in Stores)
supply[s,supplier[s]] = 1;
forall(s in Stores)
cost[s] = sum(w in Warehouses)
supplyCost[s,w] * supply[s,w];
};
79
CPAIOR’02 School on Optimization
C. Le Pape
Example in OPL Studio (3)
search {
forall(s in Stores ordered
by decreasing regretdmin(cost[s]))
tryall(w in Warehouses ordered
by increasing supplyCost[s,w])
supplier[s] = w;
};
80
CPAIOR’02 School on Optimization
C. Le Pape
CP search tree
with and without
linear relaxation
(the tree is 100 times bigger without)
Optimal at 383 is here
81
These nodes
and
sub-trees
are not C.pruned
CPAIOR’02
School
on Optimization
Le Pape
What Ifs (1)
• General scheme
– Try to impose a constraint C
If a conflict is detected, impose its negation C
– Constructive disjunction: Try alternatives C1 … Cn
Impose the consequences common to all alternatives
(x  3 or x  4 implies that x  4)
• Example
– « Shave » the bounds of variables
• Time consuming
82
CPAIOR’02 School on Optimization
C. Le Pape
What Ifs (2)
• Apply a « cheap » operations research
algorithm to a relaxation of the problem
with the constraint C added
83
CPAIOR’02 School on Optimization
C. Le Pape
What Ifs: Examples (1)
• Global update of time bounds in preemptive
scheduling [Le Pape & Baptiste 98]
– Network flow model to test the existence of solutions
(activities on one side, time intervals on the other)
– To test whether a given activity can end before a given
time, one just has to set the capacities of some arcs to 0
and update the flow (incrementally)
84
CPAIOR’02 School on Optimization
C. Le Pape
What Ifs: Examples (2)
• Minimize the number of late activities on one
machine [Baptiste, Le Pape & Péridy 98]
– Compute a lower bound LBi late of the number of late
activities when activity Ai is late and force Ai to be on
time if LBi late exceeds the current upper bound UB
– Compute a lower bound LBi on time of the number of late
activities when activity Ai is on time and force Ai to be
late if LBi on time exceeds the current upper bound UB
– Relation to the « reduced costs » idea (suggests that the
implementation of [Baptiste, Le Pape & Péridy 98] is
not optimal)
85
CPAIOR’02 School on Optimization
C. Le Pape
Outline
• Introduction
• Problem decomposition
• Constraint propagation
– Propagation of global constraints
– Objective functions
– What ifs
• Search
• Conclusion
86
CPAIOR’02 School on Optimization
C. Le Pape
Search
• Local search around a given solution
• Use the solution of a relaxed problem as a
heuristic guide for the resolution of the
complete problem
– Solution of a continuous relaxation
– Solution of a sub-problem
– Lower bounds and reduced costs as guides
toward « good » solutions
87
CPAIOR’02 School on Optimization
C. Le Pape
Examples: Vehicle Routing (1)
•
•
•
•
•
Set of customer locations and demands
Set of depots
Set of vehicles with given capacities
Transportation time and cost matrices
Specific constraints
– Legislation
– Special vehicles for special goods
– Roads available only to some vehicles
• Optimization criterion: minimize total cost
88
CPAIOR’02 School on Optimization
C. Le Pape
Examples: Vehicle Routing (2)
• Efficient local search algorithms
– No specific constraint
– Incremental computation of tour length and cost from a
solution to its neighbors
• Constraint programming for the specific
constraints
– Use constraints to test and reject « bad » neighbors
– Enlarge the neighborhood if there is no valid neighbor
– Find the valid neighbor with the smallest cost
89
CPAIOR’02 School on Optimization
C. Le Pape
Examples: Vehicle Routing (3)
• [Pesant & Gendreau 96]
– Exploitation of the power of constraint programming to
search small search spaces (neighborhoods) as part of a
tabu search algorithm
– Number of backtracks / |neighborhood|  0.29
• [Shaw 98]
– Large neighborhood search
– Limited discrepancy search to explore the neighborhood
• Active area of research
– See [Kilby, Prosser & Shaw 00, Caseau & Laburthe 99,
Caseau et al. 01]
90
CPAIOR’02 School on Optimization
C. Le Pape
Examples: Scheduling (1)
• [Caseau & Laburthe 95, Caseau et al. 01]
– Find an approximate solution
– Make local changes and repairs to decrease the makespan
• Repair: swap two activities to shrink or reduce the number of
critical paths
• Shuffle: keep part of the solution and search the solution space to
complete it with a limited number of backtracks (10 to 100 or
1000), under the constraint that the makespan must be improved
(step of 1%, decreased to one time unit)
– Perform an exhaustive search for decreasing makespans
• [Baptiste, Le Pape & Nuijten 95, Nuijten & Le Pape 98]
– Forget and extend with random fragments
91
CPAIOR’02 School on Optimization
C. Le Pape
Examples: Scheduling (2)
• [Le Pape & Baptiste 99]
– Strong constraint propagation algorithm
– Local optimization operator (Jackson derivation)
– Limited discrepancy search around the best schedule
found so far
• [Portmann et al., 98]
– Branch and bound
– At each node, precedence constraints are imposed
– At each node, a genetic algorithm is applied to find
« good » solutions satisfying the precedence constraints
92
CPAIOR’02 School on Optimization
C. Le Pape
Examples: Scheduling (3)
• Minimal perturbation scheduling [El Sakkout & Wallace 00]
– Temporal constraints
– Resource constraints
– Minimize S | xi – refi |
– The problem without the resource constraints is solved
by linear programming
– As long as resource constraints are violated, add
temporal constraints and iterate
93
CPAIOR’02 School on Optimization
C. Le Pape
Outline
• Introduction
• Problem decomposition
• Constraint propagation
– Propagation of global constraints
– Objective functions
– What ifs
• Search
• Conclusion
94
CPAIOR’02 School on Optimization
C. Le Pape
Conclusion (1)
• Already a significant number of applications
• Credo: hybrid problem-solving techniques will
enable the resolution of problems that are still
open today
– More efficient exact resolution
– Better lower and upper bounds in given CPU time
– More robust algorithms
95
CPAIOR’02 School on Optimization
C. Le Pape
Conclusion (2)
• Main difficulties
– Identification of promising combinations of
techniques
– Implementation and test of several of these
combinations
96
CPAIOR’02 School on Optimization
C. Le Pape
Conclusion (3)
• Guidelines and tools are needed
– Modeling
– Combination of sub-models
– Testing and interpretation of test results
• Several research paths
– Neutral models with solver-dependent instantiation
– Predefined solver-dependent models (ontologies)
– Automatic transformation of models between two given
solvers [Rodosek, Wallace & Hajian 99]
– …
97
CPAIOR’02 School on Optimization
C. Le Pape
Training for Optimization
• Basic knowledge: operations research classical
problems and algorithms
• Feeling: « vision » of the solution space
(polyhedric view, global view on domain
reduction or local search space)
• Background: constraint programming
• Implementation method: software engineering
• Rationality: probabilities, statistics, game theory
• Special skill: formal and informal communication
98
CPAIOR’02 School on Optimization
C. Le Pape
References (1)
•
•
•
•
•
99
Ph. Baptiste and C. Le Pape.
A Theoretical and Experimental Comparison of Constraint Propagation Techniques for
Disjunctive Scheduling.
14th International Joint Conference on Artificial Intelligence, 1995.
Ph. Baptiste, C. Le Pape and W. Nuijten.
Constraint-Based Optimization and Approximation for Job Shop Scheduling.
IJCAI'95 Workshop on Intelligent Manufacturing Systems, 1995.
Ph. Baptiste, C. Le Pape and L. Péridy.
Global Constraints for Partial CSPs: A Case Study of Resource and Due-Date Constraints.
4th International Conference on Principles and Practice of Constraint Programming, 1998.
Ph. Baptiste, Y. Caseau, T. Kökény, C. Le Pape and R. Rodosek.
Creating and Evaluating Hybrid Algorithms for Inventory Management Problems.
4th National Meeting on Practical Approaches to NP-Complete Problems, 1998.
Ph. Baptiste, C. Le Pape and W. Nuijten.
Satisfiability Tests and Time Bound Adjustments for Cumulative Scheduling Problems.
Annals of Operations Research, 92:305-333, 1999.
CPAIOR’02 School on Optimization
C. Le Pape
References (2)
•
•
•
•
•
•
100
Y. Caseau and F. Laburthe.
Improved CLP Scheduling with Task Intervals.
11th International Conference on Logic Programming, 1994.
Y. Caseau and F. Laburthe.
Disjunctive Scheduling with Task Intervals.
Technical Report, Ecole Normale Supérieure, 1995.
Y. Caseau and F. Laburthe.
Cumulative Scheduling with Task Intervals.
Joint International Conference and Symposium on Logic Programming, 1996.
Y. Caseau and F. Laburthe.
Solving Small TSPs with Constraints.
14th International Conference on Logic Programming, 1997.
Y. Caseau and T. Kökény.
An Inventory Management Problem.
Constraints, 3(4):363-373, 1998.
Y. Caseau and F. Laburthe.
Heuristics for Large Constrained Vehicle Routing Problems.
Journal of Heuristics, 5:281-303, 1999.
CPAIOR’02 School on Optimization
C. Le Pape
References (3)
•
•
•
•
•
101
Y. Caseau, F. Laburthe, C. Le Pape and B. Rottembourg.
Combining Local and Global Search in a Constraint Programming Environment.
Knowledge Engineering Review, to appear.
H. El Sakkout and M. Wallace.
Probe Backtrack Search for Minimal Perturbation in Dynamic Scheduling.
Constraints, 5(4):359-388, 2000.
F. Focacci, Ph. Laborie and W. Nuijten.
Solving Scheduling Problems with Setup Times and Alternative Resources.
5th International Conference on Artificial Intelligence Planning and Scheduling, 2000.
P. Kilby, P. Prosser and P. Shaw.
A Comparison of Traditional and Constraint-based Heuristic Methods on Vehicle
Routing Problems with Side Constraints.
Constraints, 5(4):389-414, 2000.
C. Le Pape and Ph. Baptiste.
Resource Constraints for Preemptive Job-Shop Scheduling.
Constraints, 3(4):263-287, 1998.
CPAIOR’02 School on Optimization
C. Le Pape
References (4)
•
•
•
•
•
102
C. Le Pape and Ph. Baptiste.
Heuristic Control of a Constraint-Based Algorithm for the Preemptive Job-Shop
Scheduling Problem.
Journal of Heuristics, 5:305-332, 1999.
W. Nuijten.
Time and Resource Constrained Scheduling: A Constraint Satisfaction Approach.
PhD Thesis, Eindhoven University of Technology, 1994.
W. P. M. Nuijten and C. Le Pape.
Constraint-Based Job Shop Scheduling with ILOG Scheduler.
Journal of Heuristics, 3:271-286, 1998.
G. Pesant and M. Gendreau.
A View of Local Search in Constraint Programming.
2nd International Conference on Principles and Practice of Constraint Programming, 1996.
M.-C. Portmann, A. Vignier, D. Dardilhac and D. Dezalay.
Branch and Bound crossed with GA to solve Hybrid Flowshops.
European Journal of Operational Research, 107(2):389-400, 1998.
CPAIOR’02 School on Optimization
C. Le Pape
References (5)
•
•
•
103
J.-C. Régin.
A filtering algorithm for constraints of difference in CSPs.
12th National Conference on Artificial Intelligence, 1994.
R. Rodosek, M. Wallace and M. Hajian.
A New Approach to Integrating Mixed Integer Programming and Constraint Logic
Programming.
Annals of Operations Research, 86:63-87, 1999.
P. Shaw.
Using Constraint Programming and Local Search Methods to Solve Vehicle Routing
Problems.
4th International Conference on Principles and Practice of Constraint Programming, 1998.
CPAIOR’02 School on Optimization
C. Le Pape