163
SARA 07 Slide 1 A Framework for Integrating Optimization and Constraint Programming John Hooker Carnegie Mellon University SARA 2007

A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 1

A Framework for Integrating Optimization and Constraint Programming

John HookerCarnegie Mellon University

SARA 2007

Page 2: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 2

Underlying theme

• Model vs. solution method .– How can we match the model with the solution method ?

• Modeling for integrated methods forces the issue.– We can’t formulate the problem for a particular solution

method.

Page 3: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 3

An Exercise in Synthesis

• Analysis takes things apart.• Synthesis looks for commonality.

– Characteristic of 19th century.

• I will provide an overview of several examples.– Look for common patterns ,

not details.

Page 4: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 4

Why unify CP and Operations Research methods?

• One-stop shopping.– One solver does it all.

Page 5: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 5

Why unify CP and OR methods?

• One-stop shopping.– One solver does it all.

• Richer modeling framework.– Natural models, less debugging

& development time.

Page 6: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 6

Why join CP and OR methods?

• One-stop shopping.– One solver does it all.

• Richer modeling framework.– Natural models, less debugging

& development time.

• Computational speedup.– A selection of results…

Page 7: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 7

Computational Advantage of Integrating CP and OR

Using CP + relaxation from MILP

30 to 40 times faster than CP,

MILP

Product configuration

Thorsteinsson & Ottosson (2001)

4 to 150 times faster than MILP.

Flow shop scheduling, etc.

Hooker & Osorio (1999)

2 to 200 times faster than MILP

Piecewise linear costs

Refalo (1999)

2 to 50 times faster than CP

Lesson timetabling

Focacci, Lodi, Milano (1999)

SpeedupProblem

Page 8: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 8

Computational Advantage of Integrating CP and MILP

Using CP + relaxation from MILP

Solved 67 of 90, CP solved only 12

Scheduling with earliness &

tardiness costs

Beck & Refalo(2003)

Up to 600 times faster than MILP.

2 problems: <6 min vs >20 hrs for MILP

Structural design (nonlinear)

Bollapragada, Ghattas & Hooker (2001)

Better than CP in less time

Stable set problem

Van Hoeve(2001)

1 to 10 times faster than CP, MILP

Automatic recording

Sellmann & Fahle (2001)

SpeedupProblem

Page 9: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 9

Computational Advantage of Integrating CP and MILP

Using CP-based Branch and Price

First to solve 8-team instance

Traveling tournament scheduling

Easton, Nemhauser & Trick (2002)

Optimal schedule for 210 trips, vs.

120 for traditional branch and price

Urban transit crew scheduling

Yunes, Moura & de Souza (1999)

SpeedupProblem

Page 10: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 10

Computational Advantage of Integrating CP and MILP

Using CP/MILP Benders methods

Solved previously insoluble problem

in 10 min

Polypropylene batch scheduling

at BASF

Timpe (2002)

10 times faster than Jain & Grossmann

Min-cost planning & scheduling

Thorsteinsson(2001)

20 to 1000 times faster than CP,

MILP

Min-cost planning & scheduing

Jain & Grossmann (2001)

SpeedupProblem

Page 11: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 11

Computational Advantage of Integrating CP and MILP

Using CP/MILP Benders methods

10-1000 times faster than CP,

MILP

Min tardiness planning & cumulative

scheduling

Hooker (2005)

100-1000 times faster than CP,

MILP

Min-cost, min-makespan

planning & cumulative scheduling

Hooker (2004)

Solved twice as many instances

as traditional Benders

Call center schedulingBenoist, Gaudin, Rottembourg(2002)

SpeedupProblem

Page 12: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 12

Modeling is the key

• Models should be explanatory. – As in the natural sciences.

• CP/OR models explain by revealing problem structure.– Through metaconstraints .– Based on CP’s global constraints.

• The model structure drives the solution process.– Each metaconstraint “knows” how to combine CP and OR to

exploit its structure.

Page 13: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 13

The basic algorithm

• Search: Enumerate problem restrictions– Tree search (branching)– Constraint-based (nogood-based) search

Page 14: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 14

The basic algorithm

• Search: Enumerate problem restrictions– Tree search (branching)– Constraint-based (nogood-based) search

• Infer: Deduce constraints from current restriction

Page 15: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 15

The basic algorithm

• Search: Enumerate problem restrictions– Tree search (branching)– Constraint-based (nogood-based) search

• Infer: Deduce constraints from current restriction• Relax : Solve relaxation of current restriction

Page 16: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 16

Unifying framework

• Existing methods are special cases of this framework.

• Integrated methods are also special cases.– Select an overall search scheme.

– Select inference methods as needed from CP, OR.

– Select relaxation methods as needed.

Page 17: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 17

Color code

• Techniques from CP

• Techniques from OR

Page 18: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 18

Some existing methods – Branching

• Constraint solvers (CP)– Search: Branching on domains– Inference: Constraint propagation, filtering

– Relaxation: Domain store

• Mixed integer programming (OR)– Search: Branch and bound

– Inference: Cutting planes– Relaxation: Linear programming

Page 19: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 19

Some existing methods – Constraint-based search

• SAT solvers (CP)– Search: Branching on variables– Inference: Unit clause rule, clause learning (nogoods)

– Relaxation: Conflict clauses

• Benders decomposition (OR)– Search: Enumeration of subproblems

– Inference: Benders cuts (nogoods)– Relaxation: Master problem

Page 20: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 20

OutlineExample problems to illustrate integrated approach

• Branching search– Freight transfer – Product configuration

– Continuous global optimization

– Airline crew scheduling

• Constraint-based search– Propositional satisfiability– Machine scheduling

Page 21: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 21

Example: Freight Transfer

Branch-and-bound search with interval propagation and cutting planes

Page 22: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 22

This example illustrates:

• Branching on variables, with pruning based on bounds.

• Propagation based on:

• Interval propagation.

• Cutting planes (knapsack cuts ).

• Relaxation based on linear programming.

Page 23: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 23

Freight Transfer

• Transport 42 tons of freight using 8 trucks, which come in 4 sizes…

40334

50433

60532

90731

Cost per

truck

Capacity

(tons)

Number available

Truck size

Page 24: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 2440334

50433

60532

90731

