CPAIOR02 School on OptimizationC. Le Pape1 Integrating Operations Research Algorithms in Constraint...

Post on 30-Mar-2015

214 views 0 download

Tags:

Transcript of CPAIOR02 School on OptimizationC. Le Pape1 Integrating Operations Research Algorithms in Constraint...

CPAIOR’02 School on Optimization C. Le Pape1

Integrating Operations Research Algorithms in Constraint

Programming

Claude Le Pape

ILOG S.A.

CPAIOR’02 School on Optimization C. Le Pape2

ILOG Optimization Suite

ILOGILOG CPLEXCPLEX ILOG SolverILOG Solver

ILOG Concert Technology

Hybrid

ILOGOPL

Studio

ILOGOPL

StudioILOGILOG

SchedulerSchedulerILOGILOG

DispatcherDispatcherILOGILOG

ConfiguratorConfigurator

CPAIOR’02 School on Optimization C. Le Pape3

Outline

• Introduction• Problem decomposition• Constraint propagation

– Propagation of global constraints– Objective functions– What ifs

• Search• Conclusion

CPAIOR’02 School on Optimization C. Le Pape4

Discrete Optimization (1)• A combination of choices to make (decision

variables)– 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 Pape5

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

CPAIOR’02 School on Optimization C. Le Pape6

Discrete Optimization (3)

• One or more optimization criteria– 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 Pape7

Mathematical Model (1)• Mathematical definition of variables

– Decision variables– Intermediate variables– Optimization variables

• Mathematical definition of constraintsMathematical definition of solutions:

assignments of values to variables that satisfy the constraints

CPAIOR’02 School on Optimization C. Le Pape8

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

CPAIOR’02 School on Optimization C. Le Pape9

Problem Solving

• Three main classes of techniques– Linear Programming and Mixed Integer

Programming– Constraint Programming– Local Search

CPAIOR’02 School on Optimization C. Le Pape10

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, …)

CPAIOR’02 School on Optimization C. Le Pape11

Mixed Integer Programming (2)

CPAIOR’02 School on Optimization C. Le Pape12

Mixed Integer Programming (3)

CPAIOR’02 School on Optimization C. Le Pape13

Mixed Integer Programming (4)

CPAIOR’02 School on Optimization C. Le Pape14

Mixed Integer Programming (5)

CPAIOR’02 School on Optimization C. Le Pape15

Mixed Integer Programming (6)

CPAIOR’02 School on Optimization C. Le Pape16

Mixed Integer Programming (7)

CPAIOR’02 School on Optimization C. Le Pape17

Mixed Integer Programming (8)

CPAIOR’02 School on Optimization C. Le Pape18

Mixed Integer Programming (9)

CPAIOR’02 School on Optimization C. Le Pape19

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

CPAIOR’02 School on Optimization C. Le Pape20

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

CPAIOR’02 School on Optimization C. Le Pape21

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

CPAIOR’02 School on Optimization C. Le Pape22

Constraint ProgrammingProblemdefinition

Decision-making(and retracting)

Constraintpropagation

Problem specificationor partial solution interms of constraints

Initial constraintsDynamic changes

Deduced constraintsContradictions

New constraints(decisions)

CPAIOR’02 School on Optimization C. Le Pape23

Example: Propagation

x x y y 1 1x x y y 1 1x in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [1..3]z in [1..3]

x in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [1..3]z in [1..3]

y < zy < zy < zy < zx in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [2..3]z in [2..3]

x in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [2..3]z in [2..3]

x != zx != zx != zx != zx in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [2..3]z in [2..3]

x in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [2..3]z in [2..3]

Constraints:Constraints: x x y y 1 1y < zy < zx != zx != z

Variables: Variables: x in [1..3]x in [1..3]y in [1..3]y in [1..3]z in [1..3]z in [1..3]

CPAIOR’02 School on Optimization C. Le Pape24

Example: Decision-Making

y = y = 11y = y = 11x = x = 22y = y = 11z z = 3= 3

x = x = 22y = y = 11z z = 3= 3

y = 2y = 2y = 2y = 2x = 3x = 3y = 2y = 2z z = 3= 3

x = 3x = 3y = 2y = 2z z = 3= 3

FAILUREFAILUREFAILUREFAILURE

Backtrack

