Thheeoorryy ooff...

25
T T h h e e o o r r y y o o f f S S c c h h e e d d u u l l i i n n g g Scheduling problems have been classified, in the following 3 field notaiton. A comprehensive survey of the theory is contained in Lawler, Lenstra, Rinnooy- Kan and Shmoys (1993): 1st Field describes the machine environment: Single machine: 1/ / Parallel machines Pm/ / Uniform machines Qm/ / Unrelated machines Rm/ / Open shop Om/ / Flowshop Fm/ / Jobshop Jm/ / 2nd Field describes the Job Environment Unit processing times /X j =1/ Release dates /r j ,/ Deadlines /D j / Precedence constraints, of various types /prec/ /chain/ /intree/ /serpar/ Preemptions /pmtn/ Stochastic /~ stoc/ 3nd Field describes the Optimality Criteria General Minmax / /f max General Minsum / / Σf j Makespan / /C max Flowtime / / ΣC j Weighted flowtime / / Σw j C j Max lateness / /L max Max tardiness / /T max Sum of tardiness / / ΣT j Weighted tardiness / / Σw j T j Number of late jobs / / ΣU j Examples (1) A 3 machine flowshop, minimize sum of completion times (flowtime), allowing preemptions: F3/pmtn/ΣC j (2) Schedule jobs with precedence constraints and release dates, on parallel machines (we are interested in solving the problem for sny number of machines) so as to minimize the weighted sum of late jobs: MS&E324, Stanford University, Spring 2002 2-1 Gideon Weiss © manufacturing & control P/r j ,prec/ Σw j U j

Transcript of Thheeoorryy ooff...

Page 1: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

TT hh ee oo rr yy oo ff SS cc hh ee dd uu ll ii nn gg

Scheduling problems have been classified, in the following 3 field notaiton. Acomprehensive survey of the theory is contained in Lawler, Lenstra, Rinnooy-Kan and Shmoys (1993):

1st Field describes the machine environment:Single machine: 1/ /Parallel machines Pm/ /Uniform machines Qm/ /Unrelated machines Rm/ /Open shop Om/ /Flowshop Fm/ /Jobshop Jm/ /2nd Field describes the Job EnvironmentUnit processing times /Xj=1/Release dates /rj,/Deadlines /Dj/Precedence constraints, of various types /prec/ /chain/ /intree/ /serpar/Preemptions /pmtn/Stochastic /~stoc/

3nd Field describes the Optimality CriteriaGeneral Minmax / /fmaxGeneral Minsum / /ΣfjMakespan / /CmaxFlowtime / /ΣCjWeighted flowtime / /ΣwjCjMax lateness / /LmaxMax tardiness / /TmaxSum of tardiness / /ΣTjWeighted tardiness / /ΣwjTjNumber of late jobs / /ΣUjExamples (1) A 3 machine flowshop, minimize sum of completiontimes (flowtime), allowing preemptions: F3/pmtn/ΣΣΣΣCj(2) Schedule jobs with precedence constraints and release dates, on parallelmachines (we are interested in solving the problem for sny number ofmachines) so as to minimize the weighted sum of late jobs:

MS&E324, Stanford University, Spring 2002 2-1 Gideon Weiss© manufacturing & control

P/rj,prec/ΣΣΣΣwjUj

Page 2: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

CC oo mm pp uu tt aa tt ii oo nn ll CC oo mm pp ll ee xx ii tt yy

The world of NP

NP = P

P

NP-Complete

NP

The World of NP

Using the above 3 field classification 4536 have beenconsidered.Polynomial time algorithms were devised for 416 ofthem.3582 of the problems were shown to be NP-complete

MS&E324, Stanford University, Spring 2002 2-2 Gideon Weiss© manufacturing & control

(This left us in ~1993 with room for 538 PhD theses).

Page 3: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

MM ii nn ii mm ii zz ii nn gg FF ll oo ww tt ii mm ee oo nn aa SS ii nn gg ll ee MM aa cc hh ii nn ee

1/ /ΣCj

Jobs numbered j N= 1, ,KCompletion times denoted C CN1, ,KIf jobs are scheduled in the order 1, ,K N the schedule is

X X X . . . X 1 2 3 n

A Gantt Chart of a Single Machine, No inserted idle time

