Minimizing

Average

Flow

Time

on

Related

Machines

We

give

the

first

on-line

poly-logarithmic

competitve

algorithm

for

minimizing

average

flow

time

with

preemption

on

related

machines

i.e.

when

machines

can

have

different

speeds

This

also

yields

the

first

poly-logarithmic

polynomial

time

approximation

algorithm

for

this

problem

More

specifically

we

give

an

O

-LRB-

log

P

log

S

-RRB-

competitive

algorithm

where

P

is

the

ratio

of

the

biggest

and

the

smallest

processing

time

of

a

job

and

S

is

the

ratio

of

the

highest

and

the

smallest

speed

of

a

machine

Our

algorithm

also

has

the

nice

property

that

it

is

non-migratory

The

scheduling

algorithm

is

based

on

the

concept

of

making

jobs

wait

for

a

long

enough

time

before

scheduling

them

on

slow

machines

F.

-LSB-

Analysis

of

Algorithms

and

Problem

Complexity

-RSB-

Nonnumerical

Algorithms

and

Problems

Sequencing

and

Scheduling

Algorithms

We

consider

the

problem

of

scheduling

jobs

that

arrive

over

time

in

multiprocessor

environments

This

is

a

fundamental

scheduling

problem

and

has

many

applications

e.g.

servicing

requests

in

web

servers

The

goal

of

a

scheduling

Work

done

as

part

of

the

Approximation

Algorithms

partner

group

of

MPI-Informatik

Germany

Supported

by

an

IBM

faculty

development

award

and

a

travel

grant

from

the

Max

Plank

Society

Permission

to

make

digital

or

hard

copies

of

all

or

part

of

this

work

for

personal

or

classroom

use

is

granted

without

fee

provided

that

copies

are

not

made

or

distributed

for

profit

or

commercial

advantage

and

that

copies

bear

this

notice

and

the

full

citation

on

the

first

page

To

copy

otherwise

to

republish

to

post

on

servers

or

to

redistribute

to

lists

requires

prior

specific

permission

and/or

a

fee

STOC

May

Seattle

Washington

USA

Copyright

ACM

algorithm

is

to

process

jobs

on

the

machines

so

that

some

measure

of

performance

is

optimized

Perhaps

the

most

natural

measure

is

the

average

flow

time

of

the

jobs

Flow

time

of

a

job

is

defined

as

the

difference

of

its

completion

time

and

its

release

time

i.e.

the

time

it

spends

in

the

system

This

problem

has

received

considerable

attention

in

the

recent

past

-LSB-

-RSB-

All

of

these

works

make

the

assumption

that

the

machines

are

identical

i.e.

they

have

the

same

speed

But

it

is

very

natural

to

expect

that

in

a

heterogenous

processing

environment

different

machines

will

have

different

processing

power

and

hence

different

speeds

In

this

paper

we

consider

the

problem

of

scheduling

jobs

on

machines

with

different

speeds

which

is

also

referred

to

as

related

machines

in

the

scheduling

literature

We

allow

for

jobs

to

be

preempted

Indeed

the

problem

turns

out

to

be

intractable

if

we

do

not

allow

preemption

Kellerer

et

al.

-LSB-

-RSB-

showed

that

the

problem

of

minimizing

average

flow

time

without

preemption

has

no

online

algorithm

with

o

-LRB-

n

-RRB-

competitive

ratio

even

on

a

single

machine

They

also

showed

that

it

is

hard

to

get

a

polynomial

time

O

-LRB-

n

-RRB-

approximation

algorithm

for

this

problem

So

preemption

is

a

standard

and

much

needed

assumption

when

minimizing

flow

time

In

the

standard

notation

of

Graham

et

al.

-LSB-

-RSB-

we

consider

the

problem

Q

r

j

pmtn

P

j

F

j

We

give

the

first

poly-logarithmic

competitive

algorithm

for

minimizing

average

flow

time

on

related

machines

More

specifically

we

give

an

O

-LRB-

log

P

log

S

-RRB-

competitive

algorithm

where

P

is

the

ratio

of

the

biggest

and

the

smallest

processing

time

of

a

job

and

S

is

the

ratio

of

the

highest

and

the

smallest

speed

of

a

machine

This

is

also

the

first

polynomial

time

poly-logarithmic

approximation

algorithm

for

this

problem

Despite

its

similarity

to

the

special

case

when

machines

are

identical

this

problem

is

more

difficult

since

we

also

have

to

worry

about

the

processing

times

of

jobs

Our

algorithm

is

also

non-migratory

i.e.

it

processes

a

job

on

only

one

machine

This

is

a

desirable

feature

in

many

applications

because

moving

jobs

across

machines

may

have

many

overheads

Related

Work

The

problem

of

minimizing

average

flow

time

-LRB-

with

preemption

-RRB-

on

identical

parallel

machines

has

received

much

attention

in

the

past

few

years

Leonardi

and

Raz

-LSB-

-RSB-

showed

that

the

Shortest

Remaining

Processing

Time

-LRB-

SRPT

-RRB-

algorithm

has

a

competitive

ratio

of

O

-LRB-

log

-LRB-

min

-LRB-

n

m

P

-RRB-

-RRB-

-RRB-

where

n

is

the

number

of

jobs

and

m

is

the

number

of

machines

A

matching

lower

bound

on

the

competitive

ratio

of

any

on-line

-LRB-

randomized

-RRB-

algorithm

for

this

problem

was

also

shown

by

the

same

authors

Awerbuch

et

al.

-LSB-

-RSB-

gave

a

non-migratory

version

of

SRPT

with

competitive

ratio

of

O

-LRB-

log

-LRB-

min

-LRB-

n

P

-RRB-

-RRB-

-RRB-

Chekuri

et

al.

-LSB-

-RSB-

gave

a

non-migratory

algorithm

with

competitive

ratio

of

O

-LRB-

log

-LRB-

min

-LRB-

n

m

P

-RRB-

-RRB-

-RRB-

One

of

the

merits

of

their

algorithm

was

a

much

simpler

analysis

of

the

competitive

ratio

Instead

of

preferring

jobs

according

to

their

remaining

processing

times

their

algorithm

divides

jobs

into

classes

when

they

arrive

A

job

goes

to

class

k

if

its

processing

time

is

between

and

k

The

scheduling

algorithm

now

prefers

jobs

of

smaller

class

irrespective

of

the

remaining

processing

time

We

also

use

this

notion

of

classes

of

jobs

in

our

algorithm

Azar

and

Avrahami

-LSB-

-RSB-

gave

a

non-migratory

algorithm

with

immediate

dispatch

i.e.

a

job

is

sent

to

a

machine

as

soon

as

it

arrives

Their

algorithm

tries

to

balance

the

load

assigned

to

each

machine

for

each

class

of

jobs

Their

algorithm

also

has

the

competitive

ratio

of

O

-LRB-

log

-LRB-

min

-LRB-

n

m

P

-RRB-

-RRB-

-RRB-

It

is

also

interesting

to

note

that

these

are

also

the

best

known

results

in

the

off-line

setting

of

this

problem

Kalyanasundaram

and

Pruhs

-LSB-

-RSB-

introduced

the

resource

augmentation

model

where

the

algorithm

is

allowed

extra

resources

when

compared

with

the

optimal

off-line

algorithm

These

extra

resources

can

be

either

extra

machines

or

extra

speed

For

minimizing

average

flow

time

on

identical

parallel

machines

Phillips

et

al.

-LSB-

-RSB-

showed

that

we

can

get

an

optimal

algorithm

if

we

are

given

twice

the

speed

as

compared

to

the

optimal

algorithm

In

the

case

of

single

machine

scheduling

Bechheti

et

al.

-LSB-

-RSB-

showed

that

we

can

get

O

-LRB-

-RRB-

competitive

algorithms

if

we

are

give

-LRB-

-RRB-

times

more

resources

Bansal

and

Pruhs

-LSB-

-RSB-

extended

this

result

to

a

variety

of

natural

scheduling

algorithms

and

to

L

p

norms

of

flow

times

of

jobs

as

well

In

case

of

identical

parallel

machines

Chekuri

et

al.

-LSB-

-RSB-

gave

simple

scheduling

algorithms

which

are

O

-LRB-

-RRB-

competitive

with

-LRB-

-RRB-

resource

augmentation

Our

Techniques

A

natural

algorithm

to

try

here

would

be

SRPT

We

feel

that

it

will

be

very

difficult

to

analyze

this

algorithm

in

case

of

related

machines

Further

SRPT

is

migratory

Non-migratory

versions

of

SRPT

can

be

shown

to

have

bad

competitive

ratios

To

illustrate

the

ideas

involved

consider

the

following

example

There

is

one

fast

machine

and

plenty

of

slow

machines

Suppose

many

jobs

arrive

at

the

same

time

If

we

distribute

these

jobs

to

all

the

available

machines

then

their

processing

times

will

be

very

high

So

at

each

time

step

we

need

to

be

selective

about

which

machines

we

shall

use

for

processing

Ideas

based

on

distributing

jobs

in

proportion

to

speeds

of

machines

as

used

by

Azar

and

Avrahami

-LSB-

-RSB-

can

also

be

shown

to

have

problems

Our

idea

of

selecting

machines

is

the

following

A

job