Cost per

truck

Capacity

(tons)

Number available

Truck type

+ + ++ + + ≥

+ + + ≤∈

1 2 3 4

1 2 3 4

1 2 3 4

min 90 60 50 40

7 5 4 3 42

8

{0,1,2,3}i

x x x x

x x x x

x x x x

x

Number of trucks of type 1

Page 25: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 2540334

50433

60532

90731

Cost per

truck

Capacity

(tons)

Number available

Truck type

+ + ++ + + ≥

+ + + ≤∈

1 2 3 4

1 2 3 4

1 2 3 4

min 90 60 50 40

7 5 4 3 42

8

{0,1,2,3}i

x x x x

x x x x

x x x x

x

Number of trucks of type 1

Knapsack metaconstraint“knows” which inference and relaxation techniques to use.

Page 26: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 2640334

50433

60532

90731

Cost per

truck

Capacity

(tons)

Number available

Truck type

+ + ++ + + ≥

+ + + ≤∈

1 2 3 4

1 2 3 4

1 2 3 4

min 90 60 50 40

7 5 4 3 42

8

{0,1,2,3}i

x x x x

x x x x

x x x x

x

Number of trucks of type 1

Domainmetaconstraint“knows” how to branch

Page 27: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 27

+ + ++ + + ≥

+ + + ≤∈

1 2 3 4

1 2 3 4

1 2 3 4

min 90 60 50 40

7 5 4 3 42

8

{0,1,2,3}i

x x x x

x x x x

x x x x

x

Bounds propagation

− ⋅ − ⋅ − ⋅ ≥ = 1

42 5 3 4 3 3 31

7x

Page 28: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 28

+ + ++ + + ≥

+ + + ≤∈ ∈

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

min 90 60 50 40

7 5 4 3 42

8

{1,2,3}, , , {0,1,2,3}

x x x x

x x x x

x x x x

x x x x

Bounds propagation

− ⋅ − ⋅ − ⋅ ≥ = 1

42 5 3 4 3 3 31

7x

Reduced domain

Page 29: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 29

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Continuous relaxation

Replace domains with bounds

This is a linear programming problem , which is easy to solve.

Its optimal value provides a lower bound on optimal value of original problem.

Page 30: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 30

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Cutting planes (valid inequalities)

We can create a tighter relaxation (larger minimum value) with the addition of cutting planes .

Page 31: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 31

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Cutting planes (valid inequalities)

All feasible solutions of the original problem satisfy a cutting plane (i.e., it is valid ).

But a cutting plane may exclude (“cut off ”) solutions of the continuous relaxation.

Cutting plane

Feasible solutions

Continuous relaxation

Page 32: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 32

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Cutting planes (valid inequalities)

{1,2} is a packing

…because 7x1 + 5x2 alone cannot satisfy the inequality, even with x1 = x2 = 3.

Page 33: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 33

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Cutting planes (valid inequalities)

{1,2} is a packing

So, + ≥ − ⋅ + ⋅3 44 3 42 (7 3 5 3)x x

Page 34: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 34

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Cutting planes (valid inequalities)

{1,2} is a packing

{ } − ⋅ + ⋅+ ≥ =

3 4

42 (7 3 5 3)2

max 4,3x x

So, + ≥ − ⋅ + ⋅3 44 3 42 (7 3 5 3)x x

which implies

Knapsack cut

Page 35: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 35

+ + ++ + + ≥

+ + + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1 2 3 4

1

min 90 60 50 40

7 5 4 3 42

8

0 3, 1i

x x x x

x x x x

x x x x

x x

Cutting planes (valid inequalities)

x2 + x3 ≥ 3{1,4}

x2 + x4 ≥ 2{1,3}

x3 + x4 ≥ 2{1,2}

Knapsack cutsMaximal Packings

Knapsack cuts corresponding to nonmaximalpackings can be nonredundant.

Page 36: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 36

+ + ++ + + ≥

+

+ ≥+ ≥+ ≥

+ + ≤≤ ≤ ≥

1 2 3 4

1 2 3 4

1

3 4

2 3

2

1

2 3

4

4

min 90 60 50 40

7 5 4 3 42

8

0 3, 1

2

2

3

i

x x x x

x x x x

x x x

x x

x x

x x

x

x x

Continuous relaxation with cuts

Optimal value of 523.3 is a lower bound on optimal value of original problem.

Knapsack cuts

Page 37: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 37

Branch-infer-and-relax tree

Propagate bounds and solve relaxation of original problem.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

Page 38: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 38

Branch on a variable with nonintegral value in the relaxation.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ {1,2}x1 = 3

Branch-infer-and-relax tree

Page 39: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 39

Propagate bounds and solve relaxation.

Since relaxation is infeasible, backtrack.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ {1,2}x1 = 3

Branch-infer-and-relax tree

Page 40: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 40

Propagate bounds and solve relaxation.

Branch on nonintegralvariable.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ { 3}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (3,2.6,2,0)value = 526

x1 ∈ {1,2}x1 = 3

x2 ∈ {0,1,2}

x2 = 3

Branch-infer-and-relax tree

Page 41: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 41

Branch again.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ { 3}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (3,2.6,2,0)value = 526

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 123}x4 ∈ {0123}

x = (3,2,2¾,0)value = 527½

x1 ∈ {1,2}x1 = 3

x2 ∈ {0,1,2}

x2 = 3

x3 ∈ {1,2}x3 = 3

Branch-infer-and-relax tree

Page 42: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 42

Solution of relaxation is integral and therefore feasible in the original problem.

This becomes the incumbent solution .

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ { 3}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (3,2.6,2,0)value = 526

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 123}x4 ∈ {0123}

x = (3,2,2¾,0)value = 527½

x1 ∈ { 3}x2 ∈ { 12 }x3 ∈ { 12 }x4 ∈ { 123}x = (3,2,2,1)value = 530

feasible solution

x1 ∈ {1,2}x1 = 3

x2 ∈ {0,1,2}

x2 = 3

x3 ∈ {1,2}x3 = 3

Branch-infer-and-relax tree

Page 43: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 43

Solution is nonintegral, but we can backtrack because value of relaxation is no better than incumbent solution.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ { 3}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (3,2.6,2,0)value = 526

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 123}x4 ∈ {0123}