Theorem: SPT minimizes flowtime on a single machineProof: 3 proofs

C X

N j X

X X

k j

jj

N

kk

j

j

N

jj

N

jj

N

k j kk jj

N

k j

= ==

=

= ≠=

∑ ∑∑

∑ ∑∑

=

= − +

= +

=

1 11

1

1 1

1

1

0

( )

,

,

δ

δprecedes

else

• Pairwise interchange,• Hardy Littlewood Polya• Long wait for short only, simultaneously

For stochastic processing times:

MS&E324, Stanford University, Spring 2002 2-3 Gideon Weiss© manufacturing & control

Theorem: SEPT minimizes flowtime on a single machine

Page 4: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

HH oo ww mm uu cc hh ww ii ll ll SS (( EE )) PP TT ss aa vv ee yy oo uu ??

We do a probabilistic analysis: Problem instance is chosen from apopulation of problems with X Fj ~ , and you schedule them.

Without information, E C list E XN N

mjj

N

kk

j

j

N( | ) ( )

( )

= ==∑ ∑∑= =

+

1 111

12

With full information,

E C SPT E X X NmN N

mjj

N

jj

N

k j kk jj

N( | ) ( )

( ), :

= = ≠=∑ ∑ ∑∑= + = +

1 1 11 1 2

12

δ

Theorem Assume X Fj ~ i.i.d, and you have information Tj i.i.d, anduse Y E X T Gj j j= ( | ) ~ to predict X j . Then

E C SEPT NmN N

m rm

djj

NF

G( | )( )

( )=∑ = +

−−

11 1

1

12

where:r X T X Yj j j j= =correlation correlation( , ) ( , )

and for any distribution: dm m

=−1 1 2:σ

. Typically, d d dF G≈ ≈ ≈ 12

MS&E324, Stanford University, Spring 2002 2-4 Gideon Weiss© manufacturing & control

Performance ratio:

E C List

E C SEPTr

md

jj

N

jj

NF

G

( | )

( | )( )=

=

∑≈ −1

1

11

σ

Page 5: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

WW ee ii gg hh tt ee dd FF ll oo ww tt ii mm ee

1/ / /ΣWjCj

Theorem: Smith's rule (cµ rule), schedule by decreasing EW

EXj

j

minimizes weighted flowtime E W Cj jj

N

=∑

1 on a single machine

MS&E324, Stanford University, Spring 2002 2-5 Gideon Weiss© manufacturing & control

time

weight

Page 6: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

DD uu ee dd aa tt ee cc ii rr tt ee rr ii aa ..

1/prec/hmax

Lawler's algorithm for h h C h CN Nmax max( ( ), , ( ))= 1 1 K

Step 1: Classify job intor unscheduled jobs, scheduled jobs, and jobswith no successors:

J J n Jc= ∅ = =, { , , }, ©1 K jobs with no unscheduled successors

Step 2: calculate

j h X h Xj j

j J j Jj j

j Jc c

*

© ©©: ( ) min ( )*

∈ ∈ ∈∑ ∑=

move j*from Jc to J and update J©

Step 3: Stop when J J nc = ∅ =, { , , }1 K , schedule jobs in oppositeorder to their entry to J

Example: Jackson's rule, EDD (earliest due date) minimizes

L C dj jmax max= −

EDD for all on-time jobs minimizes U j∑

NN PP -- hh aa rr dd pp rr oo bb ll ee mm ss ..

1/rj/Lmax 1/rj/ΣΣΣΣCj are NP-hard scheduling problems

MS&E324, Stanford University, Spring 2002 2-6 Gideon Weiss© manufacturing & control

Page 7: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

PP aa rr aa ll ll ee ll mm aa cc hh ii nn ee ss cc hh ee dd uu ll ii nn gg -- MM aa kk ee ss pp aa nn

P/ /Cmax

Let X XN1, ,K be integers. Can the be partitioned into two sets with

equal sums? All you need to do is check all subsets, but that is 2N

calculations.

In fact this problem "two partition" is NP-complete (binary sense), and"3-partition" etc. are (unary) NP-complete.

So scheduling jobs on two parallel machines is NP-hard. But inparctice this problem is easy:

(1) Simple heuristics:

Cmax |ListCmax |Opt

< 2 −1m