is

assigned

to

a

machine

only

if

it

has

waited

for

time

which

is

proportional

to

its

processing

time

on

this

machine

The

intuition

should

be

clear

if

a

job

is

going

to

a

slow

machine

then

it

can

afford

to

wait

longer

before

it

is

sent

to

the

machine

Hopefully

in

this

waiting

period

a

faster

machine

might

become

free

in

which

case

we

shall

be

able

to

process

it

in

smaller

time

We

also

use

the

notion

of

class

of

jobs

as

introduced

by

Chekuri

et

al.

-LSB-

-RSB-

which

allows

machines

to

have

a

preference

ordering

over

jobs

We

feel

that

this

idea

of

delaying

jobs

even

if

a

machine

is

available

is

new

As

mentioned

earlier

the

first

challenge

is

to

bound

the

processing

time

of

our

algorithm

In

fact

a

bulk

of

our

paper

is

about

this

The

basic

idea

used

is

the

following

if

a

job

is

sent

to

a

very

slow

machine

then

it

must

have

waited

long

But

then

most

of

this

time

our

algorithm

would

have

kept

the

fast

machines

busy

Since

we

are

keeping

fast

machines

busy

the

optimum

also

can

not

do

much

better

But

converting

this

idea

into

a

proof

requires

several

technical

steps

The

second

step

is

of

course

to

bound

the

flow

time

of

the

jobs

It

is

easy

to

see

that

the

total

flow

time

of

the

jobs

in

a

schedule

is

same

as

the

sum

over

all

time

t

of

the

number

of

waiting

jobs

at

time

t

in

the

schedule

So

it

would

be

enough

if

we

show

that

for

any

time

t

the

number

of

jobs

which

are

waiting

in

our

schedule

is

close

to

that

in

the

optimal

schedule

Chekuri

et

al.

-LSB-

-RSB-

argue

this

in

the

following

manner

Consider

a

time

t

They

show

that

there

is

a

time

t

t

such

that

the

number

of

waiting

jobs

of

a

certain

class

k

or

less

in

both

the

optimal

and

their

schedule

is

about

the

same

-LRB-

this

is

not

completely

accurate

but

captures

the

main

idea

-RRB-

Further

they

show

that

t

is

such

that

all

machines

are

busy

processing

jobs

of

class

k

or

less

during

-LRB-

t

t

-RRB-

So

it

follows

that

the

number

of

waiting

jobs

of

this

class

or

less

at

time

t

are

about

the

same

in

both

the

schedules

We

can

not

use

this

idea

because

we

would

never

be

able

to

keep

all

machines

busy

-LRB-

some

machines

can

be

very

slow

-RRB-

So

we

have

to

define

a

sequence

of

time

steps

like

t

for

each

time

and

make

clever

use

of

geometric

scaling

to

show

that

the

flow

time

is

bounded

We

consider

the

on-line

problem

of

minimizing

total

flow

time

for

related

machines

Each

job

j

has

a

processing

requirement

of

p

j

and

a

release

date

of

r

j

There

are

m

machines

numbered

from

to

m

The

machines

can

have

different

speeds

and

the

processing

time

of

a

job

j

on

a

machine

is

p

j

divided

by

the

speed

of

the

machine

The

slowness

of

machine

is

the

reciprocal

of

its

speed

It

will

be

easier

to

deal

with

slowness

and

so

we

shall

use

slowness

instead

of

speed

in

the

foregoing

discussion

Let

s

i

denote

the

slowness

of

machine

i

So

the

time

taken

by

job

j

to

process

on

machine

i

is

p

j

s

i

Assume

that

the

machines

have

been

numbered

so

that

s

s

s

m

We

shall

assume

without

loss

of

generality

that

processing

time

release

dates

and

slowness

are

integers

We

shall

use

the

term

volume

of

a

set

of

jobs

for

denoting

their

processing

time

on

a

unit

speed

machine

Let

A

be

a

scheduling

algorithm

The

completion

time

of

a

job

j

in

A

is

denoted

by

C

A

j

The

flow

time

of

j

in

A

is

defined

as

F

A

j

C

A

j

r

j

Our

goal

is

to

find

an

on-line

scheduling

algorithm

which

minimizes

the

total

flow

time

of

jobs

Let

O

denote

the

optimal

off-line

scheduling

algorithm

We

now

develop

some

notations

Let

P

denote

the

ratio

of

the

largest

to

the

smallest

processing

times

of

the

jobs

and

S

be

the

ratio

of

the

largest

to

the

smallest

slowness

of

the

machines

For

ease

of

notation

we

assume

that

the

smallest

processing

requirement

of

any

job

is

and

the

smallest

slowness

of

a

machine

is

Let

and

be

suitable

chosen

large

enough

constants

We

divide

the

jobs

and

the

machines

into

classes

A

job

j

is

said

to

be

in

class

k

if

p

j

-LSB-

k

-RRB-

and

a

machine

i

is

said

to

be

in

class

l

if

s

i

-LSB-

l

-RRB-

Note

that

there

are

O

-LRB-

log

P

-RRB-

classes

for

jobs

and

O

-LRB-

log

S

-RRB-

classes

for

machines

Given

a

schedule

A

we

say

that

a

job

j

is

active

at

time

t

in

A

if

r

j

t

but

j

has

not

finished

processing

by

time

t

in

A

We

now

describe

the

scheduling

algorithm

The

lying

idea

of

the

algorithm

is

the

following

if

we

send

a

job

j

to

machine

i

we

make

sure

that

it

waits

for

at

least

p

j

s

i

units

of

time

-LRB-

which

is

its

processing

time

on

machine

i

-RRB-

Intuitively

the

extra

waiting

time

can

be

charged

to

its

processing

time

Of

course

we

still

need

to

make

sure

that

the

processing

time

does

not

blow

up

in

this

process

The

algorithm

maintains

a

central

pool

of

jobs

When

a

new

job

gets

released

it

first

goes

to

the

central

pool

and

waits

there

to

get

assigned

to

a

machine

Let

W

-LRB-

t

-RRB-

denote

the

set

of

jobs

in

the

central

pool

at

time

t

Our

algorithm

will

assign

each

job

to

a

unique

machine

if

a

job

j

gets

assigned

to

a

machine

i

then

j

will

get

processed

by

machine

i

only

Let

A

i

-LRB-

t

-RRB-

be

the

set

of

active

jobs

at

time

t

which

have

been

assigned

to

machine

i

We

shall

maintain

the

invariant

that

A

i

-LRB-

t

-RRB-

contains

at

most

one

job

of

each

class

So

A

i

-LRB-

t

-RRB-

log

P

We

say

that

a

job

j

W

-LRB-

t

-RRB-

of

class

k

is

mature

for

a

machine

i

of

class

l

at

time

t

if

it

has

waited

for

at

least

k

l

time

in

the

central

pool

i.e.

t

r

j

k

l

For

any

time

t

we

define

a

total

order

on

the

jobs

in

W

-LRB-

t

-RRB-

as

follows

j

j

if

either

-LRB-

i

-RRB-

class

-LRB-

j

-RRB-

class

-LRB-

j

-RRB-

or

-LRB-

ii

-RRB-

class

-LRB-

j

-RRB-

class

-LRB-

j

-RRB-

and

r

j

r

j

-LRB-

in

case

class

-LRB-

j

-RRB-

class

-LRB-

j

-RRB-

and

r

j

r

j

we

can

order

them

arbitrarily

-RRB-

Now

we

describe

the

actual

details

of

the

algorithm

Initially

at

time

A

i

-LRB-

-RRB-

is

empty

for

each

machine

At

each

time

t

the

algorithm

considers

machines

in

the

order

m

-LRB-

recall

that

the

machines

have

been

arranged

in

the

ascending

order

of

their

slowness

-RRB-

Let

us

describe

the

algorithm

when

it

considers

machine

i.

Let

M

i

-LRB-

t

-RRB-

be

the

jobs

in

W

-LRB-

t

-RRB-

which

are

mature

for

machine

i

at

time

t.

Let

j

M

i

-LRB-

t

-RRB-

be

the

smallest

job

according

to

the

total

order

If

class

-LRB-

j

-RRB-

class

-LRB-

j

-RRB-

for

all

jobs

j

A

i

-LRB-

t

-RRB-

then

we

assign

j

to

machine

i

-LRB-

i.e.

we

delete

j

from

W

-LRB-

t

-RRB-

and

add

it

to

A

i

-LRB-

t

-RRB-

-RRB-

Once

the

algorithm

has

considered

all

the

machines

at

time

t

each

machine

i

processes

the

job

of

smallest

class

in

A

i

-LRB-

t

-RRB-

at

time

t

This

completes

the

description

of

our

algorithm

It

is

also

easy

to

see

that

the

machines

need

to

perform

the

above

steps

for

only

a

polynomial

number

of

time

steps

t

-LRB-

i.e.

when

a

job

finishes

or

matures

for

a

class

of

machines

-RRB-

We

remark

that

both

the

conditions

in

the

definition

of

are

necessary

The

condition

-LRB-

i

-RRB-

is

clear

because

it

prefers

smaller

jobs

Condition

-LRB-

ii

-RRB-

makes

sure

that

we

make

old

jobs

wait

longer

so

that

they

can

mature

for

