1 Planning and Scheduling to Minimize Tardiness John Hooker Carnegie Mellon University September...

Preview:

Citation preview

1

Planning and Scheduling to Minimize Tardiness

John HookerCarnegie Mellon University

September 2005

2

The Problem

Given a set of tasks, each with a deadline…

3

The Problem

Given a set of tasks, each with a deadline…

…and processing facilities that run at different speeds.

4

The Problem

Allocate tasks to facilities.

5

The Problem

Allocate tasks to facilities.

Schedule tasks on each facility(cumulative scheduling)

6

The Problem

Schedule tasks on each facility(cumulative scheduling)

Each task has a given processing time on each facility.

Allocate tasks to facilities.

7

The Problem

Schedule tasks on each facility(cumulative scheduling)

Each task has a given processing time on each facility.

Each task consumes resources at a given rate on each facility.

Allocate tasks to facilities.

8

The Problem

Schedule tasks on each facility(cumulative scheduling)

Each task has a given processing time on each facility.

Each task consumes resources at a given rate on each facility.

Each facility has a resource limit.

Allocate tasks to facilities.

9

The Problem

Schedule tasks on each facility(cumulative scheduling)

Objectives:

Minimize number of late tasks.

Minimize total tardiness

Allocate tasks to facilities.

10

In practice, problem is often solved by give-and-take.

Approach

Planner

Schedulers

Planner allocates tasks

to facilities

11

In practice, problem is often solved by give-and-take.

Approach

Planner

Schedulers

If there are problems, schedulers telephone planners and ask for a

different allocation.

12

In practice, problem is often solved by give-and-take.

Approach

Planner

Schedulers

Planner allocates tasks

differently

13

In practice, problem is often solved by give-and-take.

Approach

Planner

Schedulers

And so forth until agreement is reached.

14

In practice, problem is often solved by give-and-take.

Approach

Planner

Schedulers

And so forth until agreement is reached.

Benders decomposition is a mathematical formulation of this process.

Planning is the master problem. Scheduling is the subproblem. Telephone calls are Benders cuts.

15

Decomposition permits hybrid solution: Apply MILP to planning master problem.

MILP is generally better at resource allocation. Apply CP to scheduling subproblem.

CP is generally better at scheduling.

Approach

Use logic-based Benders. Since classical Benders requires that the subproblem be a linear or nonlinear programming problem.

16

Related Work

1995 (JH & Yan) – Logic-based Benders. Applied to logic circuit verification.

2000 (JH) – Theory of logic-based Benders. Branch-and-check proposed.

2000 (JH) – Application to planning & scheduling proposed. Combine CP & MILP. Application to integer programming, SAT.

2001 (Jain & Grossmann) – Application to machine assignment and disjunctive scheduling.

Simple Benders cuts, since subproblem is a feasibility problem.

17

Related Work

2001 (Thorsteinsson) – Branch and check applied to Jain & Grossmann problems.

Update solution of master problem.

2002 (Harjunkowski & Grossmann) – Generalization of Jain & Grossmann to multistage.

2002 (Timpe) – Polypropylene batch scheduling at BASF. Similar approach applied to automobile assembly (Peugeot/Citroën), paint mixing (Barbot).

2003 (JH, Ottosson) – Integer programming. Benders cuts less obvious, since subproblem is an optimization problem. Suitable for stochastic integer programming.

18

Related Work

2004 (JH) – Min-cost and min-makespan planning & cumulative scheduling.

Benders cuts less obvious in min makespan, since subproblem is optimization problem.

2004 (Cambazard et al.) – Real-time scheduling of computer processes.

CP master problem.

2004 (Chiu & Xia) – Integer programming. Used min-conflict + classical Benders cuts.

2004 (Maravelias and Grossmann) – Batch scheduling in chemical plants.

2004 (Correa, Langevin & Rousseau) – Automated guided vehicles.

19

Today’s Presentation

Planning and cumulative scheduling to minimize tardiness.

Number of late jobs.

Total tardiness.

Main contribution:

Analysis of cumulative constraint to provide linear relaxation of the scheduling subproblem.