Cmax |LPTCmax |Opt

<43

−1

3m

(2) Karp and Karmarkar devised a fully polynomial approximationscheme.

(3) Probabilistically, for jobs from some reasonable distribuiton,

ECmax | LEPCmax |Opt

Population of Jobs

n→∞

→ 1

For stochastic jobs: Theorem: when processing times are exponential,

MS&E324, Stanford University, Spring 2002 2-7 Gideon Weiss© manufacturing & control

LEPT minimizes makespan on two machines.

Page 8: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

PP aa rr aa ll ll ee ll mm aa cc hh ii nn ee ss cc hh ee dd uu ll ii nn gg -- FF ll oo ww tt ii mm ee

P/ /ΣΣΣΣCj

Theorem: SPT minimizes flowtime on parallel machines.

L L-1 12

A1A2AL-1

AL

Schedule looks like:

1 5 9

2 6 10

3 7

4 8

For stochastic jobs proof does not work. In fact theorem is notgenerally true.

But: If jobs are stochastically comparableX Y P X u P Y uST≥ ⇔ ≥ ≥ ≥( ) ( ),

then SEPT minimizes flowtime stochastically (Weber, Varaiya,Walrand)

MS&E324, Stanford University, Spring 2002 2-8 Gideon Weiss© manufacturing & control

Page 9: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

PP aa rr aa ll ll ee ll mm aa cc hh ii nn ee ss -- WW ee ii gg hh tt ee dd FF ll oo ww tt ii mm ee

P/ /ΣΣΣΣWjCj is NP-hard. However, Smith's rule is a good heuristic:

. . . . . .

. . .. . .

1

2

3

4n

n-1

n-2

smith'srule OK

inefficiency

Worst case performance of Smith's rule is

RE w C SR

E w C Optj j

j j= = + ≈

|

|.1

212

1 2

This is for very many short jobs and a few long ones, all with almost thesame Smith's ratio.

However, for any set of jobs, on two parallel machines, if one usesSmith's rule

E w C SR E w Cm

m

w

EXDj j j j

j n

j

j∑ ∑− ≤

≤ ≤| |

( )maxπ

12

2

1

2

where:

D E X t X tt j j2 2= − >sup (( ) | )all jobs and all

MS&E324, Stanford University, Spring 2002 2-9 Gideon Weiss© manufacturing & control

Page 10: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

SS hh oo pp mm oo dd ee ll ss aa nn dd mm uu ll tt iioo pp ee rr aa tt ii oo nn jj oo bb ss

Single machine

(ARRIVALS)(BATCH)

MACHINEDEPARTURES

Parallel machine

(ARRIVALS)

(BATCH)

MACHINE 2

DEPARTURESMACHINE 1

MACHINE 3

Machines in series flow-shop

(ARRIVALS)(BATCH)

MACHINE 1

BUFFER

MACHINE 2DEPARTURES

BUFFER

MACHINE 3

job-shop / queueing network

MS&E324, Stanford University, Spring 2002 2-10 Gideon Weiss© manufacturing & control

Job 1

Job 2Job 3

Job 4

MACHINE 3MACHINE 1

MACHINE 2 MACHINE 4

Page 11: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

FF ll oo ww SS hh oo pp ss cc hh ee dd uu ll ii nn gg

For 2 machine, minimal makespan, F a b Cj j2 | , | max,

Johmson's rule is optimal:

Partition jobs into:

a bj j< Schedule these first, according to SPT on machine 1

a bj j≥ Schedule these next, according to LPT on machine 2

Proof:

makespan == =∑ ∑max

kj

j

k

jj k

Na b

1

This rule is actually really bad: In order to prevent starving on machine 2you create work for it as fast as you can and then keep the buffer betweenthe two machines as full as you can for as long as possible.

t i m e

buffer size

In fact (probabilistic analysis): For balanced machines:

E C N N

E C N N

max

max

| .

| .

Johnson

RAND

≈ +

≈ +

µ σ

µ σ

0 56

1 12If machines not balanced, the difference is even smaller:

E C E C O Nmax max| | (log )Johnson RAND− ≈

MS&E324, Stanford University, Spring 2002 2-11 Gideon Weiss© manufacturing & control

All other flowshop scheduling problems are NP-hard

Page 12: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