slower

machines

It

is

easy

to

construct

examples

where

if

we

do

not

obey

condition

-LRB-

ii

-RRB-

then

slow

machines

will

never

get

used

and

so

we

will

incur

very

high

flow

time

We

now

show

that

the

flow

time

incurred

by

our

algorithm

is

within

poly-logarithmic

factor

of

that

of

the

optimal

algorithm

The

outline

of

the

proof

is

as

follows

We

first

argue

that

the

total

processing

time

incurred

by

our

algorithm

is

not

too

large

Once

we

have

shown

this

we

can

charge

the

waiting

time

of

all

the

jobs

in

A

i

-LRB-

t

-RRB-

for

all

machines

i

and

time

t

to

the

total

processing

time

After

this

we

show

that

the

total

waiting

time

of

the

jobs

in

the

central

pool

is

also

bounded

by

poly-logarithmic

factor

times

the

optimum

's

flow

time

Let

A

denote

our

algorithm

For

a

job

j

define

the

dispatch

time

d

A

j

of

j

in

A

as

the

time

at

which

it

is

assigned

to

a

machine

For

a

job

j

and

class

l

of

machines

let

t

M

-LRB-

j

l

-RRB-

denote

the

time

at

which

j

matures

for

machines

of

class

l

i.e.

t

M

-LRB-

j

l

-RRB-

r

j

k

l

where

k

is

the

class

of

job

j.

Let

F

A

denote

the

total

flow

time

of

our

algorithm

For

a

job

j

let

P

A

j

denote

the

time

it

takes

to

process

job

j

in

A

-LRB-

i.e.

the

processing

time

of

j

in

A

-RRB-

Similarly

for

a

set

of

jobs

J

define

P

A

J

as

the

total

processing

time

incurred

by

A

on

these

jobs

Let

P

A

denote

the

sum

P

j

P

A

j

i.e.

the

total

processing

time

incurred

by

A.

Define

F

O

P

O

j

P

O

J

and

P

O

similarly

Let

m

l

denote

the

number

of

machines

of

class

l.

Bounding

the

Processing

Time

We

shall

now

compare

P

A

with

F

O

For

each

value

of

class

k

of

jobs

and

class

l

of

machines

let

J

-LRB-

k

l

-RRB-

be

the

jobs

of

class

k

which

get

processed

by

A

on

machines

of

class

l.

For

each

value

of

k

and

l

we

shall

bound

the

processing

time

incurred

by

A

on

J

-LRB-

k

l

-RRB-

So

fix

a

class

k

of

jobs

and

class

l

of

machines

The

idea

of

the

proof

is

as

follows

We

shall

divide

the

time

line

into

intervals

I

-LRB-

t

b

t

e

-RRB-

I

-LRB-

t

b

t

e

-RRB-

so

that

each

interval

I

q

satisfies

the

following

property

A

is

almost

busy

in

I

q

processing

jobs

of

class

at

most

k

on

machines

of

class

l

or

less

Further

these

jobs

have

release

time

at

least

t

q

b

We

shall

denote

these

jobs

by

H

q

Now

if

O

schedules

jobs

in

J

-LRB-

k

l

-RRB-

on

machines

of

class

l

or

more

we

have

nothing

to

prove

since

O

would

incur

at

least

as

much

processing

time

as

we

do

for

these

jobs

If

O

schedules

some

jobs

in

J

-LRB-

k

l

-RRB-

on

machines

of

class

l

or

less

during

the

interval

I

q

then

one

of

these

two

cases

must

happen

-LRB-

i

-RRB-

some

jobs

in

H

q

need

to

be

processed

on

machines

of

class

l

or

more

or

-LRB-

ii

-RRB-

some

jobs

in

H

q

get

processed

after

time

t

q

e

We

shall

show

that

both

of

these

cases

are

good

for

us

and

we

can

charge

the

processing

times

of

jobs

in

J

-LRB-

k

l

-RRB-

to

the

flow

time

of

jobs

in

H

q

in

O.

Let

us

formalize

these

ideas

-LRB-

see

Figure

-RRB-

The

starting

points

of

the

intervals

I

I

will

be

in

decreasing

order

i.e.

t

b

t

b

-LRB-

so

we

shall

work

backwards

in

time

while

defining

these

intervals

-RRB-

Suppose

we

have

defined

intervals

I

I

so

far

Let

J

q

-LRB-

k

l

-RRB-

denote

the

set

of

jobs

in

J

-LRB-

k

l

-RRB-

which

get

released

before

interval

I

begins

i.e.

before

t

b

-LRB-

J

-LRB-

k

l

-RRB-

is

defined

as

J

-LRB-

k

l

-RRB-

-RRB-

Now

we

define

I

q

Let

j

q

J

q

-LRB-

k

l

-RRB-

be

the

job

with

the

highest

dispatch

time

Let

r

q

denote

the

release

time

of

j

q

Let

k

q

denote

the

class

of

job

j

q

Let

d

q

denote

the

dispatch

time

of

j

q

The

right

end-point

t

q

e

of

I

q

is

defined

as

d

q

Consider

the

jobs

in

J

-LRB-

k

l

-RRB-

which

get

dispatched

during

-LRB-

r

q

d

q

-RRB-

Let

j

q

be

such

a

job

with

the

earliest

release

date

Define

r

q

k

q

d

q

similarly

Let

H

q

-LRB-

l

-RRB-

l

l

be

the

set

of

jobs

of

class

at

most

k

q

which

are

dispatched

to

a

machine

of

class

l

during

the

time

interval

-LRB-

t

M

-LRB-

j

q

l

-RRB-

d

q

-RRB-

Note

that

the

phrase

class

at

most

k

q

in

the

previous

sentence

is

redundant

because

we

can

not

dispatch

a

job

of

class

greater

than

k

q

during

-LRB-

t

M

-LRB-

j

q

l

-RRB-

d

q

-RRB-

on

machines

of

class

l

-LRB-

otherwise

we

should

have

dispatched

j

q

earlier

-RRB-

Let

H

q

denote

l

H

q

-LRB-

l

-RRB-

Define

H

q

-LRB-

l

-RRB-

H

q

similarly

If

all

jobs

in

H

q

H

q

get

released

after

r

q

we

stop

the

process

here

Otherwise

find

a

job

in

H

q

H

q

which

has

the

earliest

release

date

let

j

q

denote

this

job

As

before

define

r

q

as

the

release

date

of

j

q

and

k

q

as

the

class

of

j

q

Again

define

H

q

-LRB-

l

-RRB-

as

the

set

of

jobs

-LRB-

of

class

at

most

k

q

-RRB-

which

get

dispatched

on

machines

of

class

l

during

-LRB-

t

M

-LRB-

j

q

l

-RRB-

d

q

-RRB-

Define

H

q

analogously

So

now

assume

we

have

defined

j

q

j

q

j

q

i

and

H

q

H

q

H

q

i

i

If

all

jobs

in

H

q

i

are

j

q

j

q

I

q

j

q

I

r

q

d

q

t

q

e

d

q

r

q

d

q

r

q

r

q

j

q

l

l

l

l

j

q

Figure

An

illustration

of

the

notation

used

released

after

r

q

i

then

we

stop

the

process

Otherwise

define

j

q

i

as

the

job

in

H

q

i

with

the

earliest

release

date

Define

H

q

i

in

a

similar

manner

-LRB-

see

Figure

-RRB-

We

remark

that

the

first

two

steps

of

this

process

differ

from

the

subsequent

steps

This

we

will

see

later

is

requierd

to

ensure

that

the

intervals

do

not

overlap

too

much

The

following

simple

observation

shows

that

this

process

will

stop

Claim

For

i

k

q

i

k

q

Proof

Consider

the

job

j

q

i

H

q

-LRB-

l

-RRB-

A

prefers

j

q

i

over

j

q

If

class

-LRB-

j

q

i

-RRB-

class

-LRB-

j

q

-RRB-

release

time

of

j

q

i

must

be

at

least

that

of

j

q

But

this

is

not

the

case

Thus

class

of

j

q

i

must

be

less

than

that

of

j

q

Suppose

this

process

stops

after

u

q

steps

Define

the

beginning

of

I

q

i.e.

t

q

b

as

r

q

u

q

This

completes

our

description

of

I

q

Let

H

q

denote

i

H

q

i

We

are

now

ready

to

show

that

interval

I

q

is

sufficiently

long

and

that

for

a

large

fraction

of

this

time

all

machines

of

class

less

than

l

are

processing

jobs

of

class

less

than

k

which

are

released

in

this

interval

itself

This

would

be

valuable

in

later

arguing

that

O

could

not

have

sched-uled

jobs

of

J

-LRB-

k

l

-RRB-

on

the

lower

class

machines

and

thereby

incurred

small

processing

time

Lemma

Length

of

the

interval

I

q

is

at

least

k

l

Proof

Indeed

job

j

q

must

wait

for

at

least

k

l

amount

of

time

before

being

dispatched

to

a

machine

of

class

l

So

t

q

e

t

q

s

d

q

r

q

k

l

Lemma

H

q

consists

of

jobs

of

class

at

most

k

and

all

jobs

in

H

q

are

released

after

t

q

b

Proof

The

first

statement

is

clear

from

the

definition

of

H

q

Let

us