x = (3,2,2¾,0)value = 527½

x1 ∈ { 3}x2 ∈ { 12 }x3 ∈ { 12 }x4 ∈ { 123}x = (3,2,2,1)value = 530

feasible solution

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 3}x4 ∈ {012 }

x = (3,1½,3,½)value = 530backtrack

due to bound

x1 ∈ {1,2}x1 = 3

x2 ∈ {0,1,2}

x2 = 3

x3 ∈ {1,2}x3 = 3

Branch-infer-and-relax tree

Page 44: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 44

Another feasible solution found.

No better than incumbent solution, which is optimal because search has finished.

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ { 3}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (3,2.6,2,0)value = 526

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 123}x4 ∈ {0123}

x = (3,2,2¾,0)value = 527½

x1 ∈ { 3}x2 ∈ { 3}x3 ∈ {012 }x4 ∈ {012 }x = (3,3,0,2)value = 530

feasible solution

x1 ∈ { 3}x2 ∈ { 12 }x3 ∈ { 12 }x4 ∈ { 123}x = (3,2,2,1)value = 530

feasible solution

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 3}x4 ∈ {012 }

x = (3,1½,3,½)value = 530backtrack

due to bound

x1 ∈ {1,2}x1 = 3

x2 ∈ {0,1,2}

x2 = 3

x3 ∈ {1,2}x3 = 3

Branch-infer-and-relax tree

Page 45: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 45

Two optimal solutions found.

In general, not all optimal solutions are found,

x1 ∈ { 123}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (2⅓,3,2⅔,0)value = 523⅓

x1 ∈ { 12 }x2 ∈ { 23}x3 ∈ { 123}x4 ∈ { 123}infeasiblerelaxation

x1 ∈ { 3}x2 ∈ {0123}x3 ∈ {0123}x4 ∈ {0123}

x = (3,2.6,2,0)value = 526

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 123}x4 ∈ {0123}

x = (3,2,2¾,0)value = 527½

x1 ∈∈∈∈ { 3}x2 ∈∈∈∈ { 3}x3 ∈∈∈∈ {012 }x4 ∈∈∈∈ {012 }x = (3,3,0,2)value = 530

optimal solution

x1 ∈∈∈∈ { 3}x2 ∈∈∈∈ { 12 }x3 ∈∈∈∈ { 12 }x4 ∈∈∈∈ { 123}x = (3,2,2,1)value = 530

optimal solution

x1 ∈ { 3}x2 ∈ {012 }x3 ∈ { 3}x4 ∈ {012 }

x = (3,1½,3,½)value = 530backtrack

due to bound

x1 ∈ {1,2}x1 = 3

x2 ∈ {0,1,2}

x2 = 3

x3 ∈ {1,2}x3 = 3

Branch-infer-and-relax tree

Page 46: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 46

Other types of cutting planes

• Lifted 0-1 knapsack inequalities

• Clique inequalities

• Gomory cuts

• Mixed integer rounding cuts

• Disjunctive cuts• Specialized cuts

– Flow cuts (fixed charge network flow problem)– Comb inequalities (traveling salesman problem)– Many, many others

Page 47: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 47

Example: Product Configuration

Branch-and-bound search with propagation and relaxation of variable indices .

From: Thorsteinsson and Ottosson (2001)

Page 48: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 48

• This example illustrates:

• Propagation of variable indices. – Variable index is converted to a specially structured

element constraint.

– Specially structured filtering for element.

– Valid knapsack cuts are derived and propagated.

Page 49: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 49

• This example illustrates:

• Propagation of variable indices. – Variable index is converted to a specially structured

element constraint.

– Specially structured filtering for element.

– Valid knapsack cuts are derived and propagated.

• Relaxation of variable indices.– Element is interpreted as a disjunction of linear systems.

– Convex hull relaxation for disjunction is used.

Page 50: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 50

Memory

Memory

Memory

Memory

Memory

Memory

Powersupply

Powersupply

Powersupply

Powersupply

Disk drive

Disk drive

Disk drive

Disk drive

Disk drive

Choose what type of each component, and how many

Personal computer

The problem

Page 51: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 51

Problem data

Page 52: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 52

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

Amount of attribute jproduced

(< 0 if consumed): memory, heat, power,

weight, etc.

Quantity of component i

installed

Model of the problem

Amount of attribute jproduced by type ti

of component i

ti is a variable index

Unit cost of producing attribute j

Page 53: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 53

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

Linear inequality metaconstraint

Model of the problem

Page 54: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 54

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

∑Indexed linear metaconstraint

Model of the problem

Page 55: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 55

To solve it:

• Branch on domains of ti and qi.

• Propagate element constraints and bounds on vj.

– Derive and propagate knapsack cuts.• Relax element.

– Convex hull relaxation for disjunction.

Page 56: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 56

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

Propagation

This is propagated in the usual way

Page 57: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 57

This is rewritten as

Propagation

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

∑This is propagated in the usual way

( )1

, all

element ,( , , , ), , all ,

j ii

i i ij i ijn i

v z j

t q A q A z i j

=∑

Page 58: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 58

This can be propagated by (a) using specialized filters for element constraints of this form…

Propagation

( )1

, all

element ,( , , , ), , all ,

j ii

i i ij i ijn i

v z j

t q A q A z i j

=∑

Page 59: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 59

This is propagated by (a) using specialized filters for element constraints of this form, (b) adding knapsack cuts for the valid inequalities:

is current domain of vj

Propagation

( )1

, all

element ,( , , , ), , all ,

j ii

i i ij i ijn i

v z j

t q A q A z i j

=∑

{ }{ }

max , all

min , all

ti

ti

jijk ik Di

ijk i jk Di

A q v j

A q v j

[ , ]j jv vand (c) propagating the knapsack cuts.

Page 60: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 60

This is relaxed as

jjj vvv ≤≤

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

Relaxation

Page 61: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 61

This is relaxed by relaxing this and adding the knapsack cuts.

This is relaxed as

jjj vvv ≤≤

min

, all

, all

i

j jj

j i ijtik

j j j

c v

v q A j

L v U j

=

≤ ≤

Relaxation

( )1

, all

element ,( , , , ), , all ,

j ii

i i ij i ijn i

v z j