JJ oo bb SS hh oo pp ss cc hh ee dd uu ll ii nn gg tthhee 1100xx1100 pprroobb ll eemmFirst Appeared in 1963 book of Muth and Thompson.

Solution found by Carlier and Pinson, 1988,Solution is 930 Lower bound 631.

1

2

3

4

5

6

7

8

9

10

job 1 job 2 job 3 job 4 job 5 Step#

1 29 1 43 2 91 2 81 3 14

2 78 3 90 1 85 3 95 1 6

3 9 5 75 4 39 1 71 2 22

4 36 10 11 3 74 5 99 6 61

5 49 4 69 9 90 7 9 4 26

6 11 2 28 6 10 9 52 5 69

7 62 7 46 8 12 8 85 9 21

8 56 6 46 7 89 4 98 8 49

9 44 8 72 10 45 10 22 10 72

10 21 9 30 5 33 6 43 7 53

1

2

3

4

5

6

7

8

9

10

job 6 job 7 job 8 job 9 job 10 Step#

3 84 2 46 3 31 1 76 2 85

2 2 1 37 1 86 2 69 1 13

6 52 4 61 2 46 4 76 3 81

4 95 3 13 6 74 6 51 7 7

9 48 7 32 5 32 3 85 9 64

10 72 6 21 7 88 10 11 10 76

1 47 10 32 9 19 7 40 6 47

7 65 9 89 10 48 8 89 4 52

5 6 8 30 8 36 5 26 5 90

8 25 5 55 4 79 9 74 8 45

Job shop scheduling is not just NP-hard: Even small problems are veryhard. Minimizing makespan for the above took 10 years to solve. Suchproblems will now be solved in half an hours run. 20x20x20 is still

MS&E324, Stanford University, Spring 2002 2-12 Gideon Weiss© manufacturing & control

intractable.

Page 13: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

TT hh ee oo rr yy oo ff tt hh ee SS ii nn gg ll ee SS ee rr vv ee rr QQ uu ee uu ee

Arrivals: 0 1 2≤ < <A A L

Cumulative arrivals: A( )t

Processing X X1 2, K

Departures D D1 2, K

Cumulative arrivals: D( )t

Queue length Q t t t( ) ( ) ( )= −A D

Delayed Q tD( )

In service Q tS ( )

Sojourn W D Aj j j= −

Delay V W Xj j j= −

Virtual workload (system, delayed jobs, in service) V W( ), ( ), ( )t t tS

Policy: FIFO (FCFS),

LIFO (LCFS),

Priority (preemptive of non-preemptive),

EDD, SERPT, SEPT

Rates: arrival rate: λ =

→∞t

tt

lim( )A

MS&E324, Stanford University, Spring 2002 2-13 Gideon Weiss© manufacturing & control

service rate: µ = =→∞

=∑1 1

mm

X

nn

jjn

, lim

Page 14: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

QQ uu ee uu ee aa rr ee tt hh ee rr ee ss uu ll tt ss oo ff vv aa rr ii aa bb ii ll ii tt yy

Consider a single server station:

Assume arrival every hour on the hour, and service lasts precisely 54minutes

8:00 9:00 10:00 11:00 12:00 13:00

λµ

ρλµ

λ= = = = = = <11

0 9 0 9 1, . , .m m

With the same rates, if interarrivals and or sevice are variable, we see:

8:00 9:00 10:00 11:00 12:00 13:00

For exponential interarrivals and services: Average queue length is

MS&E324, Stanford University, Spring 2002 2-14 Gideon Weiss© manufacturing & control

ρρ1

9−

=

Page 15: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

LL ii tt tt ll ee '' ss ff oo rr mm uu ll aa

Let the arrival rate be λ , and assume that service is regular enough to have

WW

nn

jjn

=→∞

=∑lim

1. Then the long term average number of customers in

the system LT

Q t dtT

T=

→∞∫lim ( )

1

0 exists and is

L W= λ

. .

.

W1

W2

W3

W4

Wn

A(t)

D(t)

0 T

DD

AA

D A( )( )

( )( )

( )

( ) ( )tT t

WT

Q t dtt

T tWj

j

t T

jj

t1 1 1

1 0 1= =∑ ∫ ∑≤ ≤