look

at

H

q

i

As

argued

in

proof

of

Claim

all

jobs

of

class

k

q

i

in

H

q

i

are

released

after

r

q

i

If

all

jobs

of

class

less

than

k

q

i

in

H

q

i

are

released

after

r

q

i

then

we

are

done

Otherwise

all

such

jobs

are

released

after

r

q

i

-LRB-

after

r

q

if

i

-RRB-

This

completes

the

proof

of

the

lemma

Lemma

A

machine

of

class

l

l

processes

jobs

of

H

q

for

at

least

I

q

k

l

amount

of

time

during

I

q

Proof

Let

us

fix

a

machine

i

of

class

l

l.

Let

us

consider

the

interval

-LRB-

r

q

p

d

q

p

-RRB-

Job

j

q

p

matures

for

i

at

time

t

M

-LRB-

j

q

p

l

-RRB-

So

machine

i

must

be

busy

during

-LRB-

t

M

-LRB-

j

q

p

l

-RRB-

d

q

p

-RRB-

otherwise

we

could

have

dispatched

j

q

p

earlier

We

now

want

to

argue

that

machine

i

is

mainly

busy

during

this

interval

processing

jobs

from

H

q

Let

j

be

a

job

which

is

processed

by

i

during

-LRB-

t

M

-LRB-

j

q

p

l

-RRB-

d

q

p

-RRB-

We

have

already

noted

that

j

can

be

of

class

at

most

k

q

p

If

j

gets

dispatched

after

t

M

-LRB-

j

q

p

l

-RRB-

then

by

definition

it

belongs

to

H

q

If

j

gets

dispatched

before

t

M

-LRB-

j

q

p

l

-RRB-

it

must

belong

to

A

i

-LRB-

t

-RRB-

But

A

i

-LRB-

t

-RRB-

can

contain

at

most

one

job

of

each

class

So

the

total

processing

time

taken

by

jobs

of

A

i

-LRB-

t

-RRB-

during

-LRB-

t

d

p

-RRB-

is

at

most

l

-LRB-

k

q

p

-RRB-

k

q

p

l

So

during

-LRB-

r

q

p

d

q

p

-RRB-

i

processes

jobs

from

H

q

except

perhaps

for

a

period

of

length

-LRB-

t

M

-LRB-

j

q

p

l

-RRB-

r

q

p

-RRB-

k

q

p

l

k

q

p

l

Since

p

-LRB-

r

q

p

d

p

-RRB-

covers

I

q

the

amount

of

time

i

does

not

process

jobs

from

H

q

is

at

most

l

-LRB-

k

k

-RRB-

which

proves

the

lemma

We

would

like

to

charge

the

processing

time

for

jobs

in

J

-LRB-

k

l

-RRB-

in

our

solution

to

the

flow

time

of

jobs

in

H

q

in

O

But

to

do

this

we

require

that

the

sets

H

q

be

disjoint

We

next

prove

that

this

is

almost

true

Lemma

For

any

q

I

q

and

I

q

are

disjoint

Hence

H

q

and

H

q

are

also

disjoint

Proof

Recall

that

J

q

-LRB-

k

l

-RRB-

is

the

set

of

jobs

in

J

-LRB-

k

l

-RRB-

which

get

released

before

t

q

b

However

some

of

these

jobs

may

get

dispatched

after

t

q

b

and

hence

I

q

and

I

q

can

intersect

Consider

some

job

j

J

q

-LRB-

k

l

-RRB-

which

is

dispatched

during

I

q

Now

observe

that

j

q

is

released

before

t

q

b

-LRB-

by

definition

of

J

q

-LRB-

k

l

-RRB-

-RRB-

and

dispatched

after

j.

So

j

gets

dispatched

in

-LRB-

r

q

d

q

-RRB-

This

means

that

release

date

of

j

q

must

be

before

release

date

of

j

But

t

q

b

r

q

and

so

j

is

released

after

t

q

b

But

then

j

J

q

-LRB-

k

l

-RRB-

So

all

jobs

in

J

q

-LRB-

k

l

-RRB-

get

dispatched

before

I

q

begins

which

implies

that

I

q

and

I

q

are

disjoint

Consider

an

interval

I

q

Let

D

q

-LRB-

k

l

-RRB-

denote

the

jobs

in

J

-LRB-

k

l

-RRB-

which

get

released

after

t

q

b

but

dispatched

before

t

q

e

It

is

easy

to

see

that

D

q

-LRB-

k

l

-RRB-

is

a

superset

of

J

q

-LRB-

k

l

-RRB-

J

q

-LRB-

k

l

-RRB-

So

q

D

q

-LRB-

k

l

-RRB-

covers

all

of

J

-LRB-

k

l

-RRB-

Now

we

would

like

to

charge

the

processing

time

of

jobs

in

D

q

-LRB-

k

l

-RRB-

to

the

flow

time

incurred

by

O

on

the

jobs

in

H

q

Before

we

do

this

let

us

first

show

that

O

incurs

significant

amount

of

flow

time

processing

the

jobs

in

H

q

This

is

proved

in

the

technical

theorem

below

whose

proof

we

defer

to

the

appendix

Theorem

Consider

a

time

interval

I

-LRB-

t

b

t

e

-RRB-

of

length

T

Suppose

there

exists

a

set

of

jobs

J

I

such

that

every

job

j

J

I

is

of

class

at

most

k

and

is

released

after

t

b

Further

A

dispatches

all

the

jobs

in

J

I

during

I

and

only

on

machines

of

class

less

than

l.

Further

each

machine

i

of

class

l

l

satisfies

the

following

condition

machine

i

processes

jobs

from

J

I

for

at

least

T

k

l

amount

of

time

Assuming

T

k

l

the

flow

time

F

O

J

I

incurred

by

O

on

the

jobs

in

J

I

is

at

least

P

A

J

I

Substituting

t

b

t

q

b

t

e

t

q

e

I

I

q

T

I

q

J

I

H

q

in

the

statement

of

Theorem

and

using

Lemmas

we

get

P

A

H

q

O

-LRB-

F

O

H

q

-RRB-

-LRB-

-RRB-

We

are

now

ready

to

prove

the

main

theorem

of

this

section

Theorem

The

processing

time

incurred

by

A

on

D

q

-LRB-

k

l

-RRB-

namely

P

A

D

q

-LRB-

k

l

-RRB-

is

O

-LRB-

F

O

H

q

F

O

D

q

-LRB-

k

l

-RRB-

-RRB-

Proof

Let

V

denote

the

volume

of

D

q

-LRB-

k

l

-RRB-

By

Lemma

machines

of

class

l

do

not

process

jobs

from

H

q

for

at

most

k

l

units

of

time

during

I

q

This

period

translates

to

a

job-volume

of

at

most

k

If

V

is

sufficiently

small

then

it

can

be

charged

to

the

processing

time

-LRB-

or

equivalently

the

flow

time

in

O

-RRB-

of

the

jobs

in

H

q

Lemma

If

V

c

k

-LRB-

m

m

-RRB-

where

c

is

a

constant

then

P

A

D

q

-LRB-

k

l

-RRB-

is

O

-LRB-

F

O

H

q

-RRB-

Proof

The

processing

time

incurred

by

A

on

D

q

-LRB-

k

l

-RRB-

is

at

most

l

V

O

-LRB-

k

l

-LRB-

m

m

-RRB-

-RRB-

Now

Lemmas

and

imply

that

machines

of

class

l

l

process

jobs

from

H

q

for

at

least

k

l

amount

of

time

So

P

A

H

q

is

at

least

k

l

-LRB-

m

m

-RRB-

Using

equation

-LRB-

-RRB-

we

get

the

result

So

from

now

on

we

shall

assume

that

V

c

k

-LRB-

m

m

-RRB-

for

a

sufficiently

large

constant

c

We

deal

with

easy

cases

first

Lemma

In

each

of

the

following

cases

P

A

D

q

-LRB-

k

l

-RRB-

is

O

-LRB-

F

O

D

q

-LRB-

k

l

-RRB-

F

O

H

q

-RRB-

-LRB-

i

-RRB-

At

least

V

volume

of

D

q

-LRB-

k

l

-RRB-

is

processed

on

machines

of

class

at

least

l

by

O.

-LRB-

ii

-RRB-

At

least

V

volume

of

D

q

-LRB-

k

l

-RRB-

is

finished

by

O

after

time

t

q

e

k

l

-LRB-

iii

-RRB-

At

least

V

volume

of

H

q

is

processed

by

O

on

machines

of

class

l

or

more

Proof

Note

that

P

A

D

q

-LRB-

k

l

-RRB-

is

at

most

V

l

If

-LRB-

i

-RRB-

happens

O

pays

at

least

amount

of

processing

time

for

D

q

-LRB-

k

l

-RRB-

and

so

we

are

done

Suppose

case

-LRB-

ii

-RRB-

occurs

All

jobs

in

D

q

-LRB-

k

l

-RRB-

get

dispatched

by

time

t

q

e

So

they

must

get

released

before

t

q

e

k

l

So

at

least

volume

of

these

jobs

wait

for

at

least

k

l

amount

of

time

in

O

This

means

that

F

O

D

q

-LRB-

k

l

-RRB-

is

at

least

V

l

because

each

job

has

size