t q A q A z i j

=∑

Page 62: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 62

This is relaxed by writing each element constraint as a disjunction of linear systems and writing a

convex hull relaxation of the disjunction:

( )1

, all

element ,( , , , ), , all ,

j ii

i i ij i ijn i

v z j

t q A q A z i j

=∑

, t ti i

i ijk ik i ikk D k D

z A q q q∈ ∈

= =∑ ∑

Relaxation

Page 63: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 63

So the following LP relaxation is solved at each node of the search tree to obtain a lower bound:

{ }{ }

min

, all

, all

, all

, all

knapsack cuts for max , all

knapsack cuts for min , all

0, all ,

ti

ti

ti

ti

j jj

j ijk iki k D

j ikk D

j j j

i i i

ijk i jk Di

ijk i jk Di

ik

c v

v A q j

q q i

v v v j

q q q i

A q v j

A q v j

q i k

=

=

≤ ≤≤ ≤

∑∑

Relaxation

Page 64: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 64

After propagation, the solution of the relaxation is feasible at the root node. No branching needed.

{ }{ }

min

, all

, all

, all

, all

knapsack cuts for max , all

knapsack cuts for min , all

0, all ,

ti

ti

ti

ti

j jj

j ijk iki k D

j ikk D

j j j

i i i

ijk i jk Di

ijk i jk Di

ik

c v

v A q j

q q i

v v v j

q q q i

A q v j

A q v j

q i k

=

=

≤ ≤≤ ≤

∑∑

Solution of the example

q1, q1C = 1 → t1 = C

q2, q2A = 2 → t2 = A

q3, q3B = 3 → t3 = B

Page 65: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 65

After propagation, the solution of the relaxation is feasible at the root node. No branching needed.

{ }{ }

min

, all

, all

, all

, all

knapsack cuts for max , all

knapsack cuts for min , all

0, all ,

ti

ti

ti

ti

j jj

j ijk iki k D

j ikk D

j j j

i i i

ijk i jk Di

ijk i jk Di

ik

c v

v A q j

q q i

v v v j

q q q i

A q v j

A q v j

q i k

=

=

≤ ≤≤ ≤

∑∑

Solution of the example

q1, q1C = 1 → t1 = C

q2, q2A = 2 → t2 = A

q3, q3B = 3 → t3 = B

q1 is integral, only one q1k is positive

Page 66: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 66

After propagation, the solution of the relaxation is feasible at the root node. No branching needed.

Solution of the example

q1, q1C = 1 → t1 = C

q2, q2A = 2 → t2 = A

q3, q3B = 3 → t3 = B

Memory B

Memory B

Memory B

Powersupply C

Personal computer

Disk drive A

Disk drive A

Page 67: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 67

Example: Continuous Global Optimization

Branching on continuous variables with Lagrangean-based bounds propagation and

linear or convex nonlinear relaxation

Page 68: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 68

This example illustrates:

• Branching by splitting boxes.

• Propagation based on:

• Interval arithmetic.

• Lagrange multipliers.

• Linear relaxation using McCormick factorization.

• The best continuous global solvers (e.g., BARON) combine these tecnniques from CP and OR.

Page 69: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 69

it can be shown that if constraint i is tight,*

*( )ii

U vg x

λ−≤

Where U is an upper bound on the optimal value.

min ( )

( ) 0

f x

g x

x S

≥∈

Supposinghas optimal value v*, and each constraint i has Lagrange multiplier λi*,

Propagation using Lagrange multipliers

Page 70: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 70

it can be shown that if constraint i is tight,*

*( )ii

U vg x

λ−≤

This inequality can be propagated .

min ( )

( ) 0

f x

g x

x S

≥∈

Supposinghas optimal value v*, and each constraint i has Lagrange multiplier λi*,

Propagation using Lagrange multipliers

Page 71: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 71

it can be shown that if constraint i is tight,*

*( )ii

U vg x

λ−≤

This inequality can be propagated .

When applied to bounds on variables, this technique yields bounds propagation .

When the relaxation is linear, this becomes reduced cost variable fixing (widely used in integer programming)

min ( )

( ) 0

f x

g x

x S

≥∈

Supposinghas optimal value v*, and each constraint i has Lagrange multiplier λi*,

Propagation using Lagrange multipliers

Page 72: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 72

Feasible set

Global optimum

Local optimum

x1

x2

The problem

1 2

1 2

1 2

1 2

max

4 1

2 2

[0,1], [0,2]

x x

x x

x x

x x

+=

+ ≤∈ ∈

Page 73: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 73

The Problem

1 2

1 2

1 2

1 2

max

4 1

2 2

[0,1], [0,2]

x x

x x

x x

x x

+=

+ ≤∈ ∈

Linear inequalitymetaconstraint

Page 74: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 74

The Problem

1 2

1 2

1 2

1 2

max

4 1

2 2

[0,1], [0,2]

x x

x x

x x

x x

+=

+ ≤∈ ∈

Bilinear (in)equalitymetaconstraint

Page 75: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 75

To solve it:

• Search : split interval domains of x1, x2.

– Each node of search tree is a problem restriction.

• Propagation: Interval propagation, domain filtering.

– Use Lagrange multipliers to infer valid inequality for propagation.

• Relaxation: Use function factorization to obtain linear continuous relaxation.

Page 76: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 76

Interval propagation

Propagate intervals [0,1], [0,2]

through constraints to obtain

[1/8,7/8], [1/4,7/4]

x1

x2

Page 77: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 77

Relaxation (function factorization)

Factor complex functions into elementary functions that have known linear relaxations.

Write 4x1x2 = 1 as 4y = 1 where y = x1x2.

This factors 4x1x2 into linear function 4y and bilinear function x1x2.

Linear function 4y is its own linear relaxation.

Page 78: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 78

where domain of xj is [ , ]j jx x

Relaxation (function factorization)

Factor complex functions into elementary functions that have known linear relaxations.

Write 4x1x2 = 1 as 4y = 1 where y = x1x2.

This factors 4x1x2 into linear function 4y and bilinear function x1x2.

Linear function 4y is its own linear relaxation.

Bilinear function y = x1x2 has relaxation:

2 1 1 2 1 2 2 1 1 2 1 2