This is most difficult when minimizing total tardiness.

Add relaxation to master problem.

The relaxation is essential to computational performance.

20

y

y

yx

x

zx

Dy

yxC

yxf

DyDx

hxBz

z

h

),(subject to

),(min

,

all),(subject to

min,

Logic-Based Benders Decomposition

Master Problem Subproblem

Benders cuts for all iterations h

yx DyDx

yxC

yxf

,

),(subject to

),(min

Solution of master problem

Basic idea: Search over values of x in master problem.

For each examined, solve subproblem for y. xx

21

yDy

yxC

yxf

),(subject to

),(min

Logic-Based Benders Decomposition

Subproblem

After solving the subproblem, generate a Benders cutwhere is the optimal value of the subproblem.

The Benders cut is based on a logical analysis of subproblem solution.

Re-solve the master problem and continue until it has the same optimal value as the subproblem.

)(xBz x

x

)(xBx

22

Decompose problem into

assignment + resource-constrained assign tasks scheduling to facilities schedule tasks on each facility

Applying Benders to Planning & Scheduling

Use logic-based Benders to link these. Solve: master problem with MILP -- good at resource allocation subproblem with Constraint Programming -- good at scheduling We will use Benders cuts that require no internal information from the CP solver.

23

Notation

pij = processing time of task j on facility icij = resource consumption of task j on facility iCi = resources available on facility i

C1

task 1

task 2

task 3

task 4

task 5

p11

c11

Total resource consumption Ci at all times.

C2

p22

c22

Facility 1 Facility 2

24

Objective functions

Minimize # late tasks = j

jjyj dptj

)(

facility assigned to task j

start time of task j

Minimize tardiness = j

jjyj dptj

,0max

0 if 0

0 if 1)( {

deadline for task j

25

Minimize # Late Tasks: MILP Model

= 1 if task j is late

}1,0{,

with , all,0

, all,

all,1

, all,)(subject to

min

ijtj

ijijt

j Ttitijij

itijt

jijti

ijj

jj

xN

pNttjx

tiCxc

jx

tjdxptNL

L

ijt

26

}1,0{,

with , all,0

, all,

all,1

, all,)(subject to

min

ijtj

ijijt

j Ttitijij

itijt

jijti

ijj

jj

xN

pNttjx

tiCxc

jx

tjdxptNL

L

ijt

Minimize # Late Tasks: MILP Model

= 1 if task j is late

Number of discrete times t

= 1 if task j starts at time t on facility i

27

Minimize # Late Tasks: MILP Model

Task j starts at one time on one facility

= 1 if task j is late

Number of discrete times t

= 1 if task j starts at time t on facility i

}1,0{,

with , all,0

, all,

all,1

, all,)(subject to

min

ijtj

ijijt

j Ttitijij

itijt

jijti

ijj

jj

xN

pNttjx

tiCxc

jx

tjdxptNL

L

ijt

28

Minimize # Late Tasks: MILP Model

Task j starts at one time on one facility

Tasks underway at time t consume Ci in resources

= 1 if task j is late

Number of discrete times t

= 1 if task j starts at time t on facility i

}1,0{,

with , all,0

, all,

all,1

, all,)(subject to

min

ijtj

ijijt

j Ttitijij

itijt

jijti

ijj

jj

xN

pNttjx

tiCxc

jx

tjdxptNL

L

ijt

29

Minimize # Late Tasks: MILP Model

Task j starts at one time on one facility

Tasks underway at time t consume Ci in resources

Tasks observe time windows

= 1 if task j is late

Number of discrete times t

= 1 if task j starts at time t on facility i

}1,0{,

with , all,0

, all,

all,1

, all,)(subject to

min

ijtj

ijijt

j Ttitijij

itijt

jijti

ijj

jj

xN

pNttjx

tiCxc

jx

tjdxptNL

L

ijt

30

jpdt

i

C

iyc

iyp

iyt

jLdpt

L

jyjj

i

jij

jij

jj

jjjyj

jj

j

j

all,0

all,)|(

)|(

)|(

cumulative

all ),1()(subject to

min

Minimize # Late Tasks: CP Model

yj = facility assigned to task j

start time of task j

31

jpdt

i

C

iyc

iyp

iyt

jLdpt

L

jyjj

i

jij

jij

jj

jjjyj

jj

j

j

all,0

all,)|(

)|(

)|(

cumulative

all ),1()(subject to

min

Minimize # Late Tasks: CP Model

yj = facility assigned to task j

start times of tasks assigned to facility i

start time of task j

32

jpdt

i

C

iyc

iyp

iyt

jLdpt

L

jyjj

i

jij

jij

jj

jjjyj

jj

j

j

all,0

all,)|(

)|(

)|(

cumulative

all ),1()(subject to

min

Minimize # Late Tasks: CP Model

Observe resource limit on each facility

yj = facility assigned to task j

start times of tasks assigned to facility i

start time of task j

33

jpdt

i

C

iyc

iyp

iyt

jLdpt

L

jyjj

i

jij

jij

jj

jjjyj

jj

j

j

all,0

all,)|(

)|(

)|(

cumulative

all ),1()(subject to

min

Minimize # Late Tasks: CP Model

Observe time windows Observe resource limit on each facility

yj = facility assigned to task j

start times of tasks assigned to facility i

start time of task j

34

Minimize # Late Tasks: Logic-Based Benders

}1,0{

subproblem of relaxation

1,,1 iterationsin generated cuts Benders

all,1subject to

min

ij

iij

x

h

jx

L

Master Problem: Assign tasks to facilitiesIteration h

= 1 if task j is assigned to facility i

35

i

hiij

hiij

hij

hijjijj

Jjj

C

Jjc

Jjp

Jjt

JjLdpt

Lhi

)|(

)|(

)|(

cumulative

all ),1()(subject to

min

Subproblem: Schedule tasks assigned to each facility

Separates into an independent scheduling problem on each facility i.Solve by constraint programming.

Set of tasks assigned to facility i by solution of master problem.

36

iL

ixLLL

ixLLL

LL

hi

Jjijhihihi

Jjijhihihi

ihi

hi

hi

all ,0ˆ

all ),1(1ˆ

all ),1(ˆ

ˆ

1

0

**

**

Benders Cuts

Min # late tasks on facility i (solution of subproblem)

Lower bound on # late tasks on facility i

37

iL

ixLLL

ixLLL

LL

hi

Jjijhihihi

Jjijhihihi

ihi

hi

hi

all ,0ˆ

all ),1(1ˆ

all ),1(ˆ

ˆ

1

0

**

**

Benders Cuts

Min # late tasks on facility i (solution of subproblem)

Lower bound on # late tasks on facility i

subset of Jhi for which min # late tasks is still Lhi*(found by heuristic that repeatedly solves subproblem on facility i )

38

iL

ixLLL

ixLLL

LL

hi

Jjijhihihi

Jjijhihihi

ihi

hi

hi

all ,0ˆ

all ),1(1ˆ

all ),1(ˆ

ˆ

1

0

**

**

Benders Cuts

Min # late tasks on facility i (solution of subproblem)

To reduce # late tasks, must remove one of the tasks in from facility i.0

hiJ

39

iL

ixLLL

ixLLL

LL

hi

Jjijhihihi

Jjijhihihi

ihi

hi

hi

all ,0ˆ

all ),1(1ˆ

all ),1(ˆ

ˆ

1

0

**

**

Benders Cuts

Min # late tasks on facility i (solution of subproblem)

subset of Jhi for which min # late tasks is still Lhi*(found by heuristic that repeatedly solves subproblem on facility i )

Smaller subset of Jhi for which min # late tasks is Lhi* 1 (found while running same heuristic)

40

iL

ixLLL

ixLLL

LL

hi

Jjijhihihi

Jjijhihihi

ihi

hi

hi

all ,0ˆ

all ),1(1ˆ

all ),1(ˆ

ˆ

1

0

**

**

Benders Cuts

Min # late tasks on facility i (solution of subproblem)

To reduce # late tasks by more than 1, must remove one of the tasks infrom facility i.

1hiJ

41

iL

ixLLL

ixLLL

LL

hi

Jjijhihihi

Jjijhihihi

ihi

hi

hi

all ,0ˆ

all ),1(1ˆ

all ),1(ˆ

ˆ

1

0

**

**

Benders Cuts

These Benders cuts are added to the master problem in each iteration h.

42

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Lower bound on # late tasks on facility i

43

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Lower bound on # late tasks on facility i

Ci

task1

task 2 task 3

jd

Set of tasks assigned to facility i with deadline at or before dj

44

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Lower bound on # late tasks on facility i

Ci

task1

task 2 task 3

jd

Set of tasks assigned to facility i with deadline at or before dj

Area = pi1ci1

45

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Lower bound on # late tasks on facility i

Ci

task1

task 2 task 3

jdArea = pi1ci1

Area of tasks assigned to facility i with deadline at or before dj

46

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Ci

task1

task 2 task 3

jd

Lower bound on (makespan latest deadline)

47

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Ci

task1

task 2 task 3

jd

Lower bound on (makespan latest deadline)

Max processing time

48

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Min # of late jobs on facility i

49

jp

dxpcC

L

LL

ikdJk

dJkjikikik

ii

ii

j

j all ,}{max

1

)(

)(

Relaxation of Subproblem

Min # of late jobs on facility i

This relaxation is added to the master problem at the outset.

50

}1,0{

with , all,0

, all,

all,1

, all,)(subject to

min

ijt

ijijt

j Ttitijij

itijt

jijti

ijj

jj

x

pNttjx

tiCxc

jx

tjdxptT

T

ijt

Minimize Total Tardiness: MILP Model

tardiness of task j

51

jpdt

i

C

iyc

iyp

iyt

jTdptT

T

jyjj

i

jij

jij

jj

jjjyjj

jj

j

j

all,0

all,)|(

)|(

)|(

cumulative

all ,0 ,subject to

min

Minimize Total Tardiness: CP Model

52

Minimize Total Tardiness: Logic-Based Benders

}1,0{

subproblem of II relaxation

subproblem of I relaxation

1,,1 iterationsin generated cuts Benders

all,1subject to

min

ij

iij

x

h

jx

L

Master Problem: Assign tasks to facilitiesIteration h

= 1 if task j is assigned to facility i

53

i

hiij

hiij

hij

hijijjj

Jjj

C

Jjc

Jjp

Jjt

JjdptT

Thi

)|(

)|(

)|(

cumulative

all ,subject to

min

Subproblem: Schedule tasks assigned to each facility

Separates into an independent scheduling problem on each facility i.Solve by constraint programming.

Set of tasks assigned to facility i by solution of master problem.

54

iT

ixTTT

ixTTT

TT

hi

ZJjijhihihi

Jjijhihihi

ihi

hihi

hi

all ,0ˆ

all ),1(ˆ

all ),1(ˆ

ˆ

\

00

**

Benders Cuts

Min tardiness on facility i (solution of subproblem)

Lower bound on tardiness for facility i

55

iT

ixTTT

ixTTT

TT

hi

ZJjijhihihi

Jjijhihihi

ihi

hihi

hi

all ,0ˆ

all ),1(ˆ

all ),1(ˆ

ˆ

\

00

**

Benders Cuts

Min tardiness on facility i (solution of subproblem)

Lower bound on tardiness for facility i

To reduce tardiness on facility i, must remove one of the tasks assigned to it.

56

iT

ixTTT

ixTTT

TT

hi

ZJjijhihihi

Jjijhihihi

ihi

hihi

hi

all ,0ˆ

all ),1(ˆ

all ),1(ˆ

ˆ

\

00

**

Benders Cuts

Min tardiness on facility i (solution of subproblem)

Set of tasks that can be removed, one at a time from facility i without reducing min tardiness.

57

iT

ixTTT

ixTTT

TT

hi

ZJjijhihihi

Jjijhihihi

ihi

hihi

hi

all ,0ˆ

all ),1(ˆ

all ),1(ˆ

ˆ

\

00

**

Benders Cuts

Min tardiness on facility i when all tasks in Zhi are removed simultaneously.

Set of tasks that can be removed, one at a time from facility i without reducing min tardiness.

58

iT

ixTTT

ixTTT

TT

hi

ZJjijhihihi

Jjijhihihi

ihi

hihi

hi

all ,0ˆ

all ),1(ˆ

all ),1(ˆ

ˆ

\

00

**

Benders Cuts

Min tardiness on facility i when all tasks in Zhi are removed simultaneously.

Set of tasks that can be removed, one at a time from facility i without reducing min tardiness.

To reduce tardiness below on facility i, must remove one of the tasks in Jhi \ Zhi

0hiT

59

iT

ixTTT

ixTTT

TT

hi

ZJjijhihihi

Jjijhihihi

ihi

hihi

hi

all ,0ˆ

all ),1(ˆ

all ),1(ˆ

ˆ

\

00

**

Benders Cuts

These Benders cuts are added to the master problem in each iteration h.

60

kdxpcC

T

TT

kdJjkijijij

ii

ii

all ,1

)(

Subproblem Relaxation I

Lower bound on total tardiness for facility i

61

kdxpcC

T

TT

kdJjkijijij

ii

ii

all ,1

)(

Subproblem Relaxation I

task1

task 2 task 3

Set of tasks assigned to facility i with deadline at or before dk

Lower bound on total tardiness for facility i

kd

62

kdxpcC

T

TT

kdJjkijijij

ii

ii

all ,1

)(

Subproblem Relaxation I

task1

task 2 task 3

Area of tasks assigned to facility i with deadline at or before dk

Lower bound on total tardiness for facility i

kd

63

kdxpcC

T

TT

kdJjkijijij

ii

ii

all ,1

)(

Subproblem Relaxation I

task1

task 2 task 3

Lower bound on total tardiness

kd

Lower bound on total tardiness for facility i

64

Lemma. Consider a min tardiness problem that schedules tasks 1, …, n on facility i, where d1 dn. The min tardiness T* is bounded below by

n

kkTT

1

where

k

jkjiji

ik dcp

CT

ii1

)()(

1

and is a permutation of 1, …, n such that

)()()1()1( nn iiiicpcp

Subproblem Relaxation II

65

Example of Lemma

j dj pij cij pijcij

1 3 2 3 6

2 4 4 2 8

3 5 5 1 5

Ci

task 1task 2

task 3

d1 d2 d3

Min tardiness = 4

3/45)865(3

1)(

1

04)65(3

1)(

1

03)5(3

1)(

1

32211333

211332

1331

dcpcpcpC

T

dcpcpC

T

dcpC

T

iiiiiii

iiiii

iii

23/4 sson tardine boundLower 321 TTT

66

Idea of proof

Let 0(1), …, 0(n) be order of jobs in any optimal solution, so that and min tardiness is T*

)()1( 00 ntt

Consider bubble sort on 0(1), …, 0(n) to obtain 1,…,n. Let 0,…, S be resulting sequence of permutations, so that s, s+1 differ by a swap and s(j) = j.

For a permutation of 1,…,n let

n

kkTT

1

)()(

where

k

jkjiji

ik dcp

CT

ii1

)()()(

1)(

67

Now we have

TTTTTT Sss )()()()(* 10

since )(11

01 1

)()()(1 1

)()()(1

)()()(*

0000000 Tdcp

Cdcp

CdptT

n

j

k

jjjiji

i

n

j

k

jjjiji

i

n

jjjij ii

n

kjsjsksk

k

jsjs

n

kjsjsksk

k

jsjs

TTTTT

TTTTT

2111

1

11

21

1

1

)()()()()(

)()()()()(

swap k and k+1

So

0)()()()(

)()()()()()( 11111

BAbabAAa

TTTTTT skskskskss

since A a, B b

areas def. of

68

From the lemma, we can write the relaxation

i

n

kikik xTT

1

where

k

jkjijiji

iik dxcp

CT

iii1

)()()(

1

To linearize this, we write

i

n

kikTT

1

andikik

k

jkjijiji

iik Mxdxcp

CT

iii)1(

1

1)()()(

k

jkjiji

iik dcp

CM

ii1

)()(1

where

Writing relaxation II

69

Computational Results

Random problems on 3 facilities.

Facilities run at different speeds.

All release times = 0, due dates differ.

Random due date parameters set so that a few tasks tend to be late.

No precedence or other side constraints.

They would make the problem easier.

Implement with OPL Studio

CPLEX for MILP.

ILOG Scheduler for CP. Use AssignAlternatives & SetTimes.

70

Min # late tasks

Smaller problems

Tasks Time (sec) CP MILP Benders

Min # latetasks

14 1092 5.8 0.5 1

382 8.0 0.7 1

265 3.2 0.7 2

85 2.6 1.3 2

5228 1315 665 3

16 304 2.7 0.5 0

? 31 0.2 1

310 22 0.4 1

4925 29 2.7 2

19 5.7 24 4

18

>7200 2.0 0.1 0

? 8.0 0.2 1

>7200 867 8.5 1

>7200 6.3 1.4 2

>7200 577 3.4 2

71

Tasks Time (sec) MILP Benders

Best solutionMILP Benders

20 97 0.4 0 0

>7200 2.3 (1) 1

219 5.0 1 1

>7200 11 (2) 2

843 166 3 3

22

16 1.3 0 0

>7200 3.7 (1) 1

>7200 49 (3) 2

>7200 3453 (5) 2

>7200 >7200 (6) (6)

24 25 0.8 0 0

>7200 18 (1) 0

>7200 62 (2) 0

>7200 124 (3) 1

>7200 234 (2) 1

Min # late tasksLarger problems ( ) =

optimalitynotproved

72

Tasks Time (sec)with relax without relax

16 0.5 2.6

0.4 1.5

0.2 1.3

2.7 4.2

24 18

18

0.1 1.1

0.2 0.7

3.4 3.3

1.4 15

8.5 11

20 0.4 88

2.3 9.7

5.0 63

11 19

166 226

Effect of subproblemrelaxationMin # late tasks

73

Min total tardiness

Smaller problems

Tasks Time (sec) CP MILP Benders

Min tardiness

14

838 7.0 6.1 1

7159 34 3.7 2

1783 45 19 15

>7200 73 40 19

>7200 >7200 3269 26

16 >7200 2 0.1 0

>7200 8 0.2 3

>7200 867 8.5 5

>7200 6 1.4 11

>7200 577 3.4 31

18

187 2.8 0

15 5.3 3

46 49 5

256 47 11

>7200 1203 14

74

Tasks Time (sec) MILP Benders

Best solutionMILP Benders

20 105 18 0 0

4141 23 1 1

39 29 4 4

1442 332 8 8

>7200 >7200 (75) (37)

22

6 19 0 0

584 37 2 2

>7200 >7200 (120) (40)

>7200 >7200 (162) (46)

>7200 >7200 (375) (141)

24 10 324 0 0

>7200 94 (20) 0

>7200 110 (57) 0

>7200 >7200 (20) (5)

>7200 >7200 (25) (7)

Min total tardinessLarger problems ( ) =

optimalitynotproved

75

Tasks Time (sec)with relax without relax

16 1.4 4.4

2.1 6.5

4.2 30

156 199

765 763

18

2.8 10

5.3 17

47 120

49 354

1203 5102

20 18 151

23 1898

29 55

332 764

>7200 >7200

Effect of subproblemrelaxationMin totaltardiness

76

Conclusions

Benders is significantly faster than MILP (which is faster than CP).

Speedup for min # late tasks is often orders of magnitude.

Smaller speedup for min total tardiness.

Problems with more than a few late tasks are hard for all methods.

Benders finds better suboptimal solutions.

Even when Benders fails to prove optimality, it obtains much better solutions than MILP in the same time period.

Subproblem relaxation is important.

Linear relaxation of cumulative constraint can be critical to performance, especially when minimizing total tardiness.

77

Future Research

Implement branch-and-check for Benders problem.

Exploit dual information from the subproblem solution process (e.g. edge finding).

Explore other problem classes.

Integrated long- and short-term scheduling

Vehicle routing

SAT (subproblem is renamable Horn)

Stochastic IP

Recommended