at

most

k

This

again

implies

the

lemma

Case

-LRB-

iii

-RRB-

is

similar

to

case

-LRB-

i

-RRB-

So

we

can

assume

that

of

the

cases

in

Lemma

occur

Now

consider

a

time

t

between

t

q

e

k

l

and

t

q

e

Let

us

look

at

machines

of

class

to

l

O

finishes

at

least

V

volume

of

D

q

-LRB-

k

l

-RRB-

on

these

machines

before

time

t.

Further

at

most

V

volume

of

H

q

goes

out

from

these

machines

to

machines

of

higher

class

The

volume

that

corresponds

to

time

slots

in

which

these

machines

do

not

process

jobs

of

H

q

in

A

is

at

most

-LRB-

for

a

sufficiently

large

constant

c

-RRB-

So

at

least

V

amount

of

volume

of

H

q

must

be

waiting

in

O

at

time

t

So

the

total

flow

time

incurred

by

O

on

H

q

is

at

least

V

-LRB-

k

-RRB-

k

l

which

again

is

-LRB-

V

l

-RRB-

This

proves

the

theorem

Combining

the

above

theorem

with

Lemma

we

get

Corollary

P

A

J

-LRB-

k

l

-RRB-

is

O

-LRB-

F

O

-RRB-

and

so

P

A

is

O

-LRB-

log

S

log

P

F

O

-RRB-

Bounding

the

flow

time

We

now

show

that

the

average

flow

time

incurred

by

our

algorithm

is

within

poly-logarithmic

factor

of

that

incurred

by

the

optimal

solution

We

shall

say

that

a

job

j

is

waiting

at

time

t

in

A

if

it

is

in

the

central

pool

at

time

t

in

A

and

has

been

released

before

time

t.

Let

V

A

k

-LRB-

t

-RRB-

denote

the

volume

of

jobs

of

class

at

most

k

which

are

waiting

at

time

t

in

A.

Define

V

O

k

-LRB-

t

-RRB-

as

the

remaining

volume

of

jobs

of

class

at

most

k

which

are

active

at

time

t

in

O.

Note

the

slight

difference

in

the

definitions

for

A

and

O

in

case

of

A

we

are

counting

only

those

jobs

which

are

in

the

central

pool

while

in

O

we

are

counting

all

active

jobs

Our

goal

is

to

show

that

for

all

values

of

k

P

t

V

A

k

-LRB-

t

-RRB-

is

bounded

from

above

by

P

t

V

O

k

-LRB-

t

-RRB-

plus

small

additive

factors

i.e.

O

-LRB-

k

-LRB-

P

O

P

A

-RRB-

-RRB-

Once

we

have

this

the

desired

result

will

follow

from

standard

calculations

Before

we

go

to

the

details

of

the

analysis

let

us

first

show

how

to

prove

such

a

fact

when

all

machines

are

of

the

same

speed

say

The

argument

for

this

case

follows

directly

from

-LSB-

-RSB-

but

we

describe

it

to

develop

some

intuition

for

the

more

general

case

Fix

a

time

t

and

class

k

of

jobs

Suppose

all

machines

are

processing

jobs

of

class

at

most

k

at

time

t

in

our

schedule

Let

t

be

the

first

time

before

t

at

which

there

is

at

least

one

machine

in

A

which

is

not

processing

jobs

of

class

k

or

less

-LRB-

if

there

is

no

such

time

set

t

as

-RRB-

It

follows

that

at

time

t

there

are

no

jobs

of

class

k

or

less

which

are

mature

for

these

machines

-LRB-

since

all

machines

are

identical

a

job

becomes

mature

for

all

the

machines

at

the

same

time

-RRB-

So

these

jobs

must

have

been

released

after

t

k

During

-LRB-

t

k

t

-RRB-

the

optimal

schedule

can

process

at

most

m

k

volume

of

jobs

of

class

at

most

k

So

it

follows

that

V

A

k

-LRB-

t

-RRB-

V

O

k

-LRB-

t

-RRB-

is

at

most

m

k

Since

our

schedule

processes

jobs

of

class

at

most

k

during

-LRB-

t

t

-RRB-

we

get

V

A

k

-LRB-

t

-RRB-

V

O

k

-LRB-

t

-RRB-

x

A

-LRB-

t

-RRB-

k

where

x

A

-LRB-

t

-RRB-

denotes

the

number

of

busy

machines

at

timer

t

in

our

schedule

-LRB-

x

A

-LRB-

t

-RRB-

is

same

as

m

because

all

machines

are

busy

at

time

t

-RRB-

The

other

case

when

a

machine

may

be

processing

jobs

of

class

more

than

k

or

remain

idle

at

time

t

can

be

shown

similarly

to

yield

the

same

expression

Adding

this

for

all

values

of

t

we

get

P

t

V

A

k

-LRB-

t

-RRB-

P

t

V

O

k

-LRB-

t

-RRB-

is

at

most

k

P

A

which

is

what

we

wanted

to

show

This

argument

does

not

extend

to

the

case

when

machines

can

have

different

speeds

There

might

be

a

very

slow

machine

which

is

not

processing

jobs

of

class

k

or

less

-LRB-

it

may

be

idle

-RRB-

but

then

the

jobs

which

are

waiting

could

have

been

released

much

earlier

and

so

we

can

not

argue

that

the

volume

of

remaining

jobs

of

class

at

most

k

at

time

t

in

the

two

schedules

are

close

This

complicates

our

proof

and

instead

of

defining

one

time

t

as

above

we

need

to

define

a

sequence

of

times

Before

we

describe

this

process

we

need

more

notations

These

are

summarized

in

the

table

below

for

ease

of

reference

Let

j

k

-LRB-

t

-RRB-

J

k

-LRB-

t

-RRB-

be

the

job

with

the

earliest

release

date

Let

r

k

-LRB-

t

-RRB-

denote

the

release

date

of

job

j

k

-LRB-

t

-RRB-

and

c

k

-LRB-

t

-RRB-

denote

the

class

of

j

k

-LRB-

t

-RRB-

Let

l

k

-LRB-

t

-RRB-

denote

the

largest

l

such

that

j

k

-LRB-

t

-RRB-

has

matured

for

machines

of

class

l

at

time

t

In

other

words

l

k

-LRB-

t

-RRB-

is

the

highest

value

of

l

such

that

t

M

-LRB-

j

l

-RRB-

t.

Observe

that

all

machines

of

class

l

k

-LRB-

t

-RRB-

or

less

must

be

busy

processing

jobs

of

class

at

most

c

k

-LRB-

t

-RRB-

at

time

t

otherwise

our

algorithm

should

have

dispatched

j

by

time

t

Our

proof

will

use

the

following

lemma

Lemma

For

any

class

k

of

jobs

and

time

t

V

A

k

-LRB-

t

-RRB-

V

O

k

-LRB-

t

-RRB-

c

k

-LRB-

t

-RRB-

m

-LRB-

l

k

-LRB-

t

-RRB-

-RRB-

V

A

-LRB-

c

k

-LRB-

t

-RRB-

-RRB-

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

V

O

-LRB-

c

k

-LRB-

t

-RRB-

-RRB-

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

X

ll

k

-LRB-

t

-RRB-

P

O

l

-LRB-

r

k

-LRB-

t

-RRB-

t

-RRB-

Proof

Let

V

A

denote

the

volume

of

jobs

of

class

at

most

k

which

are

processed

by

A

on

machines

of

class

l

k

-LRB-

t

-RRB-

or

less

during

-LRB-

r

k

-LRB-

t

-RRB-

t

-RRB-

Define

U

A

as

the

volume

of

jobs

of

class

at

most

k

which

are

processed

by

A

on

machines

of

class

l

k

-LRB-

t

-RRB-

or

more

during

-LRB-

r

k

-LRB-

t

-RRB-

t

-RRB-

Define

V

O

and

U

O

similarly

Clearly

V

A

k

-LRB-

t

-RRB-

V

O

k

-LRB-

t

-RRB-

V

A

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

V

O

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

-LRB-

V

O

V

A

-RRB-

-LRB-

U

O

U

A

-RRB-

Let

us

look

at

V

O

V

A

first

Any

machine

of

class

l

l

k

-LRB-

t

-RRB-

is

busy

in

A

during

-LRB-

t

M

-LRB-

j

k

-LRB-

t

-RRB-

l

-RRB-

t

-RRB-

processing

jobs

of

class

at

most

c

k

-LRB-

t

-RRB-

The

amount

of

volume

O

can

process

on

such

machines

during

-LRB-

r

k

-LRB-

t

-RRB-

t

M

-LRB-

j

k

-LRB-

t

-RRB-

l

-RRB-

-RRB-

is

at

most

m

l

ck

-LRB-

t

-RRB-

l

l

which

is

at

most

m

l

c

k

-LRB-

t

-RRB-

So

we

get

V

O

V

A

m

-LRB-

l

k

-LRB-

t

-RRB-

-RRB-

c

k

-LRB-

t

-RRB-

Let

us

now

consider

V

A

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

V

O

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

Let

us

consider

jobs

of

class

c

k

-LRB-

t

-RRB-

or

more

which

are

waiting

at

time

r

k

-LRB-

t

-RRB-

in

A

-LRB-

so

they

were

released

before