Constraints: Constraints: x x y y 1 1y < zy < zx != zx != z

Variables: Variables: x in [2..3]x in [2..3]y in [1..2]y in [1..2]z in [2..3]z in [2..3]

CPAIOR’02 School on Optimization C. Le Pape25

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;

CPAIOR’02 School on Optimization C. Le Pape26

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

CPAIOR’02 School on Optimization C. Le Pape27

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);

};

CPAIOR’02 School on Optimization C. Le Pape28

Incrementality Principle (1)Masonry (7)

Carpentry (3)

Roofing (1)

Windows (1) Facade (2) Garden (1) Painting (2)

Moving (1)

Plumbing (8) Ceilings (3)

CPAIOR’02 School on Optimization C. Le Pape29

Incrementality Principle (2)

Masonry

Plumbing

Carpentry

R.

Ceilings

Facade

W.

G.

Paint.

M.

0 5 10 15 20

CPAIOR’02 School on Optimization C. Le Pape30

Incrementality Principle (3)

• "Plumber" "Roofer"

• Solution: Order "Plumbing" and "Roofing"

• Heuristic choice

For example, "Plumbing" before "Roofing"

CPAIOR’02 School on Optimization C. Le Pape31

Incrementality Principle (4)

Masonry

Plumbing

Carpentry

R.

Ceilings

Facade

W.

G.

Paint.

0 5 10 15 20

M.

CPAIOR’02 School on Optimization C. Le Pape32

Incrementality Principle (5)

Masonry

Plumbing

Carpentry

R.

Ceilings

Facade

W.

G.

Paint.

0 5 10 15 20

M.

CPAIOR’02 School on Optimization C. Le Pape33

Incrementality Principle (6)

Masonry

Plumbing

Carpentry

R.

Ceilings

Facade

W.

G.

Paint.

M.

0 5 10 15 20

CPAIOR’02 School on Optimization C. Le Pape34

Incrementality Principle (7)

Masonry

Plumbing

Carpentry

R.

Ceilings

Facade

W.

G.

Paint.

0 5 10 15 20

M.

CPAIOR’02 School on Optimization C. Le Pape35

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)

CPAIOR’02 School on Optimization C. Le Pape36

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 ... vali1 vali1 ... valn

in the domains of v1 ... vi1 vi1 ... vn

such that val1 ... vali1 vali vali1 ... valn satisfy cConsidering 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

CPAIOR’02 School on Optimization C. Le Pape37

Incrementality Principle (10)Non-monotonic constraint propagation consists inincrementallyupdating characteristics of a partial problem solutionwhen 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)

CPAIOR’02 School on Optimization C. Le Pape38

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

CPAIOR’02 School on Optimization C. Le Pape39

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

CPAIOR’02 School on Optimization C. Le Pape40

Locality Principle (3)

Masonry

Plumbing

Carpentry

R.

Ceilings

Facade

W.

G.

Paint.

M.

0 5 10 15 20

CPAIOR’02 School on Optimization C. Le Pape41

Locality Principle (4)

Resource sub-problem

Resource sub-problem

Resource sub-problem

Temporalsub-problem

Cost function sub-problem

Resourceallocation

sub-problem

CPAIOR’02 School on Optimization C. Le Pape42

MIP/CP: Most Important PointsMIP• Linear constraints• One relaxation of the

global problem• Guidance from the

optimal solution of the relaxed problem

• Cuts

• Scheduling example: hard to deal with resource constraints

CP• 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 « sum » cost functions

CPAIOR’02 School on Optimization C. Le Pape43

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, …

CPAIOR’02 School on Optimization C. Le Pape44

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?

CPAIOR’02 School on Optimization C. Le Pape45

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?

CPAIOR’02 School on Optimization C. Le Pape46

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?

CPAIOR’02 School on Optimization C. Le Pape47

Outline• Introduction• Problem decomposition• Constraint propagation

– Propagation of global constraints– Objective functions– What ifs

• Search• Conclusion

CPAIOR’02 School on Optimization C. Le Pape48

Problem Decomposition

Completemodel

Solver 1

Solver 2

Solver 3

Sub-model 1

Sub-model 2

Sub-model 3

CPAIOR’02 School on Optimization C. Le Pape49

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

CPAIOR’02 School on Optimization C. Le Pape50

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

CPAIOR’02 School on Optimization C. Le Pape51

