1 logic-based benders methods for planning and scheduling john hooker carnegie mellon university...

35
1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

Post on 18-Dec-2015

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

1

Logic-Based Benders Methods for Planning and Scheduling

John HookerCarnegie Mellon University

August 2003

Page 2: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

2

• Schedule jobs on several machines.• Each job consumes some resource at a given rate.• Resource consumption rate on each machine must not exceed capacity.• Special case: jobs do not overlap.

The Problem:Multiple-machine resource-constrained scheduling

• Apply logic-based Benders decomposition• Generalizes Benders to any subproblem (not just LP, NLP).• Solve with MILP and CP (constraint programming).

Page 3: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

3

• Decompose problem into

assignment + resource-constrained assign jobs scheduling to machines schedule jobs on each machine

Basic Idea

• Use logic-based Benders scheme to link these.• Solve: master problem with MILP -- good at resource allocation subproblem with CP -- good at scheduling

• Applications in manufacturing/supply chain planning & scheduling.

Page 4: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

4

Previous Work

1989 (Jeroslow & Wang) – View Horn SAT dual as inference problem.

1995 (JH & Yan) – Apply logic-based Benders to circuit verification.• Better than BDDs when circuit contains error.

1995, 2000 (JH) – Formulate general logic-based Benders.• Specialized Benders cuts must be designed for each problem class.• Branch-and-check proposed.

2001 (Jain & Grossmann) – Apply logic-based Benders to multiple-machine scheduling using CP/MILP.

• Several orders of magnitude speedup wrt CPLEX, ILOG Scheduler. • But… easy problem for Benders approach (min cost).

Page 5: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

5

2001 (Thorsteinsson) – Apply branch-and-check to CP/MILP.• 1-2 orders of magnitude speedup on multiple machine scheduling.

2002 (JH, Ottosson) – Apply logic-based Benders to SAT, IP.

2003 (JH, Yan) – Relaxation for resource-constrained scheduling (cumulative constraint).

• Not useful computationally for planning and scheduling.• A simpler relaxation works better.

Today – Apply logic-based Benders to resource-constrained planning/scheduling problems.

• Multiple machines, parallel processing with resource constraint on each machine• Min cost and min makespan.

Page 6: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

6

Single-machine resource-constrained scheduling

dj = duration of job j rj = rate of resource consumption of job jL = resources available[aj,bj] = time window for job j

Makespan

L

job 1

job 2

job 3

job 4

job 5resources

timed1

r1

Total resource consumption L at all times.

Page 7: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

7

Multiple-machine resource-constrained scheduling

dij = duration of job j on machine irij = resource consumption of job j on machine iLi = resources available on machine i

L1

job 1

job 2

job 3

job 4

job 5

d11

r11

Total resource consumption Li at all times.

L2

d22

r22

Machine 1 Machine 2

Page 8: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

8

Some Possible Objectives

Minimize cost = ij

ijij xc

Cost of assigning job j to machine i

= 1 if job j assigned to machine i

Minimize makespan = ijjij

dt max

Start time of job j

Minimize tardiness = ij

jijj bdt,0max

Deadline for job j

Page 9: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