r

k

-LRB-

t

-RRB-

-RRB-

By

our

definition

of

j

k

-LRB-

t

-RRB-

all

such

jobs

must

be

processed

by

time

t

in

A

If

l

l

k

-LRB-

t

-RRB-

then

such

jobs

can

be

done

on

machines

of

class

l

only

during

-LRB-

t

M

-LRB-

j

k

-LRB-

t

-RRB-

l

-RRB-

t

-RRB-

So

again

we

can

show

that

the

total

volume

of

such

jobs

is

at

most

m

-LRB-

l

k

-LRB-

t

-RRB-

-RRB-

c

k

-LRB-

t

-RRB-

U

A

Thus

we

get

V

A

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

V

O

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

m

-LRB-

l

k

-LRB-

t

-RRB-

-RRB-

c

k

-LRB-

t

-RRB-

U

A

V

A

-LRB-

c

k

-LRB-

t

-RRB-

-RRB-

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

V

O

-LRB-

c

k

-LRB-

t

-RRB-

-RRB-

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

because

V

O

-LRB-

c

k

-LRB-

t

-RRB-

-RRB-

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

V

O

k

-LRB-

r

k

-LRB-

t

-RRB-

-RRB-

Finally

note

that

U

O

is

at

most

P

ll

k

-LRB-

t

-RRB-

P

O

l

-LRB-

r

k

-LRB-

t

-RRB-

t

-RRB-

Combining

everything

we

get

the

result

The

rest

of

the

proof

is

really

about

unraveling

the

expression

in

the

lemma

above

To

illustrate

the

ideas

involved

let

us

try

to

prove

the

special

case

for

jobs

of

class

only

The

lemma

above

implies

that

V

A

-LRB-

t

-RRB-

V

O

-LRB-

t

-RRB-

m

-LRB-

l

-LRB-

t

-RRB-

-RRB-

P

ll

-LRB-

t

-RRB-

P

O

l

-LRB-

r

-LRB-

t

-RRB-

t

-RRB-

We

are

really

interested

in

P

t

-LRB-

V

A

-LRB-

t

-RRB-

V

O

-LRB-

t

-RRB-

-RRB-

Now

the

sum

P

t

m

-LRB-

l

-LRB-

t

-RRB-

-RRB-

is

not

a

problem

because

we

know

that

at

time

t

all

machines

of

class

l

-LRB-

t

-RRB-

or

less

must

be

busy

in

A.

So

x

A

-LRB-

t

-RRB-

m

-LRB-

l

-LRB-

t

-RRB-

-RRB-

So

P

t

m

-LRB-

l

-LRB-

t

-RRB-

-RRB-

is

at

most

P

t

x

A

-LRB-

t

-RRB-

which

is

the

total

processing

time

of

A

It

is

little

tricky

to

bound

the

second

term

We

shall

write

P

ll

-LRB-

t

-RRB-

P

O

l

-LRB-

r

-LRB-

t

-RRB-

t

-RRB-

as

P

ll

-LRB-

t

-RRB-

P

t

t

r

-LRB-

t

-RRB-

x

O

l

-LRB-

t

-RRB-

We

can

think

of

this

as

saying

that

at

time

time

t

r

-LRB-

t

-RRB-

t

t

we

are

charging

amount

to

each

machine

of

class

l

which

is

busy

at

time

t

in

O.

Note

that

here

l

is

at

least

l

-LRB-

t

-RRB-

Now

we

consider

P

t

P

ll

-LRB-

t

-RRB-

P

t

t

r

-LRB-

t

-RRB-

x

O

l

-LRB-

t

-RRB-

For

a

fixed

time

t

and

a

machine

i

of

class

l

which

is

busy

at

time

t

in

O

let

us

see

for

how

many

times

t

we

charge

to

i

We

charge

to

i

at

time

t

if

t

lies

in

the

interval

-LRB-

r

-LRB-

t

-RRB-

t

-RRB-

and

l

l

-LRB-

t

-RRB-

Suppose

this

happens

We

claim

that

t

t

has

to

be

at

most

l

Indeed

otherwise

t

r

-LRB-

t

-RRB-

l

and

so

j

-LRB-

t

-RRB-

has

matured

for

machines

of

class

l

as

well

But

then

l

l

-LRB-

t

-RRB-

So

the

total

amount

of

charge

machine

i

gets

at

time

t

is

at

most

l

O

-LRB-

-RRB-

Thus

the

total

sum

turns

out

to

be

at

most

a

constant

times

the

total

processing

time

of

O.

Let

us

now

try

to

prove

this

for

the

general

case

We

build

some

notation

first

Fix

a

time

t

and

class

k

We

shall

define

a

sequence

of

times

t

t

and

a

sequence

of

jobs

j

-LRB-

t

-RRB-

j

-LRB-

t

-RRB-

associated

with

this

sequence

of

times

c

i

-LRB-

t

-RRB-

shall

denote

the

class

of

the

job

j

i

-LRB-

t

-RRB-

Let

us

see

how

we

define

this

sequence

First

of

all

t

t

and

j

-LRB-

t

-RRB-

is

the

job

j

k

-LRB-

t

-RRB-

-LRB-

as

defined

above

-RRB-

Recall

the

definition

of

j

k

-LRB-

t

-RRB-

it

is

the

job

with

the

earliest

release

date

among

all

jobs

of

class

at

most

k

which

are

waiting

at

time

t

in

A.

Note

that

c

-LRB-

t

-RRB-

the

class

of

this

job

can

be

less

than

k

Now

suppose

we

have

defined

t

t

i

and

j

-LRB-

t

-RRB-

j

i

-LRB-

t

-RRB-

i

t

i

is

the

release

date

of

j

i

-LRB-

t

-RRB-

j

i

-LRB-

t

-RRB-

is

defined

as

the

job

j

c

i

-LRB-

t

-RRB-

-LRB-

t

i

-RRB-

i.e.

the

job

with

the

earliest

release

date

among

all

jobs

of

class

less

than

c

i

-LRB-

t

-RRB-

waiting

at

time

t

i

in

A

We

shall

also

define

a

sequence

of

classes

of

machines

l

-LRB-

t

-RRB-

l

-LRB-

t

-RRB-

in

the

following

manner

l

i

-LRB-

t

-RRB-

is

the

highest

class

l

of

machines

such

that

job

j

i

-LRB-

t

-RRB-

has

matured

for

machines

of

class

l

at

time

t

i

Figure

illustrates

these

definitions

The

vertical

line

at

time

t

i

denotes

l

i

-LRB-

t

-RRB-

the

height

of

this

line

is

proportional

to

l

i

-LRB-

t

-RRB-

We

note

the

following

simple

fact

Claim

l

i

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

t

i

t

i

l

i

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

Proof

Indeed

t

i

is

the

release

date

of

j

i

-LRB-

t

-RRB-

and

j

i

-LRB-

t

-RRB-

matures

for

machines

of

class

l

i

-LRB-

t

-RRB-

at

time

t

i

but

not

for

machines

of

class

l

i

-LRB-

t

-RRB-

at

time

t

i

The

statement

in

Lemma

can

be

unrolled

iteratively

to

give

the

following

inequality

V

A

k

-LRB-

t

-RRB-

V

O

k

-LRB-

t

-RRB-

-LRB-

c

-LRB-

t

-RRB-

m

l

-LRB-

t

-RRB-

c

-LRB-

t

-RRB-

m

l

-LRB-

t

-RRB-

-RRB-

X

ll

-LRB-

t

-RRB-

P

O

l

-LRB-

t

t

-RRB-

X

ll

-LRB-

t

-RRB-

P

O

l

-LRB-

t

t

-RRB-

A

-LRB-

-RRB-

Let

us

try

to

see

what

the

inequality

means

First

look

at

the

term

c

i

-LRB-

t

-RRB-

m

l

i

-LRB-

t

-RRB-

Consider

a

machine

of

class

l

l

i

-LRB-

t

-RRB-

It

is

busy

in

A

during

-LRB-

t

M

-LRB-

j

i

-LRB-

t

-RRB-

l

-RRB-

t

i

-RRB-

Now

t

i

t

M

-LRB-

j

i

-LRB-

t

-RRB-

l

-RRB-

-LRB-

t

i

t

i

-RRB-

-LRB-

t

M

-LRB-

j

i

-LRB-

t

-RRB-

l

-RRB-

t

i

-RRB-

l

i

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

l

c

i

-LRB-

t

-RRB-

l

as

l

l

i

-LRB-

t

-RRB-

Hence

machine

l

is

also

busy

in

A

during

-LRB-

t

i

c

i

-LRB-

t

-RRB-

l

t

i

-RRB-

So

the

term

c

i

-LRB-

t

-RRB-

m

l

i

-LRB-

t

-RRB-

is

essentially

saying

that

we

charge

l

amount

to

each

machine

of

class

l

l

i

-LRB-

t

-RRB-

during

each

time

in

-LRB-

t

i

x

A

-LRB-

t

-RRB-

x

O

-LRB-

t

-RRB-

Number

of

machines

busy

at

time

t

in

A

O.

x

A

l

-LRB-

t

-RRB-

x

O

l

-LRB-

t

-RRB-

Number

of

machines

of

class

l

busy

at

time

t

in

A

O.

P

A