Example: Inventory Management

How to satisfy orders with a MINIMAL COST ?

Warehouse

Buy

Rent

order 1

order 2

order 3

CPAIOR’02 School on Optimization C. Le Pape52

ExampleStock 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 rq(o3)=5

0 5 32 87 100

CPAIOR’02 School on Optimization C. Le Pape53

Demand Curve

7654321

DemandStock

0 5 30 32 35 87 100

CPAIOR’02 School on Optimization C. Le Pape54

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

CPAIOR’02 School on Optimization C. Le Pape55

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 costoO |rent(o)| Crent(r)duration(o)

|alloc(o)| (Cafix(r) Catd(r) duration(o))

CPAIOR’02 School on Optimization C. Le Pape56

Example

Solution 1 (cost 4840)

rentstock

Optimal solution (cost 3820)

0 5 32 87 100 0 5 32 87 100

CPAIOR’02 School on Optimization C. Le Pape57

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

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 typesR1

R2 R3

CPAIOR’02 School on Optimization C. Le Pape59

Complexity Results Core problem Polynomial

(maximum flow of minimum cost)

Core problem with maintenance NP-hard(multiprocessor scheduling problem)

Core problem with substitution NP-hard(list coloring on interval graphs)

CPAIOR’02 School on Optimization C. Le Pape60

Problem Decomposition

Original problem

Cooperation

Resource allocation problem(problem without maintenance)

Scheduling problem(maintenance scheduling)

Linear programming Constraint programming

CPAIOR’02 School on Optimization C. Le Pape61

Mixed Integer Programming (1)

99% cost

80 vars40 constrs

1000 vars630 constrs

6000 vars4000 constrs

45000 vars32000 constrs

maintenanceproblem

crane allocatio

nproblem

coreproblem

maintenance schedule

select cranes

select maintenance

intervals

Polynomial NP-hard

1% cost

CPAIOR’02 School on Optimization C. Le Pape62

Mixed Integer Programming (2)

80 vars40 constrs

1000 vars630 constrs

6000 vars4000 constrs

45000 vars32000 constrs

crane allocation maintenance scheduling

1 node

30 nodes

1200 nodes

> 20 000 nodes

> 20 000 nodes

CPAIOR’02 School on Optimization C. Le Pape63

Hybrid Algorithms (1)

LINEAR PROGRAMMINGSolve 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

CPAIOR’02 School on Optimization C. Le Pape64

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

Final result: 4.5% above the lower bound 87 927 919

dur(o) 87 927 919 -dur(o) 1dur(m) 88 022 342 -dur(o) 2dur(m) 89 123 491 -dur(o) 3dur(m) 90 211 387 -dur(o) 4dur(m) 91 910 152 2501

Tightness: Resource allocation cost: Maint. scheduling cost:

CPAIOR’02 School on Optimization C. Le Pape65

Hybrid Algorithms (3)

LINEAR PROGRAMMINGSolve tightened resource allocation problem

HEURISTIC ALGORITHM

Select resource items for each order

CONSTRAINT PROGRAMMINGSolve the resulting maintenance scheduling problem

PRE-PROCESSINGTighten core problem to anticipate maintenance

LINEAR PROGRAMMINGSolve resource allocation + pre-scheduling problem

CONSTRAINT PROGRAMMINGHeuristically improve (repair) the solution

CPAIOR’02 School on Optimization C. Le Pape66

Hybrid Algorithms (4)

LP + check(Sparc 20)

CP + LS(Pentium Pro 200)

LP + CP(Pentium Pro 200)

Instance Deviation CPU Deviation CPU Deviation CPUB* 0.00% 3.2 0.34% < 60 0.00% < 1G* 1.43% 9.7 0.44% 2.5 1.01% 23.9GA*7 10.41% 215.4 10.35% 67.2GA*+ 16.84% 189.2 13.40% 160.9

CPAIOR’02 School on Optimization C. Le Pape67

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]

CPAIOR’02 School on Optimization C. Le Pape68

Outline• Introduction• Problem decomposition• Constraint propagation

– Propagation of global constraints– Objective functions– What ifs

• Search• Conclusion

CPAIOR’02 School on Optimization C. Le Pape69

Global Constraints (1)

O(n2) binary constraintsWeak constraint propagation

