Download presentation
Presentation is loading. Please wait.
Published byReynold McCormick Modified over 9 years ago
1
Department of Computer Science Stanley P. Y. Fung Online Preemptive Scheduling with Immediate Decision or Notification and Penalties
2
Motivation Preemption is not really “free” E.g. context switch in CPU scheduling Introduce preemption penalty (PP): each preemption introduces a penalty proportional to value of job Related but different scenario: we want commitment to process a job If a job cannot be processed, better to let the client know early Introduce non-completion penalty: if an accepted job is later not finished, gives a penalty
3
Immediate Decision/Notification How to model “commitment”: Immediate Notification (IMM NOTIF): Upon a job’s arrival, have to decide immediately whether to accept the job, or reject it right away If rejected, no value (customer goes away) If an accepted job is eventually not completed, incurs a penalty (cannot charge customer since work not done; in addition, customer is unhappy when he finds this out) Immediate Decision (IMM DEC): A stronger notion where in addition, an accepted job needs to be immediately allocated a time window for execution (“your delivery will take place on Friday morning”)
4
Problem Formulation Input: a set of jobs Parameters: release time r(j), deadline d(j), length p(j), weight w(j) Value of a job v(j) = p(j) x w(j) Unit length (UL) case: p(j) = 1 for all j Unit weight (UW) case: w(j) = 1 for all j Objective: Find a schedule with maximum total value of completed jobs, minus any penalties Penalty model: penalty = × v(j) Preemptive We mainly consider the restart model But also some on resume model (Doesn’t matter in IMM DEC)
5
Online Algorithms Jobs arrive online No information about future Decisions irrevocable Measure of performance: competitive ratio An online algorithm A is c-competitive if for any input instance I, OPT(I)/A(I) ≤ c Where OPT = offline optimal algorithm, A(I) = value of A on instance I
6
Previous and Our Results (PP) Upper boundLower bound UW (resume) No penalty4 [BKM+92]4 [Woeg 94, BKM+92] Penalty 4(1+ ) (resume and restart) 4(1+ ) UL (restart) No penalty 4.56 [ZFC+06], 4 for tight jobs 4 [Woeg 94] penalty [ZXDZ05] 4(1+ )
7
Previous and Our Results (PP) Upper boundLower bound Resume, k = max w / min w No penalty [KS95] [BKM+92] Penalty Restart, = max p / min p No penalty O( /log ) [Ting08] ( /log ) [ZFC+06, Ting08] Penalty (1+ ) + o( ) [ZXP09]
8
Previous and Our Results (IMM) Previous results: IMM DEC + UW: an upper bound from [TL09] No other prior result for preemptive case Non-preemptive case considered in various papers (usually UL, and parallel machines) Our results: IMM DEC (or IMM NOTIF + restart) UW: UL: Lower bound 4(1+ ) carries over to here Lower bound with laxity
9
Tight jobs: PP = IMM NOTIF = IMM DEC No algorithm gives competitive ratio better than 4(1+ ) Idea: (similar to [BKM+92, Woeg94]) If switch to short job, stop If not preempt from v i to v i+1, UW Lower Bound (PP/IMM) v0v0 v1v1 v2v2
10
Lemma: if < 4(1+ ), {v i } cannot be strictly increasing forever Let v n be the last term. Then If ONL is about to finish v n, release another job of value v n just before it finishes Lower Bound (cont’d) v n-1 vnvn vnvn
11
PP + UW: Algorithm 4(1+ )-competitive algorithm: Let = 2(1+ ) 2, = 2( – 1) Job arrival: add to pool When idle, start the pending job with earliest expiry time While j is running, if another job k reaches its expiry time: If v(k) > v(j) and j has preempted other jobs before, or If v(k) > v(j) and j has not preempted others before Then preempt j and start k; j never considered again Else continue with j (and k will expire)
12
Ideas of Proof Basic subschedules: sequence of preemption followed by one job completion v k-1 ≤ v k / , v k-2 ≤ v k-1 / , …, v 1 ≤ v 2 / Value obtained = v k – (v 1 +…+v k-1 ) Times in OPT when ONL is busy OK (1 to 1) Times in OPT when ONL is idle For each (part of) such job j executed by OPT, map it to some basic subschedule in ONL v1v1 vkvk
13
Ideas of Proof When OPT starts (part of) a job j while ONL idle: If ONL is idle at x(j) (expiry time of j), only possible if j started/completed before its expiry j is the first job in a basic subschedule map to it Otherwise, x(j) falls within some basic subschedule (v 1 …v k ) map to it can show total of v(j) < v k (or v 1 if k=1) Each basic subschedule is mapped by: OPT ONL v 1 +…+v k v1v1 vkvk v1v1 vkvk
14
IMM DEC + UW: Algorithm At any time, the algorithm maintains the provisional schedule of accepted jobs Execute according to provisional schedule When a new job j arrives: Identify a set of jobs { j i } in the provisional schedule so that their preemption create a long enough timeslot to fit the new job, and that v(j i ) < v(j) / If no such set exists, reject j Else preempt those j i, schedule j in the new empty interval (as early as possible)
15
Properties of Provisional Schedule Theorem: -competitive Simple but useful properties of provisional schedule: “No gap”, i.e. no idle period between planned jobs in it “monotone”, i.e. once a time t becomes busy, won’t become idle later on If a preemption happens, it preempts a suffix of the provisional schedule Only linear number of potential job sets to consider (prov. sch.)
16
Ideas of Proof Classify jobs in OPT into four sets: C: Completed in both OPT and ONL R: Rejected by ONL (upon arrival) D: Discarded by ONL (preempted before getting started) A: Aborted by ONL (preempted while execution) Jobs in R: Cannot start in idle time in ONL If start in a busy period with completed jobs j 1,…,j m, then v(j) < v(j i ) OPT A j1j1 j2j2 < (v(j 1 )+v(j 2 ))
17
Suppose an R-job j starts at t when ONL is idle S t [t] is empty. By monotone property, S r(j) [t] is also empty By no-gap property, S r(j) [u] is all empty for u > t Hence j could not be rejected Suppose j starts at t when ONL is busy Rejected due to a set X of jobs in S r(j) [t] s.t. v(j) < v(X) Jobs in X may be preempted but replaced by other (higher- value) jobs in the same busy period (no-gap) Eventually goes to one of j i ’s Bounding R jobs t j j1j1 j2j2 < (v(j 1 )+v(j 2 ))
18
Ideas of Proof Consider one busy period Let V(C) = V Jobs in D/A: Can prove v(D) + v(A) V/( – 1) Jobs in R: v(R) L + V where L = length of b.p. v(C) + v(A) (1+1/( – 1))V OPT v(C) + v(A) + v(D) + v(R) ONL v(C) – (v(D)+v(A)) Competitive ratio = OPT/ONL, choose a optimised
19
IMM DEC + UL Same algorithm Provisional schedule different properties: Each preemption preempts either one job, or two including the currently executing one Efficient identification of candidate preemption sets Theorem: -competitive Proof: Similar ideas for C, A, D Different bound for R
20
Proof for UL Case Each job in R is “blocked” by at most 2 jobs in provisional schedule (i.e. jobs in C/A/D) Total value (value of R-job)/ Distribute the values to them Each job in C/A/D “blocks” at most two jobs in R (i.e. in OPT) V(R) 2 ( v(C)+v(A)+v(D) ) Prov.sch. OPT v1v1 < (v 1 +v 2 ) v2v2 v1v1 v2v2 v1v1 v1v1 v1v1
21
Discrete time steps, p(j) = 1 = time step size No issue of preemption Without immediate decision/notification: unit job scheduling problem Motivation: buffer management in QoS switches Previous results: Deterministic UB 1.828, LB 1.618 Randomized UB 1.582, LB 1.25 Various restricted cases, adversary models etc Unit Jobs
22
Algorithm: Keep a provisional schedule S When each job j arrives: Find the earliest slot u before d(j) in S such that w(S t [u]) < w(j)/ for some . Evict this job (call it j’) and j takes its place. If no such slot, reject j Repeat above for the evicted job j’ (but with different condition w(S t [u]) < w(j’)), the subsequently evicted j’’, … -competitive Lower bound? Unit Jobs + IMM NOTIF
23
Algorithm: Keep a provisional schedule S When a new job j arrives, find any slot u such that w(S t [u]) < w(j)/ for some Replace S t [u] with j 4(1+ )-competitive ( ) lower bounds Unit Jobs + IMM DEC
24
Future Work PP + UL: gap still exists E.g. between (4, 4.56) for restart without penalty Better bounds for IMM DEC + UL (=UW?) Upper/lower bounds to separate the competitive ratio of IMM DEC / IMM NOTIF / no-commitment Algorithms here works for IMM NOTIF, but trivially Unit jobs lower bounds IMM DEC but limited re-scheduling / wider interval / …
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.