FF rr aa cc tt ii oo nn bb uu ss yy tt ii mm eeConsider the server as a system, by Little's formula:

Average number in system ρ λ= m

Sysem has either 1 or is empty: ρ Fraction busy

MS&E324, Stanford University, Spring 2002 2-15 Gideon Weiss© manufacturing & control

1− ρ Fraction idle

Page 16: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

PP AA SS TT AA

Let Z t( ) be a stochastic process, Λ( )t a Poisson process with events at

0 1< < < <T TnL L, and assume for all t that Λ Λ( ) ( ) :s t s t− >{ } isindependent of Z s s s t( ), ( ) :Λ ≤{ }. Then the following (if they exist) areequal:

Tj

j

t

T

T

tZ T

TZ t dt

→∞ = →∞∑ ∫=lim lim

( )( ) ( )

( )1 1

1 0Λ

Λ

WW oo rr kk cc oo nn ss ee rr vv aa vv tt ii oo nnVirtual work load increases at arrivals, and otherwise decreases at rate 1.

X1

X2 X3

X4X5

W(t)

t

MS&E324, Stanford University, Spring 2002 2-16 Gideon Weiss© manufacturing & control

This is entirely invariant for all policies.

Page 17: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

SS ee rr vv ee rr ww oo rr kk ll oo aa dd ::The server has one customer at a time, with triangular workload

X1

X2

X3

X4 X5

W (t)

t

S

Again for all policies:

W

AA

A

sT

s

T

T

jj

T

Tt dt

TT

X

TE X= = =

→∞ →∞

=∫

lim ( ) lim( )

/

( )( ) /

( )

12

20

2

1 2λ

DD ee ll aa yy ee dd ww oo rr kk ll oo aa dd ::Each customer contributes his work requirement times his delay.

X1

X2 X3

X4X5

W(t)

MS&E324, Stanford University, Spring 2002 2-17 Gideon Weiss© manufacturing & control

V

AA

A

= = = =→∞ →∞

=∫

lim ( ) lim( )

( )( ) ( )

( )

T

T

T

j jj

T

Tt dt

T

T

V X

TE V E X V

1

0

1 λ ρ

Page 18: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

MM // MM // 11 qq uu ee uu ee ::

Interarrivals are i.i.d. ~ exp( )λ . Service is i.i.d. ~ exp( )µ . ρλµ

= < 1.

This is a birth and death process,

µµµµ

0000 1111

µµµµ

n-1 n

µµµµ

. . . M/M/1

λλλλ λλλλ λλλλ

Steady state queue length distribution:

P Q j jj( ( ) ) ( ) , ,∞ = = − =1 0 1ρ ρ K

Steady state sojourn time Wj ~ exp( )µ λ− ,

Long term average sojourn time Wm

=−1 ρ

, delay V m=−ρ

ρ1MM // GG // 11 qq uu ee uu ee ::

Interarrivals are i.i.d. ~ exp( )λ . Service i.i.d general. ρλµ

= < 1.

V V E Xs= = = +PASTA

= W V + W ρ λ ( ) /2 2,

Hence (Pollatshek-Khinchine)

VE X

mcS=

−=

−+λ

ρρ

ρ1 2 11

2

2 2( )

where cX

Xs

j

j

22=

Variance(

Mean

)

( ) squared coefficient of variation of service time.

MS&E324, Stanford University, Spring 2002 2-18 Gideon Weiss© manufacturing & control

Page 19: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

GG II // GG // 11 qq uu ee uu ee ::

Interarrivals are i.i.d. general. Service i.i.d general. ρλµ

= < 1.

cA A

A Aa

j j

j j

2 1

12=

Variance(

Mean

)

( ), c

X

Xs

j

j

22=

Variance(

Mean

)

( ),

squared coefficients of variation of interarrivals and service.

Kingman's inequality

V mc cA S≤

−+ρ

ρ1 2

2 2

and for heavy traffic:

ρρ

ρ≤≈ ≈

−+

11 2

2 2, V m

c cA S

Congestion as function of traffic intensity

ρ

ρ1 − ρ

Note: c cA S2 2, are 0 for no variability, are 1 for ~ exp, and are

typically ≈ .17 .

MS&E324, Stanford University, Spring 2002 2-19 Gideon Weiss© manufacturing & control

Page 20: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

