Online scheduling to maximize throughput
Nguyen Kim Thang
(joint work with Christoph Durr
and Lukasz Jez)
Online Algorithms
No (partial) information about future (requests are revealed litle by litle).
Guarantee the performance according to certain objective
Online Algorithms
No (partial) information about future (requests are revealed litle by litle).
Guarantee the performance according to certain objective
Competitive ratio
An algorithm ALG is -competitive if for any instance α I
(maximization problem) OP T (I)
ALG(I) ≤ α
Competitive ratio
An algorithm ALG is -competitive if for any instance α I
(maximization problem)
Measure the performance of an algorithm (worst-case analysis) What is a competitive ratio?
The price of an object (the problem):
Algorithm negociation Adversary (lower bound) (upper bound)
An algorithm is optimal if the bound is tight.
OP T (I)
ALG(I) ≤ α
Model
Enterprise: perishable product (electricity, ice-cream, ...).
Clients: arrive online, different demands.
Goal: maximize the profit.
Profit maximization
$
$
$
Model
Enterprise: perishable product (electricity, ice-cream, ...).
Clients: arrive online, different demands.
Goal: maximize the profit.
Profit maximization
$
$
$
Objective: maximize the total value of jobs completed on time.
Online Scheduling
Jobs: arrive at , processing time , deadline , value (weight) .pi di ri wi
Contribution
unit weight
unbounded processing times equal processing
times
bounded processing times (by )k
general
α = 1 α = Θ(log k)
α = Θ(k/ log k) 3√
3
2 ≤ α ≤ 5
∞
∞
≤ 4.24
Contribution
unit weight
unbounded processing times equal processing
times
bounded processing times (by )k
general
α = 1 α = Θ(log k)
α = Θ(k/ log k) 3√
3
2 ≤ α ≤ 5
∞
∞
(Simple) Optimal algorithms (up to a constant) General analysis framework
≤ 4.24
Lower bound (arbitrary weights)
0
0 R
R k
k et/R−1
t 1
B At
Theorem: any deterministic algorithm has competitive ratio Ω(k/ log k)
Proof: Fix R = k/ ln k Define: A
t =
!1 ∀0 ≤ t < R
e Rt −1 ∀ R ≤ t ≤ k.
B = R
Lower bound (arbitrary weights)
0
0 R
R k
k et/R−1
t 1
B At
Theorem: any deterministic algorithm has competitive ratio Ω(k/ log k)
Proof: Fix R = k/ ln k Define: A
t =
!1 ∀0 ≤ t < R
e Rt −1 ∀ R ≤ t ≤ k.
B = R Instance:
At time 0: release job and B A0 At time : release job t At
if ALG schedules at time B (t − 1) otherwise, stop.
At time : stopk
Lower bound (arbitrary weights)
0
0 R
R k
k et/R−1
t 1
B At
If ALG schedules then ADV schedulesAt∗(0 ≤ t∗ < R) B ratio = R/1
Lower bound (arbitrary weights)
0
0 R
R k
k et/R−1
t 1
B At
If ALG schedules then ADV schedulesAt∗(0 ≤ t∗ < R) B If ALG schedules then ADV schedules
all jobs At(0 ≤ t ≤ t∗)
At∗(R ≤ t∗ ≤ k)
!R" − 1 + ! t∗ R
et/R−1dt ≥ R · et∗/R−1 ratio = R/1
Lower bound (arbitrary weights)
0
0 R
R k
k et/R−1
t 1
B At
If ALG schedules then ADV schedulesAt∗(0 ≤ t∗ < R) B If ALG schedules then ADV schedules
all jobs At(0 ≤ t ≤ t∗)
At∗(R ≤ t∗ ≤ k)
!R" − 1 + ! t∗ R
et/R−1dt ≥ R · et∗/R−1
If ALG completes then ADV schedules all jobs
B
At(0 ≤ t∗ ≤ k) Rek/R−1 = Rk/e ≥ R2
ratio = R/1
Settling the competitivity
i
wj
j α · wi
Methods: charging scheme, potential function, etc
Settling the competitivity
i
wj
j α · wi
Methods: charging scheme, potential function, etc
ALG
ADV
Settling the competitivity
i
wj
j α · wi
Methods: charging scheme, potential function, etc
ALG
ADV
Def: An unit is scheduled at time if job is scheduled at that time and the remaining processing time of is(i, a)
t i
i a
Properties of algorithms
Associate to a capacity function (i, a) π(i, a) A job is pending at time if t t + qj ≤ dj
A critical time of a job is the latest moment that the job is still pending.
Properties of algorithms
Associate to a capacity function (i, a) π(i, a) Desirable properties:
validity: if job is pending for ALG at then ALG j t (i, a) t
schedules a unit at such that π(i, a) ≥ wj/pj A job is pending at time if t t + qj ≤ dj
A critical time of a job is the latest moment that the job is still pending.
Properties of algorithms
Associate to a capacity function (i, a) π(i, a) Desirable properties:
validity: if job is pending for ALG at then ALG j t (i, a) t
schedules a unit at such that π(i, a) ≥ wj/pj -monotonicity: if the ALG schedules with
and at then
(i, a) a > 1 (i!, a!) (t + 1) ρ · π(i!, a!) ≥ π(i, a)
ρ
A job is pending at time if t t + qj ≤ dj
A critical time of a job is the latest moment that the job is still pending.
General charging scheme
Each unit of job completed by ADV has weight j wj/pj
General charging scheme
Each unit of job completed by ADV has weight j wj/pj Type 1 charge
(j, b) (j, 1)
ALG ADV
General charging scheme
Each unit of job completed by ADV has weight j wj/pj Type 1 charge
(j, b) (j, 1)
ALG ADV
Type 2 charge
(j, b) ALG
ADV
(i, a) (i0, 1)
next job completion
π(i, a) ≥ wj/pj
General charging scheme
Each unit of job completed by ADV has weight j wj/pj Type 1 charge
(j, b) (j, 1)
ALG ADV
Type 2 charge
(j, b) ALG
ADV
(i, a) (i0, 1)
next job completion
π(i, a) ≥ wj/pj
Type 3 charge
(j, b) ALG
ADV
(i, a) (i0, 1)
critical time of j
π(i, a) < wj/pj
Main lemmas
Lemma: a job receives at most charge of type 2i0 π(i0, 1) 1 − ρ
Main lemmas
Lemma: a job receives at most charge of type 2i0 π(i0, 1) 1 − ρ
Proof:
(j, b) ALG
ADV
(i, a) (i0, 1)
next job completion
π(i, a) ≥ wj/pj
(i!, a!) (j!, b!) (i!0, 1)
previous job completion
Main lemmas
Lemma: a job receives at most charge of type 2i0 π(i0, 1) 1 − ρ
Proof:
(j, b) ALG
ADV
(i, a) (i0, 1)
next job completion
π(i, a) ≥ wj/pj
(i!, a!) (j!, b!) (i!0, 1)
previous job completion
!
j
wj
pj ≤ !
i
π(i, a) ≤ !
k
ρkπ(i0, 1) ≤ π(i0, 1) 1 − ρ Total
charge:
type 2 monotonicity
Main lemmas
Lemma: set of job units that are type 3 charged to Then
J i0
|J| ≤ k − 1 and wj/pj ≤ π(i0, 1) ∀j ∈ J
Main lemmas
Lemma: set of job units that are type 3 charged to Then
J i0
|J| ≤ k − 1 and wj/pj ≤ π(i0, 1) ∀j ∈ J Proof:
(j, b) ALG
ADV
(i, a) (i0, 1)
π(i, a) < wj/pj critical time of j t
s
t0 (!, c)
Main lemmas
Lemma: set of job units that are type 3 charged to Then
J i0
|J| ≤ k − 1 and wj/pj ≤ π(i0, 1) ∀j ∈ J Proof:
(j, b) ALG
ADV
(i, a) (i0, 1)
π(i, a) < wj/pj critical time of j t
s
t0 (!, c)
: otherwise, t0 ≤ t wj/pj ≤ π(", c) ≤ π(i, a)
Main lemmas
Lemma: set of job units that are type 3 charged to Then
J i0
|J| ≤ k − 1 and wj/pj ≤ π(i0, 1) ∀j ∈ J Proof:
(j, b) ALG
ADV
(i, a) (i0, 1)
π(i, a) < wj/pj critical time of j t
s
t0 (!, c)
: otherwise, t0 ≤ t wj/pj ≤ π(", c) ≤ π(i, a) is critical time s
Moreover
s + qj(s) = dj t < dj
Main lemmas
Lemma: set of job units that are type 3 charged to Then
J i0
|J| ≤ k − 1 and wj/pj ≤ π(i0, 1) ∀j ∈ J Proof:
(j, b) ALG
ADV
(i, a) (i0, 1)
π(i, a) < wj/pj critical time of j t
s
t0 (!, c)
: otherwise, t0 ≤ t wj/pj ≤ π(", c) ≤ π(i, a) is critical time s
Moreover
s + qj(s) = dj t < dj
Hence,
Then:
t − s < qj(s) ≤ pj ≤ k
|J| ≤ k − 1
Smith ratio algorithm
Algorithm: at any time, schedule the pending job that maximizes wj/pj
Smith ratio algorithm
Algorithm: at any time, schedule the pending job that maximizes wj/pj Theorem: the Smith ratio algorithm is -competitive2k
Smith ratio algorithm
Algorithm: at any time, schedule the pending job that maximizes wj/pj Theorem: the Smith ratio algorithm is -competitive2k
Proof: Define: π(i, a) = wi/a
The algorithm satisfies validity: π(i, a) ≥ wj/pj The algorithm is -monotone(k − 1)/k
Smith ratio algorithm
Algorithm: at any time, schedule the pending job that maximizes wj/pj Theorem: the Smith ratio algorithm is -competitive2k
Let be an unit scheduled before(j, b) (i, a) If (i, a) = (j, b − 1) then k − 1
k π(i, a) = k − 1 k
wj
b − 1 ≥ wj
b = π(j, b) Otherwise,
k − 1
k π(i, a) = k − 1 k
wi
pi ≥ k − 1 k
wj
pj ≥ wj
b = π(j, b) Proof: Define: π(i, a) = wi/a
The algorithm satisfies validity: π(i, a) ≥ wj/pj The algorithm is -monotone(k − 1)/k
Smith ratio algorithm
Algorithm: at any time, schedule the pending job that maximizes wj/pj Theorem: the Smith ratio algorithm is -competitive2k
Let be an unit scheduled before(j, b) (i, a) If (i, a) = (j, b − 1) then k − 1
k π(i, a) = k − 1 k
wj
b − 1 ≥ wj
b = π(j, b) Otherwise,
k − 1
k π(i, a) = k − 1 k
wi
pi ≥ k − 1 k
wj
pj ≥ wj
b = π(j, b) Proof: Define: π(i, a) = wi/a
The algorithm satisfies validity: π(i, a) ≥ wj/pj The algorithm is -monotone(k − 1)/k
Total charge of job :i0 wi0 + wi0
1 − (k − 1)/k + (k − 1)wi0
Optimal algorithm
Algorithm: at any time, schedule the pending job that maximizes π(j, qj) := wjαqj−1 := wj
!
1 − c2 ln k k
"qj−1
Theorem: the Smith ratio algorithm is -competitive(4k/ ln k)
Optimal algorithm
Algorithm: at any time, schedule the pending job that maximizes π(j, qj) := wjαqj−1 := wj
!
1 − c2 ln k k
"qj−1
Theorem: the Smith ratio algorithm is -competitive(4k/ ln k) Proof (sketch):
The algorithm satisfies validity: π(i, a) ≥ wj/pj The algorithm is -monotoneα
Total charge of job :i0 wi0 + O
! k ln k
"
wi0 + #
j∈J
wi0 f (pj)
where f(x) = xαx−1
Conclusion
Optimal algorithms and a general framework for the model
Constant competitive algorithms for a variant where jobs have equal lengths competitive randomized algos.O(log k)
Directions: Close the gap
Equal length jobs (2.59 < ratio < 4.25) Randomized algorithms Ω(!
log k/ log log k), O(log k)