2 1 1 2 1 2 2 1 1 2 1 2

x x x x x x y x x x x x x

x x x x x x y x x x x x x

+ − ≤ ≤ + −+ − ≤ ≤ + −

Page 79: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 79

The linear relaxation becomes:

Relaxation (function factorization)

1 2

1 2

2 1 1 2 1 2 2 1 1 2 1 2

2 1 1 2 1 2 2 1 1 2 1 2

min

4 1

2 2

, 1,2j j j

x x

y

x x

x x x x x x y x x x x x x

x x x x x x y x x x x x x

x x x j

+=+ ≤+ − ≤ ≤ + −+ − ≤ ≤ + −

≤ ≤ =

Page 80: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 80

Solve linear relaxation.

x1

x2

Relaxation (function factorization)

Page 81: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 81

x1

x2

Since solution is infeasible, split an interval and branch.

Solve linear relaxation.

Relaxation (function factorization)

2 [1,1.75]x ∈

2 [0.25,1]x ∈

Page 82: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 82

x1

x2

x1

x2

2 [1,1.75]x ∈ 2 [0.25,1]x ∈

Page 83: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 83

Solution of relaxation is

feasible, value = 1.25

This becomes incumbent

solution

x1

x2

x1

x2

2 [1,1.75]x ∈ 2 [0.25,1]x ∈

Page 84: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 84

Solution of relaxation is

feasible, value = 1.25

This becomes incumbent

solution

x1

x2

x1

x2Solution of

relaxation is not quite feasible,

value = 1.854

Also use Lagrange

multipliers for domain

filtering…

2 [1,1.75]x ∈ 2 [0.25,1]x ∈

Page 85: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 85

1 2

1 2

2 1 1 2 1 2 2 1 1 2 1 2

2 1 1 2 1 2 2 1 1 2 1 2

min

4 1

2 2

, 1,2j j j

x x

y

x x

x x x x x x y x x x x x x

x x x x x x y x x x x x x

x x x j

+=+ ≤+ − ≤ ≤ + −+ − ≤ ≤ + −

≤ ≤ =

Associated Lagrange multiplier in solution of relaxation is λ2 = 1.1

Relaxation (function factorization)

Page 86: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 86

This yields a valid inequality for propagation:

Associated Lagrange multiplier in solution of relaxation is λ2 = 1.1

1 2

1.854 1.252 2 1.451

1.1x x

−+ ≥ − =

Relaxation (function factorization)

Value of relaxation Lagrange multiplier

Value of incumbent solution

1 2

1 2

2 1 1 2 1 2 2 1 1 2 1 2

2 1 1 2 1 2 2 1 1 2 1 2

min

4 1

2 2

, 1,2j j j

x x

y

x x

x x x x x x y x x x x x x

x x x x x x y x x x x x x

x x x j

+=+ ≤+ − ≤ ≤ + −+ − ≤ ≤ + −

≤ ≤ =

Page 87: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 87

Example: Airline Crew Scheduling

Branch and price in which a linear relaxation of an MILP is solved by CP-based column

generation

From: Fahle et al. (2002)

Page 88: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 88

This example illustrates:

• Overall mixed integer programming framework.

• Linear relaxation solved by CP-based column generation.

Page 89: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 89

Solving an LP by column generation

Suppose the LP relaxation of an integer programming problem has a huge number of variables:

min

0

cx

Ax b

x

=≥

Page 90: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 90

Solving an LP by column generation

Suppose the LP relaxation of an integer programming problem has a huge number of variables:

min

0

cx

Ax b

x

=≥

We will solve a restricted master problem , which has a small subset of the variables:

( )

min

0

j jj J

j jj J

j

c x

A x b

x

λ∈

=

∑Column j of A

Page 91: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 91

Solving an LP by column generation

Suppose the LP relaxation of an integer programming problem has a huge number of variables:

min

0

cx

Ax b

x

=≥

We will solve a restricted master problem , which has a small subset of the variables:

( )

min

0

j jj J

j jj J

j

c x

A x b

x

λ∈

=

∑Column j of A

Adding xk to the problem would improve the solution if xk has a negative reduced cost : 0k k kr c Aλ= − <

Row vector of dual (Lagrange) multipliers

Page 92: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 92

Adding xk to the problem would improve the solution if xk has a negative reduced cost: 0k k kr c Aλ= − <

Column generation

Computing the reduced cost of xk is known as pricing xk.

min

is a column of yc y

y A

λ−So we solve the pricing problem :

Cost of column y

Page 93: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 93

Adding xk to the problem would improve the solution if xk has a negative reduced cost: 0k k kr c Aλ= − <

Column generation

Computing the reduced cost of xk is known as pricing xk.

min

is a column of yc y

y A

λ−

This can often be solved by CP.

We hope to find an optimal solution before generating too many columns.

So we solve the pricing problem :

Cost of column y

Page 94: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 94

Airline Crew Scheduling

Flight data

Start time

Finish time

A roster is the sequence of flights assigned to a single crew member.

The gap between two consecutive flights in a roster must be from 2 to 3 hours. Total flight time for a roster must be between 6 and 10 hours.

For example, flight 1 cannot immediately precede 6 flight 4 cannot immediately precede 5.

The possible rosters are:

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

We want to assign crew members to flights to minimize cost while covering the flights and observing complex work rules.

Page 95: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 95

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Page 96: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 96

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Rosters that cover flight 1.

Page 97: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 97

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Rosters that cover flight 2.

Page 98: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 98

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Rosters that cover flight 3.

Page 99: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 99

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Rosters that cover flight 4.

Page 100: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 100

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Rosters that cover flight 5.

Page 101: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 101

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

Rosters that cover flight 6.

Page 102: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 102

Airline Crew Scheduling

There are 2 crew members, and the possible rosters are:1 2 3 4

(1,3,5), (1,4,6), (2,3,5), (2,4,6)

The LP relaxation of the problem is:

= 1 if we assign crew member 1 to roster 2, = 0 otherwise.

Cost c12 of assigning crew member 1 to roster 2

Each crew member is assigned to exactly 1 roster.

Each flight is assigned at least 1 crew member.

In a real problem, there can be millions of rosters.

Page 103: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 103

Airline Crew Scheduling

We start by solving the problem with a subset of the columns:

Optimal dual

solution

u1u2v1v2v3v4v5v6

Page 104: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 104

Airline Crew Scheduling

We start by solving the problem with a subset of the columns:

Dual variables

u1u2v1v2v3v4v5v6

Page 105: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 105

Airline Crew Scheduling

We start by solving the problem with a subset of the columns:

The reduced cost of an excluded roster k for crew member i is

in roster kik i j

j

c u v− − ∑

We will formulate the pricing problem as a shortest path problem.

Dual variables

u1u2v1v2v3v4v5v6

Page 106: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 106

Pricing problem

2

Crew member 1

Crew member 2

Page 107: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 107

Pricing problemEach s-t path corresponds to a roster, provided the flight time is within bounds.

2

Crew member 1

Crew member 2

Page 108: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 108

Pricing problemCost of flight 3 if it immediately follows flight 1, offset by dual multiplier for flight 1

2

Crew member 1

Crew member 2

Page 109: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 109

Pricing problemCost of transferring from home to flight 1, offset by dual multiplier for crew member 1

Dual multiplier omitted to break symmetry

2

Crew member 1

Crew member 2

Page 110: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 110

Pricing problemLength of a path is reduced cost of the corresponding roster.

2

Crew member 1

Crew member 2

Page 111: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 111

Crew member 1

Crew member 2

Pricing problemArc lengths using dual solution of LP relaxation

−105 2

2

0

3

4

5 6−1

05 2

2

-9

3

4

5 6−1

2

Page 112: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 112

Crew member 1

Crew member 2

Pricing problem

Solution of shortest path problems

−105 2

2

0

3

4

5 6−1

05 2

2

-9

3

4

5 6−1

2

Reduced cost = −1Add x12 to problem.

Reduced cost = −2Add x23 to problem.

After x12 and x23 are added to the problem, no remaining variable has negative reduced cost.

Page 113: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 113

Pricing problem

The shortest path problem cannot be solved by traditional shortest path algorithms, due to the bounds on total path length.

It can be solved by CP:

( ){ }

min max

Path( , , ), all flights

flights , 0, all i

i i

j jj X

i i

X z G i

T f s T

X z i∈

≤ − ≤

⊂ <

Set of flights assigned to crew member i

Path length Graph

Path global constraint

Setsum global constraint

Duration of flight j

Page 114: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 114

Example: Propositional Satisfiability

Constraint-directed search using conflict clauses as nogoods

Page 115: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 115

This example illustrates:

• Constraint-based search

• Branching in Davis-Putnam-Loveland (DPL) method is reinterpreted as constraint-based search.

• Propagation based on unit clause rule, inference of nogoods.

• Nogoods are conflict clauses.

• Relaxation that consists of current nogood set.

Page 116: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 116

Constraint-directed search

• Search over partial assignments to variables.

• Next partial assignment must satisfy nogoods so far accumulated (the master problem ).

• Generate nogood for current partial assignment.

• Try to solve for the values of the remaining variables (i.e., solve the subproblem ).

• If there is no solution, the nogood should exclude this partial assignment and perhaps others.

• Terminate when the subproblem has a solution.

• Or in an optimization problem, when the subproblem has the same value as the master problem.

Page 117: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 117

42

32

41

31

432

431

652

652

651

651

xx

xx

xx

xx

xxx

xxx

xxx

xxx

xxx

xxx

∨∨∨∨

∨∨∨∨∨∨∨∨∨∨∨∨

Find a satisfying solution.

The problem

Page 118: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 118

42

32

41

31

432

431

652

652

651

651

xx

xx

xx

xx

xxx

xxx

xxx

xxx

xxx

xxx

∨∨∨∨

∨∨∨∨∨∨∨∨∨∨∨∨

Find a satisfying solution.

The problem

CNF metaconstraint

Page 119: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 119

To solve it by branching (DPL):

• Search : branch on xj.– Each node of search tree is a problem restriction.

Page 120: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 120

To solve it by branching (DPL):

• Search : branch on xj.– Each node of search tree is a problem restriction.

• Infer: clause learning, unit clause rule.

Page 121: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 121

To solve it by branching (DPL):

• Search : branch on xj.– Each node of search tree is a problem restriction.

• Infer: clause learning, unit clause rule. • Relax: not used.

Page 122: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 122

01 =x

02 =x

03 =x

04 =x

05 =x

Branching

Branch to here. Unit clause rule proves infeasibility.

(x1,x5) = (0,0) creates the conflict.

Page 123: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 123

01 =x

02 =x

03 =x

04 =x

05 =x

Branching

Branch to here. Unit clause rule proves infeasibility.

(x1,x5) = (0,0) creates the conflict.51 xx ∨

Add conflict clause to constraint set.

Page 124: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 124

01 =x

02 =x

03 =x

04 =x

05 =x 15 =x

Branching

Backtrack and branch to here.

(x1,x5) = (0,1) creates the conflict.

Generate conflict clause

51 xx ∨ 52 xx ∨

Page 125: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 125

Backtrack and branch to here.

(x1,x5) = (0,1) creates the conflict.

Generate conflict clause

01 =x

02 =x

03 =x

04 =x

05 =x 15 =x

Branching

51 xx ∨ 52 xx ∨

Backtrack to here and note that (x1,x2) = (0,0) is enough to create conflict.

Generate new conflict clause

21 xx ∨

Page 126: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 126

01 =x

02 =x 12 =x

03 =x

04 =x

05 =x 15 =x

Branching

51 xx ∨ 52 xx ∨21 xx ∨

Backtrack and branch to here and generate conflict clause

21 xx ∨

Page 127: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 127

01 =x

02 =x 12 =x

03 =x

04 =x

05 =x 15 =x

Branching

51 xx ∨ 52 xx ∨21 xx ∨

Backtrack and branch to here and generate conflict clause

21 xx ∨

Backtrack to here and generate new conflict

clause

1x

Page 128: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 128

01 =x 11 =x

02 =x

03 =x

04 =x

05 =x 15 =x

Branching

51 xx ∨ 52 xx ∨21 xx ∨

21 xx ∨1x

Backtrack and branch to here and generate final conflict clause1x

Page 129: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 129

To solve it by constraint-directed search:

• Search : generate partial assignments.– Each leaf node of search tree corresponds to a partial