MM // GG // 11 bb uu ss yy pp ee rr ii oo dd ::Fraction of time busy is ρ , fraction idle is 1− ρ , busy and idle periodsaltenate, idle period is (M/G/1) ~ exp( )λ with expected length 1/ λ .

BPm

=−

=−

11 1λ

ρρ ρ

If first service is x : EFSBPx

=−1 ρ

Note

Average delay of a customer:m

1− ρ

Average busy periodm

1− ρ

A typical customer arrives to find ρ

ρ1− in queue, and when he leaves

queue will change by ~1. This is called the flashlight principle: Queuechange time scale is much slower than the customer time scale.

Note also that busy periods are very variable. An overwhelming majorityare very short, but a few are very long. The typical customer encounters a

MS&E324, Stanford University, Spring 2002 2-20 Gideon Weiss© manufacturing & control

very long one.

Page 21: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

SS cc hh ee dd uu ll ii nn gg ww ii tt hh aa rr rr ii vv aa ll ss ,,SS cc hh ee dd uu ll ii nn gg ss ii nn gg ll ee ss ee rr vv ee rr qq uu ee uu ee ::

The problem 1/ rj /ΣCj is NP-hard.

We now consider scheduling a stream of jobs,

Arrivals: 0 1 2≤ < <A A L

Processing X X1 2, K

Departures D D1 2, K

We want to minimize:1

1ND Aj j

j

N( )−

=∑

Observe: This is equivalent to some of completion times, but for stream ofarrivals it is O( )1 , while for batch (all N jobs present at time 0) it isO N( ).

We can say:

(1) With preemptions: SRPT is optimal

This requires you know the processing time when a job arrives, and areallowed to preempt the job that is running.

Beautiful proof, won't give it here.

(2) M/G/1: SEPT minimizes expected flowtime, Smith's "cµ" ruleminimizws expected weighted flowtime.

V k =λE(X2 ) / 2

(1 − ρii=1

k −1∑ )(1− ρi

i=1

k

∑ )

(3) Heavy traffic: Lowest priority customers do all the waiting,

State space collapse:

MS&E324, Stanford University, Spring 2002 2-21 Gideon Weiss© manufacturing & control

W

W

E X j||

( )no prioritiesSEPT

of class of longest jobs

m=

Page 22: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

FF ll uu ii dd aa nn dd DD ii ff ff uu ss ii oo nn AA pp pp rr oo xx ii mm aa tt ii oo nn oo ffGG II // GG // 11 QQ uu ee uu ee ::• FSLLN, FCLT, FSAT for renewal processes.

Service times: X X1 2, K

Mean is m, service rate is µ =1m

, squared coefficient of variation is cS2

Moments of order r > 2 exist.

Service completions count: S t n X X tn( ) max{ : }= + + ≤1 L

FSLLN:1n

S nt ta s( ) . . → µ

FCLT: nn

S nt t c BM ta s

S( ( ) ) ( ). .1 2− →µ µ

FSAT: S t t c BM t TSr( ) ( ) ( )/= + +µ µ 2 10

• Dynamics of GI/G/1 queue:

Q t Q A t S B t

B t dsQ s

t

( ) ( ) ( ) ( ( ))

( ) ( )

= + −

= >∫

0

1 00

• Reflection mapping: For x t( ) RCLL ( x t D( ) ∈ ), x( )0 0>

(i) z t x t y t( ) ( ) ( )= + ≥ 0

(ii) y y t( ) , ( )0 0= nondecreasing.

(iii) z t d y t( ) ( ( )) =∫ 0.