l

-LRB-

t

t

-RRB-

P

O

l

-LRB-

t

t

-RRB-

Total

processing

time

incurred

by

machines

of

class

l

during

-LRB-

t

t

-RRB-

in

A

O.

m

l

m

l

m

l

Number

of

machines

of

class

l

at

most

l

less

than

l.

m

-LRB-

l

l

-RRB-

Number

of

machines

of

class

between

-LRB-

and

including

-RRB-

l

and

l

J

-LRB-

k

t

-RRB-

Set

of

jobs

of

class

at

most

k

which

are

waiting

at

time

t

in

A.

Table

Table

of

definitions

t

t

t

t

t

l

l

l

l

l

t

l

t

r

jj

j

r

r

r

r

r

j

j

j

j

j

Figure

Illustrating

the

definitions

of

t

and

c

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

l

t

i

-RRB-

These

intervals

are

shown

in

figure

using

light

shade

So

a

machine

i

of

class

l

which

is

busy

in

A

during

these

lightly

shaded

regions

is

charged

l

units

Let

us

now

look

at

the

term

P

ll

i

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

t

i

-RRB-

This

means

the

following

consider

a

machine

of

class

l

l

i

-LRB-

t

-RRB-

which

is

busy

in

O

at

some

time

t

during

-LRB-

t

i

t

i

-RRB-

then

we

charge

it

units

Figure

illustrates

this

fact

we

charge

to

all

machines

of

class

l

l

i

-LRB-

t

-RRB-

which

are

busy

in

O

during

the

darkly

shaded

regions

Let

us

see

how

we

can

simplify

the

picture

We

say

that

the

index

i

is

suffix

maximum

if

l

i

-LRB-

t

-RRB-

l

-LRB-

t

-RRB-

l

-LRB-

t

-RRB-

-LRB-

i

is

always

suffix

maximum

-RRB-

In

Figure

t

t

and

t

are

suffix

maximum

Let

the

indices

which

are

suffix

maximum

be

i

i

i

The

following

lemma

says

that

we

can

consider

only

suffix

maximum

indices

in

-LRB-

-RRB-

We

defer

its

proof

to

the

appendix

Lemma

V

A

k

-LRB-

t

-RRB-

V

O

k

-LRB-

t

-RRB-

X

i

u

c

iu

-LRB-

t

-RRB-

m

-LRB-

l

-LRB-

t

-RRB-

l

iu

-LRB-

t

-RRB-

-RRB-

X

i

u

X

ll

iu

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

u

t

i

u

-RRB-

where

i

u

varies

over

the

suffix

maximum

indices

-LRB-

define

l

i

-LRB-

t

-RRB-

as

-RRB-

Recall

that

m

-LRB-

l

l

-RRB-

denotes

the

number

of

machines

of

class

between

l

and

l

Figure

shows

what

Lemma

is

saying

In

the

lightly

shaded

region

if

there

is

a

machine

of

class

l

which

is

busy

at

some

time

t

in

A

we

charge

it

l

units

at

time

t

In

the

darkly

shaded

region

if

there

is

a

machine

i

of

class

l

which

is

busy

at

time

t

in

O

we

charge

it

units

Now

we

try

to

bound

the

charges

on

the

darkly

shaded

region

for

all

time

t.

Let

us

fix

a

machine

h

of

class

l.

Suppose

h

is

busy

in

O

at

time

t

We

are

charging

amount

to

h

at

time

t

if

the

following

condition

holds

for

all

i

such

that

t

i

t

l

i

-LRB-

t

-RRB-

is

at

most

l

Now

we

ask

if

we

fix

t

for

how

many

values

of

t

do

we

charge

h

at

time

t

The

following

claim

shows

that

this

can

not

be

too

large

Claim

Given

a

machine

h

of

class

l

we

can

charge

it

for

the

darkly

shaded

region

at

time

t

for

at

most

l

k

values

of

t.

Proof

Suppose

we

charge

h

at

time

t

for

some

value

of

t.

Fix

this

t.

Clearly

t

t

Let

i

be

the

largest

index

such

that

t

t

i

So

t

t

t

t

i

Now

consider

any

i

i.

Lemma

implies

that

t

i

t

i

l

i

-LRB-

t

-RRB-

i

-LRB-

t

-RRB-

l

c

i

-LRB-

t

-RRB-

Since

c

i

-LRB-

t

-RRB-

decrease

as

i

increases

P

i

i

-LRB-

t

i

t

i

-RRB-

l

k

This

implies

the

claim

So

the

total

amount

of

charge

to

machine

h

at

time

t

is

at

most

k

Thus

we

get

the

following

fact

X

t

@X

i

u

X

ll

iu

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

u

t

i

u

-RRB-

A

k

P

O

-LRB-

-RRB-

Now

we

look

at

the

charges

on

the

lightly

shaded

region

Let

h

be

a

machine

of

class

l

which

is

busy

in

A

at

time

t

As

argued

earlier

we

charge

l

units

to

h

at

time

t

if

the

following

condition

holds

there

exists

a

suffix

maximum

index

i

u

such

that

t

lies

in

the

interval

-LRB-

t

i

u

c

iu

-LRB-

t

-RRB-

l

t

i

u

-RRB-

Further

for

all

suffix

maximum

indices

i

i

u

it

must

be

the

case

that

l

i

-LRB-

t

-RRB-

l

Now

we

want

to

know

for

how

many

values

of

t

do

we

charge

h

at

time

t

t

t

t

t

t

l

l

l

l

l

t

l

t

r

jj

j

r

r

r

r

r

j

j

j

j

j

Figure

Illustrating

Lemma

Claim

Given

a

machine

h

of

class

l

we

can

charge

it

for

the

lightly

shaded

region

at

time

t

for

at

most

l

k

values

of

t.

Proof

Fix

a

time

t

such

that

while

accounting

for

V

A

k

-LRB-

t

-RRB-

we

charge

h

at

time

t

So

there

is

a

maximum

index

i

u

such

that

t

i

u

t

c

iu

-LRB-

t

-RRB-

l

Further

if

i

is

an

index

less

than

i

u

then

l

i

-LRB-

t

-RRB-

must

be

less

than

l

We

can

argue

as

in

the

proof

of

Claim

that

t

t

i

u

can

be

at

most

l

k

So

t

t

l

k

So

we

get

X

t

X

i

u

c

iu

-LRB-

t

-RRB-

m

-LRB-

l

-LRB-

t

-RRB-

l

iu

-LRB-

t

-RRB-

-RRB-

k

P

A

-LRB-

-RRB-

Putting

everything

together

we

see

that

Lemma

and

equations

-LRB-

-RRB-

and

-LRB-

-RRB-

imply

that

there

is

a

constant

c

such

that

X

t

V

A

k

-LRB-

t

-RRB-

X

t

V

O

k

-LRB-

t

-RRB-

c

k

-LRB-

P

O

P

A

-RRB-

-LRB-

-RRB-

The

final

result

now

follows

from

standard

calculations

Theorem

F

A

is

O

-LRB-

log

S

log

P

F

O

-RRB-

Proof

We

have

already

bounded

the

processing

time

of

A

Once

a

job

gets

dispatched

to

a

machine

i

its

waiting

time

can

be

charged

to

the

processing

done

by

i

Since

at

any

time

t

there

are

at

most

log

P

active

jobs

dispatched

to

a

machine

the

total

waiting

time

of

jobs

after

their

dispatch

time

is

at

most

O

-LRB-

log

P

P

A

-RRB-

So

we

just

need

to

bound

the

time

for

which

jobs

are

waiting

in

the

central

pool

Let

n

A

k

-LRB-

t

-RRB-

be

the

number

of

jobs

of

class

k

waiting

in

the

central

pool

at

time

t

in

our

algorithm

Let

n

O

k

-LRB-

t

-RRB-

be

the

number

of

jobs

of

class

k

which

are

active

at

time

t

in

O

-LRB-

note

the

difference

in

the

definitions

of

the

two

quantities

-RRB-

Since

jobs

waiting

in

the

central

pool

in

A

have

not

been

processed

at

all

it

is

easy

to

see

that

n

A

k

-LRB-

t

-RRB-

V

A

k

-LRB-

t

-RRB-

k

Further

V

O

k

-LRB-

t

-RRB-

k

n

O

k

-LRB-

t

-RRB-

n

O

-LRB-

t

-RRB-

Combining

these

observations

with

equation

-LRB-

-RRB-

we

get

for

all

values

of

k

X

t

n

A

k

-LRB-

t

-RRB-

X

t

n

O

k

-LRB-

t

-RRB-

n

O

-LRB-

t

-RRB-

n

O

-LRB-

t

-RRB-

c

-LRB-

P

O

P

A

-RRB-

We

know

that

total

flow

time

of

a

schedule

is

equal

to

the

sum

over

all

time

t

of

the

number

of

active

jobs

at

time

t

in

the

schedule

So

adding

the

equation

above

for

all

values

of

k

and

using

Corollary

implies

the

theorem

We

would

like

to

express

our

thanks

to

Gagan

Goel

Vinayaka

Pandit

Yogish

Sabharwal

and

Raghavendra

Udupa

for

useful

discussions

-LSB-

-RSB-

N.

Avrahami

and

Y.

Azar

Minimizing