assignment.

Page 130: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 130

To solve it by constraint-directed search:

• Search : generate partial assignments.– Each leaf node of search tree is a partial assignment.

• Infer: generate nogoods (conflict clauses).– Process nogoods in current relaxation with parallel

resolution .

Page 131: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 131

To solve it by constraint-directed search:

• Search : generate partial assignments.– Each leaf node of search tree is a problem restriction.

• Infer: generate nogoods (conflict clauses).– Process nogoods in current relaxation with parallel

resolution .

• Relax: Relaxation Rk consists of current processed nogoods.

Page 132: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 132

To solve it by constraint-directed search:

• Search : generate partial assignments.– Each leaf node of search tree is a problem restriction.

• Infer: generate nogoods (conflict clauses).– Process nogoods in current relaxation with parallel

resolution .

• Relax: Relaxation Rk consists of current processed nogoods.– Select solution of relaxation as in chronological

backtracking.

Page 133: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 133

01 =x

02 =x

03 =x

04 =x

05 =x

Constraint-Directed Search

51 xx ∨

51

51

1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

xx

xx

RRk kk

∨∨⋅

Conflict clause appears as nogoodinduced by solution of Rk.

Page 134: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 134

01 =x

02 =x

03 =x

04 =x

05 =x 15 =x

Constraint-Directed Search

51 xx ∨ 52 xx ∨

5251