Then x t( ) determines z t y t( ), ( ) uniquely, (iii') y t( ) is minimal is

MS&E324, Stanford University, Spring 2002 2-22 Gideon Weiss© manufacturing & control

equivalent to (iii), and the mapping is Lipschitz continuous in D.

Page 23: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

• Centering the queue balance:

Q t Q t A t t S B t B t

t B t t t

( ) [ ( ) ( ) ( ( ) ) ( ( ( )) ( ))]

[ ( )] ( ) ( )

= + − + − − −

+ − = +

0 λ µ λ µ

µ µX Y

• Fluid Approximation

Fluid scaling: z tn

z nt( ) ( )=1

Sequence of systems, 1

0 0n

Q Qn ( ) ( )→ ,

Xn t Q t( ) ( ) ( )→ + −0 λ µ

and the limits of the queue length and the busy time are obtained throughthe reflection mapping:

Q t Q t Q t

B t B tt t

t t

t Q t

n

n

( ) ( ) ( ) ( )

( ) ( )( )

min{ : ( ) }

→ = + −( )

→ =≤

+ − ≥

= =

+0

0

λ µ

τ

τ ρ τ τ

τ

• Diffusion Approximation

diffusion scaling: √( )( ) ( )

z tz nt z nt

n=

Sequence of systems,1

0 0n

Q Q nn n n n n( ) √( ), lim lim , lim ( )→ = = = −λ µ λ θ λ µ ,

MS&E324, Stanford University, Spring 2002 2-23 Gideon Weiss© manufacturing & control

√ ( ) √( ) √( ) ( ) ( )

√ ( ) √( ), √ ( ) ( ) √( )

X X

X X

nA S

n n n

t t Q t c c BM t

Q t t B tn

B nt t t

→ = + + +

→ = − → −

0

1 1

2 2θ λ

λΨ Φ

Page 24: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

BB rr oo ww nn ii aa nn MM oo tt ii oo nn aa nn dd RR ee ff ll ee cc tt ee dd BB MM

A standard Brownian motion BM t( ) (Wiener process) is a stochasticprocess which

(i) BM t( ) has independendt stationary increments

(ii) BM BM t N t( ) , ( ) ~ ( , )0 0 0=

(iii) BM t( ) has continuous paths (almost surely)

Let BM t m x mt BM t N x mt tx ( ; , ) ( ) ~ ( , )σ σ σ2 2= + + +

Reflected Brownian motion is defined as the reflection of a Brownianmotion, for x ≥ 0:

RBM t m BM t m Y tx x( , ; , ) ( , ; , ) ( , )ω σ ω σ ω2 2= +

Here, Y t BM s m s tx( , ) sup{ ( , ; , ) : }ω ω σ= < <−2 0

and:

P Y t yy x mt

te

y x mtt

P RBM t m zz x mt

te

z x mtt

my

xmz

( ( ) ) ( ) ( )

( ( ; , ) ) ( ) ( )

/

/

≤ =+ +

−− − +

≤ =− −

−− − −

−Φ Φ

Φ Φ

σ σ

σσ σ

σ

σ

2

2 2

2

2

For m < 0, RBM t mx ( , ; , )ω σ 2 is positive Harris recurrent, with

MS&E324, Stanford University, Spring 2002 2-24 Gideon Weiss© manufacturing & control

P RBM t m z exmz( ( ; , ) ) /→ ∞ ≤ = −σ σ2 21

2

Page 25: Thheeoorryy ooff SScchheedduulliinnggweb.stanford.edu/class/msande324/handouts/Lecture2...TThheeoorryy ooff SScchheedduulliinngg Scheduling problems have been classified, in the following

MM aa xx ii mm aa ll qq uu ee uu ee ll ee nn gg tt hh ii nn GG II // GG // 11We study the maximal queue length for the 1st n arrivals.

Lemma (Dai & W, 2001) Let interarrivals and services be u vi i, . Assume

E u E v f E ei iu vi i( ) ( ), ( ) ( ) ,( )> = < ∞ >+θ θθ

for some 0. Let τn bethe time of the nth arrival, and Q t( ) the queue length process, Q( )0 0= .There exists c such that for all n

P Q t c nnt n

(max ( ) log )01

< < > ≤τ

Proof By assumption, f ( )θ θ0 01 0< >for some . We have for everym l k≥ ≥ ≥0 0 1, ,

P u u v v f E em m l k m m ll u k( ) ( ) ( )+ + + + +

−+ + < + + ≤1 1 00 1L L θ θ

Hence

P Q t c n

P u u v v

n E e

c n n E e

t

m l nm m l c n m m l

u c n

u

n(max ( ) ( ))

( )

( ) ,

( ) log / log ( ) .

,( )

( )

0

01 1

2 0 1

0 13

< <

≤ ≤+ + + + +

> ≤

≤ + + < + +

= −

τ

θ

θ

U L L

MS&E324, Stanford University, Spring 2002 2-25 Gideon Weiss© manufacturing & control