One global constraintStrong constraint propagation

V12

V6

V3V9

V2

V4

V10

V8

V11

V5

V1

V7

CPAIOR’02 School on Optimization C. Le Pape70

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)

CPAIOR’02 School on Optimization C. Le Pape71

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)

Linear Programming

IntegerProgramming

CP

Search Programming

Constraint Propagation

HYBRID

LP/MIP

CPAIOR’02 School on Optimization C. Le Pape72

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]

• …

CPAIOR’02 School on Optimization C. Le Pape73

Global Constraints: Examples (3)Preemptive job-shop scheduling [Le Pape & Baptiste 99]

0,00%

2,00%

4,00%

6,00%

8,00%

10,00%

12,00%

14,00%

16,00%

1 2 3 4 5 6 7 8 9 10

Timetable DFS-E-JK

Timetable DFS-B-JK

Timetable LDS-E-JK

Timetable LDS-B-JK

Edge-finder DFS-E-JK

Edge-finder DFS-B-JK

Edge-finder LDS-E-JK

Edge-finder LDS-B-JK

CPAIOR’02 School on Optimization C. Le Pape74

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 + inferred from the optimal solution of the relaxed problem and « reduced costs »

CPAIOR’02 School on Optimization C. Le Pape75

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

CPAIOR’02 School on Optimization C. Le Pape76

ILOG HYBRID (1)• 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 Pape77

ILOG HYBRID (2)

LP CPHybrid

Domain reductionsLinear constraints added during search

Lower bound Relaxed optimal solution

Domain reductions and linear constraints from the CP engine tighten the linear relaxation.

The relaxed optimal solution can be used in the CP search heuristic to guide the search.

CPAIOR’02 School on Optimization C. Le Pape78

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 Boolean open[Warehouses];var Boolean supply[Stores,Warehouses];var Warehouses supplier[Stores];var int cost[Stores] in 0..maxCost;

CPAIOR’02 School on Optimization C. Le Pape79

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

CPAIOR’02 School on Optimization C. Le Pape80

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;

};

CPAIOR’02 School on Optimization C. Le Pape81

CP search tree with and without linear relaxation

Optimal at 383 is here

(the tree is 100 times bigger without)

These nodes and sub-trees are not pruned

CPAIOR’02 School on Optimization C. Le Pape82

What Ifs (1)• General scheme

– Try to impose a constraint CIf 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

CPAIOR’02 School on Optimization C. Le Pape83

What Ifs (2)

• Apply a « cheap » operations research algorithm to a relaxation of the problem with the constraint C added

CPAIOR’02 School on Optimization C. Le Pape84

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)

CPAIOR’02 School on Optimization C. Le Pape85

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)

CPAIOR’02 School on Optimization C. Le Pape86

Outline• Introduction• Problem decomposition• Constraint propagation

– Propagation of global constraints– Objective functions– What ifs

• Search• Conclusion

CPAIOR’02 School on Optimization C. Le Pape87

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

CPAIOR’02 School on Optimization C. Le Pape88

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

CPAIOR’02 School on Optimization C. Le Pape89

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

CPAIOR’02 School on Optimization C. Le Pape90

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]

CPAIOR’02 School on Optimization C. Le Pape91

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

CPAIOR’02 School on Optimization C. Le Pape92

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

CPAIOR’02 School on Optimization C. Le Pape93

Examples: Scheduling (3)• Minimal perturbation scheduling [El Sakkout & Wallace

00]

– Temporal constraints

– Resource constraints

– Minimize | 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

CPAIOR’02 School on Optimization C. Le Pape94

Outline• Introduction• Problem decomposition• Constraint propagation

– Propagation of global constraints– Objective functions– What ifs

• Search• Conclusion

CPAIOR’02 School on Optimization C. Le Pape95

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

CPAIOR’02 School on Optimization C. Le Pape96

Conclusion (2)

• Main difficulties– Identification of promising combinations of

techniques– Implementation and test of several of these

combinations

CPAIOR’02 School on Optimization C. Le Pape97

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]– …

CPAIOR’02 School on Optimization C. Le Pape98

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

CPAIOR’02 School on Optimization C. Le Pape99

References (1)• 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 Pape100

References (2)• 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 Pape101

References (3)• 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 Pape102

References (4)• 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 Pape103

References (5)• 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.