51

),1,0,0,0,0(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

xxxx

xx

RRk kk

∨⋅∨∨⋅

Consists of processed nogoods

Page 135: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 135

01 =x

02 =x

03 =x

04 =x

05 =x 15 =x

Constraint-Directed Search

51 xx ∨ 52 xx ∨21 xx ∨

21

5251

51

2

),1,0,0,0,0(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

xx

xxxx

xx

RRk kk

∨∨⋅∨∨⋅

52

51

xx

xx

∨∨

parallel-resolve to yield 21 xx ∨

21 xx ∨ parallel-absorbs52

51

xx

xx

∨∨

Consists of processed nogoods

Page 136: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 136

1

2121

5251

51

3

),,,,1,0(2

),1,0,0,0,0(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

x

xxxx

xxxx

xx

RRk kk

∨⋅⋅⋅⋅∨∨⋅∨∨⋅

01 =x

02 =x 12 =x

03 =x

04 =x

05 =x 15 =x

Constraint-Directed Search

51 xx ∨ 52 xx ∨21 xx ∨

21 xx ∨1x

21

21

xx

xx

∨∨

parallel-resolve to yield 1x

Page 137: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 137

01 =x 11 =x

02 =x

03 =x

04 =x

05 =x 15 =x

Constraint-Directed Search

51 xx ∨ 52 xx ∨21 xx ∨

21 xx ∨1x

1x

∅⋅⋅⋅⋅⋅

∨⋅⋅⋅⋅∨∨⋅∨∨⋅

4

),,,,,1(3

),,,,1,0(2

),1,0,0,0,0(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

11

2121

5251

51

xx

xxxx

xxxx

xx

RRk kk

Search terminates

Page 138: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 138

Partial-order dynamic backtracking

• Slight variation of previous algorithm– Select solution of relaxation that conforms to current

nogood set.

– More freedom than in branching.

Page 139: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 139

51

15

1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

xx

xx

RRk kk

∨∨⋅

Arbitrarily choose one variable to be last

Partial Order Dynamic Backtracking

Page 140: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 140

51

15

1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

xx

xx

RRk kk

∨∨⋅

Arbitrarily choose one variable to be last

Other variables are penultimate

Partial Order Dynamic Backtracking

Page 141: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 141

2

),0,,,,1(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

51

15

⋅⋅⋅⋅∨∨⋅

xx

xx

RRk kk

Since x5 is penultimate in at least one nogood, it must conform to nogoods.

It must take value opposite its sign in the nogoods.

x5 will have the same sign in all nogoodswhere it is penultimate.

This allows more freedom than chronological backtracking.

Partial Order Dynamic Backtracking

Page 142: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 142

2

),0,,,,1(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

1551

15

xxxx

xx

RRk kk

∨⋅⋅⋅⋅∨∨⋅

Since x5 is penultimate in at least one nogood, it must conform to nogoods.

It must take value opposite its sign in the nogoods.

x5 will have the same sign in all nogoodswhere it is penultimate.

This allows more freedom than chronological backtracking.

Partial Order Dynamic Backtracking

Choice of lastvariable is arbitrary

but must be consistent with partial order

implied by previous choices.

Page 143: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 143

5

1551

15

2

),0,,,,1(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

x

xxxx

xx

RRk kk

∨⋅⋅⋅⋅∨∨⋅

Since x5 is penultimate in at least one nogood, it must conform to nogoods.

It must take value opposite its sign in the nogoods.

x5 will have the same sign in all nogoodswhere it is penultimate.

This allows more freedom than chronological backtracking.

Partial Order Dynamic Backtracking

15

15

xx

xx

∨∨

Parallel-resolve to yield 5x

Choice of lastvariable is arbitrary

but must be consistent with partial order

implied by previous choices.

Page 144: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 144

∨⋅⋅⋅⋅∨⋅⋅⋅⋅∨∨⋅

25

5

255

1551

15

3

),1,,,0,(2

),0,,,,1(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

xx

xxxx

xxxx

xx

RRk kk

does not parallel-resolve with

Partial Order Dynamic Backtracking

5x25 xx ∨

because x5 is not last in both clauses

Page 145: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 145

⋅⋅⋅⋅

∨⋅⋅⋅⋅∨⋅⋅⋅⋅∨∨⋅

4

),1,,,1,(3

),1,,,0,(2

),0,,,,1(1

),0,0,0,0,0(0

Nogoods ofSolution Relaxation

225

5

255

1551

15

xxx

xxxx

xxxx

xx

RRk kk

Partial Order Dynamic Backtracking

Must conformSearch

terminates

Page 146: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 146

Page 147: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 147

Example: Machine Scheduling

Constraint-directed search using logic-based Benders decomposition

Page 148: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 148

This example illustrates:

• Constraint-based search as Benders decomposition

• Nogoods are Benders cuts .

• Solution of the master problem by MILP.

• Allocate jobs to machines.

• Solution of the subproblem by CP.

• Schedule jobs on each machine

Page 149: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 149

Constraint-directed search in which the master problem contains a fixed set of variables x.

Benders decomposition

Applied to problems of the form

min ( , )

( , )

,x y

f x y

S x y

x D y D∈ ∈

When x is fixed to some value, the resulting subproblem is much easier:

min ( , )

( , )

y

f x y

S x y

y D∈

…perhaps because it decouples into smaller problems.

Page 150: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 150

Constraint-directed search in which the master problem contains a fixed set of variables x.

Benders decomposition

Applied to problems of the form

min ( , )

( , )

,x y

f x y

S x y

x D y D∈ ∈

When x is fixed to some value, the resulting subproblem is much easier:

min ( , )

( , )

y

f x y

S x y

y D∈

…perhaps because it decouples into smaller problems.

Nogoods are Benders cuts and exclude solutions no better than x.

The Benders cut is obtained by solving the inference dual of the subproblem (classically , the linear programming dual).

Page 151: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 151

Machine Scheduling

• Assign 5 jobs to 2 machines (A and B), and schedule the machines assigned to each machine within time windows.

• The objective is to minimize makespan .

• Assign the jobs in the master problem , to be solved by MILP.

• Schedule the jobs in the subproblem , to be solved by CP.

Time lapse between start of first job and end of last job.

Page 152: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 152

Machine Scheduling

Job Data Once jobs are assigned, we can minimize overall makespan by minimizing makespan on each machine individually.

So the subproblem decouples.

Machine A

Machine B

Page 153: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 153

Machine Scheduling

Job Data Once jobs are assigned, we can minimize overall makespan by minimizing makespan on each machine individually.

So the subproblem decouples.

Minimum makespanschedule for jobs 1, 2, 3, 5

on machine A

Page 154: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 154

Machine Scheduling

( )

min

, all

, all

disjunctive ( ),( ) , all

j

j

j x j

j j j x j

j j ij j

M

M s p j

r s d p j

s x i p x i i

≥ +

≤ ≤ −

= =

Start time of job j

Time windowsJobs cannot overlap

The problem is

Page 155: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 155

Machine Scheduling

( )

min

, all

, all

disjunctive ( ),( ) , all

j

j

j x j

j j j x j

j j ij j

M

M s p j

r s d p j

s x i p x i i

≥ +

≤ ≤ −

= =

The problem is

Indexed linear metaconstraint

Page 156: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 156

Machine Scheduling

( )

min

, all

, all

disjunctive ( ),( ) , all

j

j

j x j

j j j x j

j j ij j

M

M s p j

r s d p j

s x i p x i i

≥ +

≤ ≤ −

= =

The problem is

Specially-structured indexed linear metaconstraint

Disjunctive scheduling metaconstraint

Page 157: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 157

Machine Scheduling

( )

min

, all

, all

disjunctive ( ),( ) , all

j

j

j x j

j j j x j

j j ij j

M

M s p j

r s d p j

s x i p x i i

≥ +

≤ ≤ −

= =

Start time of job j

Time windowsJobs cannot overlap

The problem is

For a fixed assignment the subproblem on each machine i is

( )

min

, all with

, all with

disjunctive ( ),( )

j

j

j x j j

j j j x j j

j j ij j

M

M s p j x i

r s d p j x i

s x i p x i

≥ + =

≤ ≤ − =

= =

x

Page 158: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 158

Benders cuts

Suppose we assign jobs 1,2,3,5 to machine A in iteration k.

We can prove that 10 is the optimal makespan by proving that the schedule is infeasible with makespan 9.

Edge finding derives infeasibility by reasoning only with jobs 2,3,5. So these jobs alone create a minimum makespan of 10.

So we have a Benders cut2 3 4

1

10 if ( )

0 otherwisek

x x x Av B x+

= = =≥ =

Page 159: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 159

Benders cuts

We want the master problem to be an MILP, which is good for assignment problems.

So we write the Benders cut2 3 4

1

10 if ( )

0 otherwisek

x x x Av B x+

= = =≥ =

Using 0-1 variables: ( )2 3 510 2

0A A Av x x x

v

≥ + + −≥ = 1 if job 5 is

assigned to machine A

Page 160: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 160

Master problem

The master problem is an MILP:

{ }

5

1

5

1

5 5

1 3

2 3 5

4

min

10, etc.

10, etc.

, 2 , etc., ,

v 10( 2)

8

0,1

Aj Ajj

Bj Bjj

ij ij ij ijj j

A A A

B

ij

v

p x

p x

v p x v p x i A B

x x x

v x

x

=

=

= =

≥ ≥ + =

≥ + + −≥∈

∑ ∑

Constraints derived from time windows

Constraints derived from release times

Benders cut from machine A

Benders cut from machine B

Page 161: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 161

Stronger Benders cuts

If all release times are the same, we can strengthen the Benders cuts.

We are now using the cut 1

ik

ik ij ikj J

v M x J∈

≥ − +

Min makespanon machine iin iteration k

Set of jobs assigned to machine i in iteration k

A stronger cut provides a useful bound even if only some of the jobs in Jik are assigned to machine i: (1 )

ik

ik ij ijj J

v M x p∈

≥ − −∑

These results can be generalized to cumulative scheduling .

Page 162: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 162

Background Reading

Most of this talk is based on:

• J. N. Hooker, Integrated Methods for Optimization, Springer (2007).

• J. N. Hooker, Operations research methods in constraint programming, in F. Rossi, P. van Beek and T. Walsh, eds., Handbook of Constraint Programming, Elsevier (2006) 527-570.

Cited references:• T. Fahle, U. Junker, S. E. Karish, N. Kohn, M. Sellmann, B. Vaaben. Constraint programming based column generation for crew assignment, Journal of Heuristics 8 (2002) 59-81 • E. Thorsteinsson and G. Ottosson, Linear relaxation and reduced-cost based propagation of continuous variable subscripts, Annals of Operations Research 115 (2001) 15-29.

Page 163: A Framework for Integrating Optimization and Constraint ...public.tepper.cmu.edu/jnh/sara07.pdf · • Existing methods are special cases of this framework . • Integrated methods

SARA 07 Slide 163