total

flow

time

and

total

completion

time

with

immediate

dispatching

In

Proc

Symp

on

Parallel

Algorithms

and

Architectures

-LRB-

SPAA

-RRB-

pages

ACM

-LSB-

-RSB-

Baruch

Awerbuch

Yossi

Azar

Stefano

Leonardi

and

Oded

Regev

Minimizing

the

flow

time

without

migration

In

ACM

Symposium

on

Theory

of

Computing

pages

-LSB-

-RSB-

N.

Bansal

and

K.

Pruhs

Server

scheduling

in

the

l

p

norm

A

rising

tide

lifts

all

boats

In

ACM

Symposium

on

Theory

of

Computing

pages

-LSB-

-RSB-

Luca

Becchetti

Stefano

Leonardi

Alberto

Marchetti-Spaccamela

and

Kirk

R.

Pruhs

Online

weighted

flow

time

and

deadline

scheduling

Lecture

Notes

in

Computer

Science

-LSB-

-RSB-

C.

Chekuri

S.

Khanna

and

A.

Zhu

Algorithms

for

weighted

flow

time

In

ACM

Symposium

on

Theory

of

Computing

pages

ACM

-LSB-

-RSB-

Chandra

Chekuri

Ashish

Goel

Sanjeev

Khanna

and

Amit

Kumar

Multi-processor

scheduling

to

minimize

flow

time

with

epsilon

resource

augmentation

In

ACM

Symposium

on

Theory

of

Computing

pages

-LSB-

-RSB-

R.

L.

Graham

E.

L.

Lawler

J.

K.

Lenstra

and

A.

H.

G.

Rinnooy

Kan.

Optimization

and

approximation

in

deterministic

sequencing

and

scheduling

a

survey

Ann

Discrete

Math.

-LSB-

-RSB-

Bala

Kalyanasundaram

and

Kirk

Pruhs

Speed

is

as

powerful

as

clairvoyance

In

IEEE

Symposium

on

Foundations

of

Computer

Science

pages

-LSB-

-RSB-

Hans

Kellerer

Thomas

Tautenhahn

and

Gerhard

J.

Woeginger

Approximability

and

nonapproximability

results

for

minimizing

total

flow

time

on

a

single

machine

In

ACM

Symposium

on

Theory

of

Cmputing

pages

-LSB-

-RSB-

Stefano

Leonardi

and

Danny

Raz

Approximating

total

flow

time

on

parallel

machines

In

ACM

Symposium

on

Theory

of

Computing

pages

-LSB-

-RSB-

C.

A.

Phillips

C.

Stein

E.

Torng

and

J.

Wein

Optimal

time-critical

scheduling

via

resource

augmentation

In

ACM

Symposium

on

Theory

of

Computing

pages

Appendix

Proof

of

Theorem

Let

M

denote

the

set

of

machines

of

class

less

than

l.

First

observe

that

the

processing

time

incurred

by

A

on

J

I

is

at

most

twice

of

M

T

-LRB-

the

factor

twice

comes

because

there

may

be

some

jobs

which

are

dispatched

during

I

but

finish

later

there

can

be

at

most

one

such

job

for

a

given

class

and

a

given

machine

-RRB-

So

we

will

be

done

if

we

can

show

that

F

O

J

I

is

-LRB-

M

T

-RRB-

Let

V

be

the

volume

of

jobs

in

J

I

which

are

done

by

O

on

machines

of

class

l

or

more

If

V

M

T

l

then

we

are

done

because

then

the

processing

time

incurred

by

O

on

J

I

is

at

least

V

l

So

we

will

assume

in

the

rest

of

the

proof

that

V

M

T

l

Let

i

be

a

machine

of

class

less

than

l

We

shall

say

that

i

is

good

is

i

processes

jobs

from

J

I

for

at

least

T

units

of

time

during

I

in

the

optimal

solution

O.

Otherwise

we

say

that

i

is

bad

Let

G

denote

the

set

of

good

machines

If

G

M

then

we

are

done

again

because

P

O

J

I

is

at

least

G

Let

B

denote

the

set

of

bad

machines

So

we

can

assume

that

the

number

of

good

machines

is

at

most

fraction

of

the

number

of

machines

of

class

less

than

l

Now

consider

a

time

t

in

the

interval

-LRB-

t

b

T

t

e

-RRB-

Claim

At

time

t

at

least

k

M

volume

of

jobs

from

J

I

is

waiting

in

O.

Proof

Let

V

denote

the

volume

of

jobs

from

J

I

which

is

done

by

A

during

-LRB-

t

b

t

-RRB-

Let

V

denote

the

volume

of

jobs

from

J

I

which

is

done

by

O

on

machines

of

class

less

than

l

during

-LRB-

t

b

t

-RRB-

Recall

that

for

a

machine

i

s

i

denotes

the

slowness

of

i

Since

a

machine

i

of

class

l

l

does

not

perform

jobs

from

J

I

for

at

most

k

l

amount

of

time

during

I

we

see

that

V

P

iM

t-t

b

k

ci

s

i

where

c

i

denotes

the

class

of

i.

Let

us

look

at

V

now

In

O

all

bad

machines

do

not

process

jobs

from

J

I

for

at

least

units

of

time

during

I

So

they

do

not

process

jobs

from

J

I

for

at

least

T

units

of

time

during

-LRB-

t

b

t

b

T

-RRB-

So

V

P

iM

-LRB-

t-t

b

-RRB-

s

i

P

iB

T

i

This

shows

that

V

V

P

iB

T

i

P

iM

k

ci

s

i

For

a

bad

machine

i

T

k

c

i

since

c

i

l

-LRB-

assuming

is

large

enough

-RRB-

So

we

can

see

that

this

difference

is

at

least

P

iB

T

i

P

i

B

k

Since

T

l

k

we

see

that

this

difference

is

at

least

T

-LRB-

B

G

-RRB-

which

is

at

least

T

M

because

we

have

assumed

that

B

is

larger

than

G

by

a

sufficiently

high

constant

factor

Recall

that

V

is

the

volume

of

jobs

in

J

I

which

is

done

by

O

on

machines

of

class

l

or

more

Clearly

the

volume

of

jobs

from

J

I

which

is

waiting

at

time

t

in

O

is

at

least

V

V

V

But

V

is

at

most

T

M

l

Hence

the

volume

waiting

at

time

t

is

at

least

T

M

l

This

proves

the

lemma

Since

each

job

in

J

I

is

of

size

at

most

k

we

see

that

at

least

-LRB-

M

-RRB-

jobs

are

waiting

at

time

t.

Summing

over

all

values

of

t

in

the

range

-LRB-

t

b

T

t

e

-RRB-

implies

the

theorem

Proof

of

Lemma

Consider

an

i

i

u

i

i

u

Then

l

i

-LRB-

t

-RRB-

l

i

u

-LRB-

t

-RRB-

otherwise

we

should

have

another

suffix

maximal

index

between

i

u

and

i

u

So

P

i

u

i

i

u

c

i

-LRB-

t

-RRB-

m

l

i

-LRB-

t

-RRB-

m

l

iu

-LRB-

t

-RRB-

P

i

u

i

i

u

c

i

-LRB-

t

-RRB-

m

l

iu

-LRB-

t

-RRB-

c

iu

-LRB-

t

-RRB-

So

we

get

P

i

c

i

-LRB-

t

-RRB-

m

l

i

-LRB-

t

-RRB-

P

i

u

m

l

iu

-LRB-

t

-RRB-

c

iu

-LRB-

t

-RRB-

Now

we

consider

the

sum

P

i

P

ll

i

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

t

i

-RRB-

Fix

an

i

i

u

i

i

u

Using

Claim

we

see

that

P

O

l

-LRB-

t

i

t

i

-RRB-

m

l

l

i

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

So

we

get

X

ll

i

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

t

i

-RRB-

X

ll

iu

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

t

i

-RRB-

l

iu

-LRB-

t

-RRB-

X

l

l

i

-LRB-

t

-RRB-

m

l

l

i

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

Now

the

second

term

on

the

right

hand

side

above

is

at

most

m

l

iu

-LRB-

t

-RRB-

c

i

-LRB-

t

-RRB-

So

we

get

i

u

X

i

i

u

X

ll

i

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

t

i

-RRB-

X

ll

iu

-LRB-

t

-RRB-

P

O

l

-LRB-

t

i

u

t

i

u

-RRB-

c

iu

-LRB-

t

-RRB-

m

l

iu

-LRB-

t

-RRB-

because

c

i

-LRB-

t

-RRB-

scales

down

geometrically

as

i

increases

Finally

note

that

P

i

u

c

iu

-LRB-

t

-RRB-

m

l

iu

-LRB-

t

-RRB-

is

at

most

twice

of

P

i

u

c

iu

-LRB-

t

-RRB-

m

-LRB-

l

-LRB-

t

-RRB-

l

iu

-LRB-

t

-RRB-

-RRB-

because

c

i

-LRB-

t

-RRB-

scale

down

geometrically

This

proves

the

lemma

-LRB-

using

-LRB-

-RRB-

-RRB-

competitive ratio
preemption
approximation algorithms
processing time
average flow time
related machines
scheduling

multiprocessor environment
flow-time
non-migratory algorithm
poly-logarithmic factor