9

}1,0{

1 with , all,0

with , all,0

, all,

all,1subject to

min

'

''

ijt

ijijt

jijjijt

ij

ttdt

tijtij

itijt

ijtijtij

x

dNttjx

atdbtjx

tiLxr

jx

xc

ij

Minimize Cost: Discrete Time MILP Model

Job j starts at one time on one machine

Jobs underway at time t consume Li in resources

Jobs observe time windows

= 1 if job j starts at time point ton machine i (t = 1,…,N)

Page 10: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

10

Minimize Cost: Discrete Event MILP Model

continued

, all ,

all ,1

all,1,1subject to

min

1, ikki

kijk

kijk

ijijkijk

ikijk

ikijk

ijkijkij

tt

jiyx

kyx

jyx

xc

= 1 if event k is start of job j on machine i (k = 1,…,2N)

= 1 if event k is end of job

Each job is assigned to one machine and starts once and ends once

Events in chronological order

Start time of event k (disaggregated by machine)

Page 11: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

11

}1,0{,

, all,

, all,,,

, all,

,, all),1()1(

,, all),1()1(

,, all,,

1,

11

ijkijk

ikf

ikkisik

j jijkij

fikijkij

sik

sii

iik

ijkikijijkik

ijkijkikikijijkikijik

jijikijkj

yx

kiRRRR

kiyrRxrRRR

kiLR

kjiyMtfyMt

kjixMxdtfxMxdt

kjibftxa

Release date and deadline

Definition of finish time

Finish time of job j (disaggregated by machine)

Resource limit

Calculation of resource consumption on machine i at time of each event

Page 12: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

12

L

rr

dd

tt

n

n

n

),,(

),,(

),,(

cumulative1

1

1

tLr

ijjj dttt

jj all,

CP: The Cumulative Constraint

is equivalent to

Schedules jobs at times t1, …, tn so as to observe resource constraint.

Edge-finding algorithms, etc., reduce domains of tj.

Page 13: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

13

jdbta

i

L

iyr

iyd

iyt

c

jyjjj

i

jij

jij

jj

jjy

j

j

all,

all,)|(

)|(

)|(

cumulativesubject to

min

Minimize Cost: CP Model

Observe time windows Observe resource limit on each machine

yj = machine assigned to job j

start times of jobs assigned to machine i

Page 14: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

14

[Declarations]DiscreteResource machine [i in Machines] (Limit [i ]);AlternativeResources mset(machine);Activity sched [ j in Jobs];

minimize sum( j in Jobs) cost [ j ]subject to { forall( j in Jobs) { sched [ j ] requires(jobm[i,j ].resource) mset; forall(i in Machines) activityHasSelectedResource(sched [ j ],mset,machine[ j ]) <=> sched [ j ].duration = jobm[i,j ].duration & cost [ j ] = jobm[i,j ].cost; sched [ j ].start >= job[ j ].release; sched [ j ].end <= job[ j ].deadline; };};search { assignAlternatives; setTimes;};

This is how it looks in OPL Studio…

enforces cumulativeassigns jobs to machines

defines resource requirements

determines cost and durations on the assigned machine

time windows

invokes specialized search procedure (needed for good performance)

Page 15: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

15

Inference Duality

zxfSx

z

Dx

Sx

xfDx

)(subject to

max

subject to

)(min

Primal Dual

Solution is a value for x. Solution is a proof that deduces f(x) z from x S.

Duality theorem based on completeness proof for inference method.

domainfeasible set

Page 16: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

16

Example of Inference Duality: Linear Programming

zcxbAx

z

x

bAx

cxx

0

subject to

max

0

subject to

min

Primal Dual

Solution is a proof that deduces cx z from Ax b, encoded as a vector of multipliers u.Farkas Lemma

(Completeness theorem for nonnegative linear combination

as an inference method)Ax b cx z iff uA c, ub z for some u 0 (provided primal or dual is feasible).

Farkas Lemma provides basis for classical LP duality theorem.

Since u has polynomial size, LP belongs to NP and co-NP.

Page 17: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

17

y

y

yx

x

zx

Dy

Syx

yxf

DyDx

kxBz

z

k

),(subject to

),(min

,

all),(subject to

min,

Logic-Based Benders Decomposition

Master Problem Subproblem

Benders cuts for all iterations k

yx DyDx

Syx

yxf

,

),(subject to

),(min

Solution of subproblem’s inference dual is a proof of bound that is valid when )(xBz x xx Benders cut is based on bound obtained from the same proof schema for other values of x.

Solution of master problem

Page 18: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

18

0

)(s.t.

)(min

all)),(()(s.t.

min,

y

xgbAy

cyxf

Dx

kxgbuxfz

zy

x

kzx

Example: Classical Benders

Master Problem Subproblem

Benders cuts

0,

)(subject to

)(min

yDx

bAyxg

cyxf

x

Solution of subproblem’s inference dual is a proof (encoded by u) of bound ))(()( xgbuxfz

Benders cut is based on bound obtained from u, which remains dual feasible (i.e., proof remains valid) for other values of x.

Page 19: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

19

Minimize Cost: Logic-Based Benders

cuts Benders

all,max

all,1subject to

min

ibLxrd

jx

xc

jj

jiijijij

iij

ijijij

Master Problem: Assign jobs to machines

Relaxation of subproblem: “Area” dijrij of jobs assigned to a machine fit in the space available before latest deadline.

L1

job1 job 4 job 5 jj

bmax

Page 20: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

20

i

btaL

xr

xd

xt

jjj

i

ijij

ijij

ijj

all,)1|(

)1|(

)1|(

cumulative

Subproblem: Schedule jobs assigned to each machineSolve by constraint programming

solution of master problem

Let Jik = set of jobs assigned to machine i in iteration k.If subproblem i is infeasible, solution of subproblem dual is a proof that not all jobs in Jik can be assigned to machine i.This provides the basis for a (trivial) Benders cut.

Page 21: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

21

}1,0{

, all,1)1(

all,max

all,1subject to

min

ij

Jjij

jj

jiijijij

iij

ijijij

x

kix

ibLxrd

jx

xc

ik

Master Problem with Benders CutsSolve by MILP

Benders cuts

Page 22: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

22

Important observation: Putting a relaxation of subproblem in the master problem is essential for success.

Min cost Min makespan

Objective function Computed in master problem, which yields tighter bounds for MILP

Available only thru Benders cuts.

Subproblem Feasibility problem, simple Benders cuts

Optimization problem (harder for CP), more interesting cuts

Relaxation Trivial More interesting, nice duality with cuts

Min cost problem is particularly easy for logic-based decomposition:

Page 23: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

23

cuts Benders

all,

all,1subject to

min

iL

xrd

T

jx

T

i

jijijij

iij

Minimize Makespan: Logic-Based Benders

Relaxation of subproblem: “Area” of jobs provides lower bound on makespan.

L1

job1 job 4 job 5

Master Problem: Assign jobs to machines

makespan

Page 24: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

24

i

jbtaL

xr

xd

xt

jdtT

T

jjj

i

ijij

ijij

ijj

ijj

all,

all,

)1|(

)1|(

)1|(

cumulative

all,

subject to

min

Subproblem: Schedule jobs assigned to each machineSolve by constraint programming

Let Jik = set of jobs assigned to machine i in iteration k.

We get a Benders cut even when subproblem is feasible.

Page 25: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

25

Duality of Linear Relaxation and Linear Benders Cuts

L1

job1 job 4 job 5

Relaxation:Lower bound on makespan

job 1 job 4 job 5

Benders cut:Lower bounds on makespan as jobs are removed from machine

Minimum makespan for machine i in subproblem

Page 26: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

26

}1,0{

)1(

all,

all,1subject to

min

ij

Jjijijk

i

jijijij

iij

x

dxTT

iL

xrd

T

jx

T

ik

Master Problem: Assign jobs to machinesSolve by MILP

Benders cuts

Relaxation

Page 27: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

27

Experimental Design

2 Machines

3 Machines

4 Machines

CP(ILOG Scheduler)

6, 8, 10, … jobs*

6, 8, 10, … jobs

6, 8, 10, … jobs

MILP(Discrete time model**)

6, 8, 10, … jobs

6, 8, 10, … jobs

6, 8, 10, … jobs

Hybrid 6, 8, 10, … jobs

6, 8, 10, … jobs

6, 8, 10, … jobs

*1 problem instance each** Discrete event model solved none of the problems

Page 28: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

28

Min Cost, 2 MachinesLogarithmic scale

0.01

0.1

1

10

100

1000

10000

5 10 15 20 25

Jobs

Sec

CP

MILP

Hybrid

= computation terminated

Page 29: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

29

Min Cost, 2 MachinesLinear scale

0

1000

2000

3000

4000

5000

6000

5 10 15 20 25

Jobs

Sec

CP

MILP

Hybrid

Page 30: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

30

Min Cost, 3 MachinesLogarithmic scale

0.01

0.1

1

10

100

1000

10000

5 7 9 11 13 15 17

Jobs

Sec

CP

MILP

Hybrid

Page 31: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

31

Min Cost, 4 MachinesLogarithmic scale

0.01

0.1

1

10

100

1000

10000

5 7 9 11 13 15 17

Jobs

Sec

CP

MILP

Hybrid

Page 32: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

32

Min Makespan, 2 MachinesLogarithmic scale

0.01

0.1

1

10

100

1000

5 7 9 11 13 15 17

Jobs

Sec CP

Hybrid

Page 33: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

33

Min Makespan, 3 MachinesLogarithmic scale

0.01

0.1

1

10

100

1000

10000

5 10 15 20

Jobs

Sec

CP

Hybrid

Page 34: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

34

Min Makespan, 4 MachinesLogarithmic scale

0.01

0.1

1

10

100

1000

10000

5 10 15 20 25 30

Jobs

Sec

CP

Hybrid

Page 35: 1 Logic-Based Benders Methods for Planning and Scheduling John Hooker Carnegie Mellon University August 2003

35

Min Tardiness

1

10

5 6 7 8 9 10

Jobs

Sec ?