Online Packet Scheduling with Bounded Delay and Lookahead

We study the online bounded-delay packet scheduling problem (BDPS), where packets of unit size arrive at a router over time and need to be transmitted over a network link. Each packet has two attributes: a non-negative weight and a deadline for its transmission. The objective is to maximize the total weight of the transmitted packets. This problem has been well studied in the literature, yet its optimal competitive ratio remains unknown: the best upper bound is $1.828$, still quite far from the best lower bound of $\phi \approx 1.618$. In the variant of BDPS with $s$-bounded instances, each packet can be scheduled in at most $s$ consecutive slots, starting at its release time. The lower bound of $\phi$ applies even to the special case of $2$-bounded instances, and a $\phi$-competitive algorithm for $3$-bounded instances was given in Chin et al. Improving that result, and addressing a question posed by Goldwasser, we present a $\phi$-competitive algorithm for $4$-bounded instances. We also study a variant of BDPS where an online algorithm has the additional power of $1$-lookahead, knowing at time $t$ which packets will arrive at time $t+1$. For BDPS with $1$-lookahead restricted to $2$-bounded instances, we present an online algorithm with competitive ratio $(\sqrt{13} - 1)/2 \approx 1.303$ and we prove a nearly tight lower bound of $(1 + \sqrt{17})/4 \approx 1.281$.


Introduction
Background. Optimizing the flow of packets across an IP network gives rise to a plethora of challenging algorithmic problems. In fact, even scheduling packet transmissions from a router across a specific network link can involve non-trivial tradeoffs. Several models for such tradeoffs have been formulated, depending on the architecture of the router, on characteristics of the packets, and on the objective function.
In the model that we study in this paper, each packet has two attributes: a non-negative weight and a deadline for its transmission. The time is assumed to be discrete (slotted), and only one packet can be sent in each slot. The objective is to maximize the total weight of the transmitted packets. We focus on the online setting, where at each time step the router needs to choose a pending packet for transmission, without the knowledge about future packet arrivals. This problem, which we call online bounded-delay packet scheduling problem (PacketScheduling), was introduced by Kesselman et al. [11] as a theoretical abstraction that captures the constraints and objectives of packet scheduling in networks that need to provide quality of service (QoS) guarantees. The combination of deadlines and weights is used to model packet priorities.
In the literature, the PacketScheduling problem is sometimes referred to as bounded-delay buffer management in QoS switches. It can also be formulated as the job-scheduling problem 1|p j = 1, r j | w j U j , where packets are represented by unit-length jobs with deadlines, with the objective to maximize the weighted throughput.
A router transmitting packets across a link needs to make scheduling decisions on the fly, based only on the currently available information. This motivates the study of online competitive algorithms for PacketScheduling. A simple online greedy algorithm that always schedules the heaviest pending packet is known to be 2-competitive [10,11]. In a sequence of papers [5,7,12,6], this ratio was gradually improved, and the best currently known ratio is 1.828 [6]. The best lower bound, widely believed to be the optimal ratio, is φ = (1 + √ 5)/2 ≈ 1.618 [10,2,4]. Closing the gap between these two bounds is one of the most intriguing open problems in online scheduling. s-Bounded instances. In an attempt to bridge this gap, restricted models have been studied. In the s-bounded variant of PacketScheduling, each packet must be scheduled within k consecutive slots, starting at its release time, for some k ≤ s possibly depending on the packet. The lower bound of φ from [10,2,4] holds even in the 2-bounded case. A matching φ-competitive algorithm was given Kesselman et al. [11] for 2-bounded instances and by Chin et al. [3] for 3-bounded instances. Both results are based on the algorithm EDF α , with α = φ, which always schedules the earliest-deadline packet whose weight is at least the weight of the heaviest pending packet divided by α (ties are broken in favor of heavier packets). EDF φ is not φ-competitive for 4-bounded instances; however, a different choice of α yields a 1.732-competitive algorithm for the 4-bounded case [3]. Our contribution. We present a φ-competitive online algorithm for PacketScheduling restricted to 4bounded instances, matching the lower bound of φ (see Section 3). This improves the results from [3] and answers the question posed by Goldwasser in his SIGACT News survey [8]. Algorithms with 1-lookahead. In Sections 4 and 5, we investigate a variant of PacketScheduling where an online algorithm is able to learn at time t which packets will arrive by time t + 1. This property is known as 1-lookahead. From a practical point of view, 1-lookahead corresponds to the situation in which a router can see the packets that are just arriving to the buffer and that will be available for transmission in the next time slot.
The notion of lookahead is quite natural and it has appeared in the online algorithm literature for paging [1], scheduling [13] and bin packing [9] since the 1990s. Ours is the first paper, to our knowledge, that considers lookahead in the context of packet scheduling. Our contributions. We provide two results about PacketScheduling with 1-lookahead, restricted to 2bounded instances. First, in Section 4, we present an online algorithm for this problem with competitive ratio of 1 2 ( √ 13 − 1) ≈ 1.303. Then, in Section 5, we give a lower bound of 1 4 (1 + √ 17) ≈ 1.281 on the competitive ratio of algorithms with 1-lookahead which holds already for the 2-bounded case.

Definitions and Notation
Problem statement. Formally, we define the PacketScheduling problem as follows. The instance is a set of packets, with each packet p specified by a triple (r p , d p , w p ), where r p and d p ≥ r p are integers representing the release time and deadline of p, and w p ≥ 0 is a real number representing the weight of p. Time is discrete, divided into unit time slots, also called steps. A schedule assigns time slots to some subset of packets such that (i) any packet p in this subset is assigned a slot in the interval [r p , d p ], and (ii) each slot is assigned to at most one packet. The objective is to compute a schedule that maximizes the total weight of the scheduled packets, also called the profit.
In the s-bounded variant of PacketScheduling, we assume that each packet p in the instance satisfies d p ≤ r p + s − 1. In other words, this packet must be scheduled within k p consecutive slots, starting at its release time, for some k p ≤ s. Online algorithms. In the online variant of PacketScheduling, which is the focus of our work, at any time t only the packets released at times up to t are revealed. Thus an online algorithm needs to decide which packet to schedule at time t (if any) without any knowledge of packets released after time t.
As is common in the area of online optimization, we measure the performance of an online algorithm A by its competitive ratio. An algorithm is R-competitive if, for all instances, the total weight of the optimal schedule (computed offline) is at most R times the weight of the schedule computed by A.
We say that a packet is pending for an algorithm at time t, if r p ≤ t ≤ d p and p is not scheduled before time t. A (pending) packet p is expiring at time t if d p = t, that is, it must be scheduled now or never. A packet p is tight if r p = d p ; thus p is expiring already at its release time. Algorithms with 1-lookahead. In Sections 4 and 5, we investigate the PacketScheduling problem with 1-lookahead. With 1-lookahead, the problem definition changes so that at time t, an online algorithm can also see the packets that will be released at time t + 1, in addition to the pending packets. Naturally, only a pending packet can be scheduled at time t. Other terminology and assumptions. We will make several assumptions about our problem that do not affect the generality of our results. First, we can assume that all packets have different weights. Any instance can be transformed into an instance with distinct weights through infinitesimal perturbation of the weights, without affecting the competitive ratio. Second, we assume that at each step there is at least one pending packet. (If not, we can always release a tight packet of weight 0 at each step.) We define the earliest-deadline relation on packets, or canonical ordering, denoted ≺, where x ≺ y means that either d x < d y or d x = d y and w x > w y (so the ties are broken in favor of heavier packets). At any step t, the algorithm maintains the earliest-deadline relation on the set of its pending packets. Throughout the paper, "earliest-deadline packet" means the earliest packet in the canonical ordering.
Regarding the adversary (optimal) schedule, we can assume that it satisfies the following earliestdeadline property: if packets p, p are scheduled in steps t and t , respectively, where r p ≤ t < t ≤ d p (that is, p and p can be swapped in the schedule without violating their release times and deadlines), then p ≺ p . This can be rephrased in the following useful way: at any step, the optimum schedule transmits the earliest-deadline packet among all the pending packets that it transmits in the future.

An Algorithm for 4-bounded Instances
In this section, we present a φ-competitive algorithm for 4-bounded instances. Ratio φ is of course optimal [10, 2, 4, see also Section 1]. Up until now, the best competitive ratio for 4-bounded instances was √ 3 ≈ 1.732, achieved by algorithm EDF √ 3 in [3]. Our algorithm can be seen as a modification of EDF φ , which under certain conditions schedules a packet lighter than w h /φ where h is the heaviest pending packet.
We remark that our algorithm uses memory; in particular, it marks one pending packet under certain conditions. It is an interesting question whether there is a memoryless φ-competitive algorithm for 4-bounded instances. Algorithm ToggleH. The algorithm maintains one mark that may be assigned to one of the pending packets. For a given step t, we choose the following packets from among all pending packets: h = the heaviest packet, s = the second-heaviest packet, f = the earliest-deadline packet with w f ≥ w h /φ, and e = the earliest-deadline packet with w e ≥ w h /φ 2 .
We then proceed as follows: Note that when f = h, then the algorithm will always schedule f . This is because in this case f is a candidate for s, so the condition w s ≥ w h /φ holds. The algorithm never specifically chooses s for scheduling -it is only used to determine if there is one more relatively heavy pending packet other than h. (But s may get scheduled if it so happens that s = f or s = e.) Note also that, if e = f , then e is scheduled only in a very specific scenario, when all of the following hold: e is expiring, h is marked, and w s < w h /φ.
Intuition. Let us give a high-level view of the analysis using charging schemes and an example that motivates both our algorithm and its analysis. The example consists of four packets j, k, f, h released in step 1, with deadlines 1, 2, 3, 4 and weights 1 − ε, 1 − ε, 1, φ for a small ε > 0, respectively. The optimum schedules all packets. Algorithm EDF φ performs only f -steps; in our example it schedules f and h in steps 1 and 2, while j and k are lost. Thus the ratio is larger than φ. (In fact, after optimizing the threshold and the weight of h, this is the tight example for EDF √ 3 on 4-bounded instances.) ToggleH avoids this example by performing e-step in step 2 and scheduling k which has the role of e and s in the algorithm.
This example and its variants are also important for our analysis. We analyze the algorithms by charging schemes, where the weight of each packet scheduled by the adversary is charged to one or more of the slots of the algorithm's schedule. If the weight charged to each slot is at most R times the weight of the packet scheduled by the algorithm in that slot, the algorithm is R-competitive. In the case of EDF, we charge the weight of each packet j scheduled by the adversary at time t either fully to the step where EDF schedules j, if it is before t, or fully to step t otherwise. In our example, the weight charged to step 1 is 2 − ε while EDF schedules only weight 1, giving the ratio 2. Considering steps 1 and 2 together leads to a better ratio and after balancing the threshold it gives the tight analysis of EDF √ 3 . Our analysis of ToggleH is driven by the variants of the example above where step 2 is an f -step. This may happen in several cases. One case is if in step 2 another packet s with w s ≥ w h /φ arrives. If s is not scheduled in step 2, then s is pending in step 3, thus ToggleH schedules a relatively heavy packet in step 3, and we can charge a part of the weight of f , scheduled in step 3 by the adversary, to step 3. This motivates the definition of regular up and back charges below and corresponds to Case 5.1 in the analysis. Another case is when the weight of k is changed to 1/φ − ε. Then ToggleH performs an f -step because k is not a candidate for e, thus the role of e is taken by the non-expiring packet h. However, then the weight of the four packets charged to steps 1 and 2 in the way described above is at most φ times the weight of f and h; this corresponds to Case 5.2 of the analysis. Lemma 3.3 gives a subtle argument showing that in the 4-bounded case essentially these two variants of our example are the only difficult situations. Finally, in the original example, ToggleH schedules k in step 2 which is an e-step. Then again h is a pending heavy packet and we can charge some weight of f to step 3. Intuitively it is important that an e-step is performed only in a very specific situation where it is guaranteed that h can be scheduled in the next two steps (as it is marked) and that there is no other packet of comparable weight due to the condition w s < w h /φ. Still, there is a case to be handled: If more packets arrive in step 3, it is also possible that the adversary schedules h already in step 2 and we need to redistribute its weight. This case motivates the definition of the special up and back charges below. Proof. Fix some optimal adversary schedule. Without loss of generality, we can assume that this schedule satisfies the earliest-deadline property (see Section 2).
We have two types of packets scheduled by Algorithm ToggleH: f-packets, scheduled using the first case, and e-packets, scheduled using the second case. Similarly, we refer to the steps as f -steps and e-steps.
Let t be the current step. By h, f , e, and s we denote the packets from the definition of ToggleH. By j we denote the packet scheduled by the adversary. By h and h we denote the heaviest pending packets in steps t + 1 and t + 2, respectively. We use the same convention for packets f , e, s, and j.
Our analysis uses a new charging scheme which we now define. The adversary packet j scheduled in step t is charged according to the first case below that applies: 1. If t is an e-step and j = h, we charge w h /φ to step t and w h /φ 2 to step t − 1. We call these charges a special up charge and a special back charge, respectively. Note that the total charge is equal to w h = w j .
2. If j is pending for ToggleH in step t, charge w j to step t. We call this charge a full up charge.
3. Otherwise j is scheduled before step t. We charge w h /φ 2 to step t and w j − w h /φ 2 to the step where ToggleH scheduled j. We call these charges a regular up charge and a regular back charge, respectively. We point out that the regular back charge may be negative, but this causes no problems in the proof.
We start with an easy observation that we use several times throughout the proof.
Lemma 3.2. If an f -step t receives a regular back charge, then the up charge it receives is less than Proof. For a regular up charge the lemma is trivial (with a slack of a factor of φ). For a full up charge, the existence of a back charge implies that the adversary schedules f after j, thus the earliest-deadline property of the adversary schedule implies that j ≺ f , as both j and f are pending for the adversary at t.
Finally, an f -step does not receive a special up charge.
We examine packets scheduled by ToggleH from left to right, that is in order of time. For each time step t, if p is the packet scheduled at time t, we want to show that the charge to step t is at most φw p . However, as it turns out, this will not always be true. In one case we will also consider the next step t + 1 and the packet p scheduled in step t + 1, and show that the total charge to steps t and t + 1 is at most φ(w p + w p ).
Let t be the current step. We consider several cases.
Case 1: t is an e-step. By the definition of ToggleH, w e ≥ w h /φ 2 and d e = t; the latter implies that step t receives no regular back charge. We further note that the heaviest pending packet h in step t + 1 is either released at time t + 1 or it coincides with h, which is still pending and became unmarked by the algorithm in step t; in either case h is unmarked at the beginning of step t + 1, which implies that step t + 1 is an f -step. Thus, step t receives no special back charge, which, combined with the previous observation, implies it receives no back charge of any kind. Now we claim that the up charge is at most w h /φ. For a special or regular up charge this follows from its definition. For a full up charge, the job j is pending at time t for ToggleH and j = h (as for j = h the special charges are used). This implies that w j < w h /φ, as otherwise w s ≥ w h /φ and t would be an f -step. Thus the full charge is w j ≤ w h /φ as well.
Using w e ≥ w h /φ 2 , the charge is at most w h /φ ≤ φw e and we are done.
Case 2: t is an f -step and t does not receive a back charge. Then t can only receive an up-charge, and this up charge is at most w h ≤ φw f , where the inequality follows from the definition of f .

Case 3:
t is an f -step and t receives a special back charge. From the definition of special charges, the next step is an e-step, and therefore h is marked at its beginning. Since the only packet that may be marked after an f -step is h, we thus have h = h = j , and the special back charge is w h /φ 2 . Since f ≺ h, the adversary cannot schedule f after step t, so step t cannot receive a regular back charge. We claim that the up charge to step t is at most w f . Indeed, a regular up charge is at most w h /φ 2 ≤ w f , and a special up charge does not happen in an f -step. To show this bound for a full up charge, assume for contradiction that w j > w f . This implies that j = f and, since ToggleH scheduled f , we have d j > d f . In particular j is pending at time t + 1. Thus w s ≥ w j > w f ≥ w h /φ, contradicting the fact that t + 1 is an e-step. Therefore the full charge is w j ≤ w f , as claimed.
As w h ≤ φw f , the total charge to t is at most Case 4: t is an f -step, t receives a regular back charge and no special back charge, and f = h. The up charge is at most w h /φ by Lemma 3.2 and the back charge is at most w h , thus the total charge is at most w h + w h /φ = φw h , and we are done.
Case 5: t is an f -step, t receives a regular back charge and no special back charge, and f = h. Lett be the step when the adversary schedules f . We distinguish two sub-cases.
Case 5.1: In stept, a packet of weight at least w h /φ is pending for the algorithm. Then the regular back charge to t is at most and we are done.
Case 5.2: In stept, no packet of weight at least w h /φ is pending for the algorithm. In this case we consider the charges to steps t and t + 1 together. First, we claim the following. Proof. Since f = h, we have f ≺ h and thus, using also the definition oft and 4-boundedness,t ≤ d f < d h ≤ t + 3. The case condition implies that h is not pending att, thus ToggleH schedules h beforet. The only possibility is that ToggleH schedules h in step t + 1,t = d f = t + 2, and d h = t + 3; see Figure 1 for an illustration. This also implies that ToggleH marks h in step t.
We claim that w s < w h /φ. Indeed, otherwise either s is pending in step t + 2, contradicting the condition of Case 5.2, or d s = t + 1 < d h , thus s is a better candidate for f than h, which contradicts the fact that the algorithm scheduled f = h.
The claim also implies that h = h, as otherwise w s ≥ w h . Since h = h is scheduled in step t + 1, there is no marked packet in step t + 2 and t + 2 is an f -step; thus there is no special back charge to t + 1.
We note that step t + 1 is also an f -step, since ToggleH schedules h in step t + 1 and d h > t + 1. Since h = h is marked when step t + 1 starts and w s < w h /φ, the reason that step t + 1 is an f -step must be that d e > t + 1.
There is no special up charge to step t + 1 as it is an f -step. If the up charge to step t + 1 is a regular up charge, by definition it is at most w h /φ 2 = w h /φ 2 and the lemma holds.
The only remaining case is that of a full up charge to step t + 1 from a packet j scheduled by the adversary in step t + 1 and pending for ToggleH in step t + 1. Since j = h, it is a candidate for s , and thus w j < w h /φ ≤ w f . The earliest-deadline property of the adversary schedule implies that j ≺ f ; together with d f = t + 2 and w j < w f this implies d j = t + 1. Therefore w j < w h /φ 2 , as otherwise j is a candidate for e , but we have shown that d e > t + 1. Thus the regular up charge is at most w j < w h /φ 2 and the lemma holds also in the remaining case.
By Lemma 3.3, step t + 1 receives no special charge and an up charge of at most w h /φ 2 and ToggleH schedules h in step t + 1.
Step t + 1 thus also receives a regular back charge of at most w h . So the total charge to step t + 1 is at most w h /φ 2 + w h ≤ w f /φ + w h . Moreover, using Lemma 3.2, the total charge to step t is at most w h /φ + w f . Thus, the total charge to these two steps is at most , as f and h are the two packets scheduled by ToggleH.
In each case we have shown that a step or a pair of consecutive steps receive a total charge of at most φ times the weight of packets scheduled in these steps. Thus ToggleH is φ-competitive for the 4-bounded case.

An Algorithm for 2-Bounded Instances with Lookahead
In this section, we present an algorithm for 2-bounded PacketScheduling with 1-lookahead, as defined in Section 2.
Consider some online algorithm A. Recall that, for a time step t, packets pending for A are those that are released at or before time t and have neither expired nor been scheduled by A before time t. Lookahead packets at time t are the packets with release time t + 1.
For A, we define the plan in step t to be the optimal schedule in the time interval [t, ∞) that consists of pending and lookahead packets at time t and has the earliest-deadline property. For 2-bounded instances, this plan will only use slots t, t + 1 and t + 2. We will typically denote the packets in the plan scheduled in these slots by p 1 , p 2 , p 3 , respectively. The earliest-deadline property then implies that if both p 1 and p 2 have release time t and deadline t + 1 then p 1 is heavier than p 2 and similarly for p 2 and p 3 .
Algorithm CompareWithBias(α). Fix some parameter α > 1. At any time step t, the algorithm proceeds as follows: let p 1 , p 2 , p 3 be the plan at time t if r p2 = t and w p1 < min( w p2 , w p3 , 1 2α (w p2 + w p3 ) ) then schedule p 2 else schedule p 1 Note that if the algorithm schedules p 2 then p 1 must be expiring, for otherwise w p1 > w p2 (by canonical ordering). Also, the scheduled packet is at least as heavy as the heaviest expiring packet q, since clearly w p1 ≥ w q and the algorithm schedules p 2 only if w p1 < w p2 . Analysis. We set the parameter α and constants δ and R which we will use in the analysis so that they satisfy the following equalities: By solving these equations we get In this section we will prove the following theorem: We also use the following properties of these constants: where (4) follows from (1) and (2) and strict inequalities can be verified numerically. Let ALG be the schedule produced by CompareWithBias. Let us consider an optimal schedule OPT (a.k.a. schedule of the adversary) satisfying the canonical ordering, i.e., if a packet x is scheduled before a packet y in OPT then either y is released after x is scheduled or x ≺ y. Recall that we are assuming w.l.o.g. that the weights of packets are different.
The analysis of CompareWithBias is based on a charging scheme. First we define a few packets by their schedule times; see Figure 2. Figure 2: Packet definition.
Informal description of charging. We use three types of charges. The adversary's packet j in step t is charged using a full charge either to step t − 1 if ALG schedules j in step t − 1 or to step t if w f ≥ w j  Figure 3: Non-chaining charges. Note that for split charges f is scheduled in step t + 1 in OPT which follows from the fact that we do not charge j using a full up charge. (including the case f = j) and f is not in step t + 1 in OPT; the last condition assures that step t does not receive two full charges.
The second type are split charges that occur in step t if w f > w j , j is pending in step t in ALG and f is in step t + 1 in OPT, i.e., step t receives a full back charge from f . In this case, we distribute the charge from j to f and another relatively large packet f scheduled in step t + 1 or t + 2 in ALG; we shall prove that one of these steps satisfies 2α·w j < w f + w f . We charge to step t + 2 only when it is necessary, which allows us to prove that split-charge pairs are pairwise disjoint. Also, in this case we analyze the charges to both steps together, thus it is not necessary to fix a distribution of the weight to the two steps.
The remaining case is when w f < w j and j is not scheduled in t − 1 in ALG. We analyze these steps in maximal consecutive intervals, called chains and the corresponding charges are chain charges. Inside each chain we distribute the charge of each packet j scheduled at t in OPT to steps t − 1, t and t + 1, if these steps are also in the chain. The distribution of weights shall depend on a parameter δ. Packets at the beginning and at the end of the chain are charged in a way that minimizes the charge to steps outside of the chain. In particular, the step before a chain receives no charge from the chain. Notations and the charging scheme. A step t for which w f < w j and j is pending in step t in ALG is called a chaining step. A maximal sequence of successive chaining steps is called a chain. The chains with a single step are called singleton chains, the chains with at least two steps are called long chains.
The pair of steps that receive a split charge from the same packet is called a split-charge pair. The charging scheme does not specify the distribution of the weight to the two steps of the split-charge pair, as the charges to them are analyzed together.
Packet j scheduled in OPT at time t is charged according to the first rule below that applies. See Figure 3 for an illustration of the first four (non-chaining) charges and Figure 4 for an illustration of the chaining charges.
1. If j is scheduled in step t − 1 in ALG (that is, e = j), charge w j to step t − 1. We call this charge a full back charge.
2. If w f ≥ w j and f is not scheduled in step t + 1 in OPT (in particular, if j = f ), charge w j to step t. We call this charge a full up charge.
3. If w f > w j and at least one of the following holds: • 2α·w j < w f + w g , • g does not get a full back charge and 2α·(w p1 − w g ) < w f + w g where p 1 is the first packet in the plan at time t, then charge w j to the pair of steps t and t + 1. We call this charge a close split charge.
4. If w f > w j , then charge w j to the pair of steps t and t + 2. We call this charge a distant split charge.

5.
Otherwise step t is a chaining step, as w f < w j and ALG does not schedule f in step t − 1 by the previous cases. We distinguish the following subcases.
(a) If step t is (the only step of) a singleton chain, then charge min(w j , R·w f ) to step t and w j − R·w f to step t + 1 if w j > R·w f . We call these charges an up charge from a singleton chain and a forward charge from a singleton chain.
(b) If step t is the first step of a long chain, charge 2δ ·w j to step t, and (1 − 2δ)·w j to step t + 1. We call these charges chain beginning charges.
(c) If step t is the last step of a long chain, charge δ ·w j to step t − 1, (R − 1 + 2δ)·w f to step t, and (1 − δ)·w j − (R − 1 + 2δ)·w f to step t + 1. We call these charges chain end charges; the charge to step t + 1 is called a forward charge from a chain. (Note that we always have (1 − δ)·w j > (R − 1 + 2δ)·w f , since w j > w f and 1 − δ = R − 1 + 2δ which follows from (4).) (d) Otherwise, i.e., step t is inside a long chain, charge δ ·w j to step t − 1, δ ·w j to step t, and (1 − 2δ)·w j to step t + 1. We call these charges chain link charges.
To estimate the competitive ratio we need to show that each step or a pair of steps does not receive too much charge. We start with a useful observation about plans of Algorithm CompareWithBias(α), that will be used multiple times in our proofs.

Lemma 4.2. Consider a time t,
where the algorithm has two pending packets a, b and a lookahead packet c with the following properties: d a = t, (r b , d b ) = (t, t + 1), (r c , d c ) = (t + 1, t + 2), and w a < min(w b , w c ). If the algorithm schedules packet a in step t then the plan at time t is a, b, c, and 2α·w a ≥ w b + w c .
Proof. We claim that there is no pending or lookahead packet q / ∈ {b, c} heavier than a. Suppose for a contradiction that such a q exists. Then a schedule containing packets q, b, c in some order is feasible and has larger profit than a, b, c. This implies that the plan does not contain a and thus a cannot be scheduled, contradicting the assumption of the lemma.
The schedule a, b, c is feasible and the claim above implies that it is optimal, thus it is the plan. It remains to show that 2α·w a ≥ w b +w c , which follows easily by a contradiction: Otherwise 2α·w a < w b +w c and CompareWithBias(α) would schedule b, contradicting the assumption of the lemma.
Next, we will provide an analysis of full, split and chain charges, starting with full and split charges. We prove several lemmas from which the analysis follows. We fix some time slot t, and use the notation from Figure 2 for packets at time slots t − 1, t, t + 1 and t + 2 in the schedule of the algorithm and the optimal schedule.
Analysis of full charges. Using Rules 1 and 2, if step t receives a full back charge, then the condition of Rule 2 guarantees that it will not receive a full up charge. This gives us the following observation.

Lemma 4.3.
Step t receives at most one full charge, i.e., a charge by Rule 1 or 2.
Analysis of split charges. We now analyze close and distant split charges. The crucial property of split charges is that, similar to full charges, each step receives at most one split charge. Before we prove this, we establish several useful properties of split charges. Lemma 4.4. Let the plan at time t be p 1 , p 2 , p 3 . If j is charged using a close or a distant split charge, then the following holds: (a) j is not scheduled by the algorithm in step t − 1, i.e., j is pending for the algorithm in step t.
(b) d f = t + 1 and f is scheduled in step t + 1 in OPT (that is, k = f ). In particular, step t receives a full back charge. (c) d j = t and w j ≤ w p1 . (d) p 2 = f . Proof. By Rule 1, packet j would be charged using a full back charge if it were scheduled in step t − 1, implying (a). The case conditions for split charges in the charging scheme imply that OPT schedules f in step t + 1 and w f > w j . Now (b) follows from the fact that we do not charge j using a full up charge.
To show (c), note that if j is not expiring, then j and f would have equal deadlines. As we also have w f > w j , f would be scheduled before j in OPT by the canonical ordering, a contradiction. The inequality w j ≤ w p1 now follows from the definition of the plan.
It remains to prove (d). Towards contradiction, suppose that f = p 1 . We know that j is expiring and thus it is not in the plan. If d p2 = t + 1 then the optimality of the plan implies w p2 > w j (otherwise j, f, p 3 would be a better plan), so, since p 2 is not in OPT, we could improve OPT by scheduling f in step t and p 2 in step t + 1.
Next, assume that d p2 = t + 2. The optimality of the plan implies that w p2 > w j and w p3 > w j . Since both p 2 , p 3 have deadline t + 2, at least one of them is not scheduled in OPT. So OPT could be improved by scheduling f in step t and one of p 2 or p 3 in step t + 1. In both cases we get a contradiction with the optimality of OPT.
We show a useful lemma about a distant split charge from which we derive an upper bound on w j , similar as the upper bound in the definition of close split charge.
Lemma 4.5. If j is charged using a distant split charge, then w g < w p3 where p 3 is the third packet in the plan at time t, and d g = t + 1.
Proof. Suppose that w g ≥ w p3 . Then, from Lemma 4.4(c),(d) and the choice of p 2 = f in the algorithm, we have that 2αw j ≤ 2αw p1 < w p2 + w p3 ≤ w f + w g , so we would use the close split charge in step t, not the distant one. Thus w g < w p3 , as claimed.
To prove the second part, if we had d g = t + 2 then, since the algorithm chose g in step t + 1 and also d p3 = t + 2, we would also have that w g ≥ w p3 -a contradiction.
Lemma 4.6. If j is charged using a distant split charge then 2α·w j < w f + w h . (Recall that h is the packet scheduled in step t + 2 in ALG.) Proof. Let p 1 , p 2 , p 3 be the plan in step t. By Lemma 4.4(d) we have that f = p 2 . Thus 2α·w p1 < w p2 +w p3 by the definition of the algorithm. By Lemma 4.4(c), j is expiring and w j ≤ w p1 . As g = p 3 by Lemma 4.5, the algorithm has p 3 pending in step t + 2 where it is expiring, implying that w p3 ≤ w h . Putting it all together, we get 2αw j ≤ 2αw p1 < w p2 + w p3 ≤ w f + w h .
For a split charge from j in step t, let t be the other step that receives the split charge from j; that is, t = t + 1 for a close split charge and t = t + 2 for a distant split charge. We now show that split-charge pairs are pairwise disjoint. Lemma 4.7. If j is charged using a split charge to a pair of steps t and t , then neither of t and t is involved in another pair that receives a split charge from a packet j = j.
Proof. No matter which split charge we use for j, using Lemma 4.4(b), step t + 1 does not receive a split charge from k = f . By a similar argument, since j is not scheduled in step t − 1 in ALG, step t does not receive a close split charge from the packet scheduled in step t − 1 in OPT.
It remains to prove that if j is charged using a distant split charge, then the packet scheduled in step t + 2 in OPT is not charged using a split charge. (This also ensures that step t does not receive a distant split charge from a packet scheduled in step t − 2 in OPT.) For a contradiction, suppose that packet is charged using a split charge. Let p 1 , p 2 , p 3 be the plan in step t. Recall that g and h are the packets scheduled in steps t + 1 and t + 2 in ALG.
From Lemma 4.5, step t + 1 does not receive a full back charge. Since we did not apply the close split charge for j in Rule 3, we must have By Lemma 4.4(b) applied to step t + 2, we get d h = t + 3. Since d p3 = t + 2, we get w p3 < w h . We now use Lemma 4.2 for step t + 1 with a = g, b = p 3 , and c = h. We note that all the assumptions of the lemma are satisfied: we have d g = t + 1, (r p3 , d p3 ) = (t + 1, t + 2), (r h , d h ) = (t + 2, t + 3), and w g < w p3 < w h . This gives us that 2αw g ≥ w p3 + w h > w p3 .
Since the algorithm schedules f = p 2 in step t, we have 2αw p1 < w f + w p3 . Subtracting the inequality derived in the previous paragraph, we get 2α(w p1 − w g ) < (w f + w p3 ) − w p3 = w f -a contradiction with (10). This completes the proof.
The lemmas above allow us to estimate the total of full and split charges. Lemma 4.8. If j is charged using a split charge to a pair of steps t and t , then the total of full and split charges to steps t and t does not exceed R·(w f + w f ) where f is the packet scheduled in step t in ALG.
Proof. Each of steps t and t may receive a full charge, but each step at most one full charge from a packet of smaller or equal weight by Lemma 4.3 and charging rules.
If we use a distant split charge or if step t gets a full back charge, then 2α·w j < w f + w f by Lemma 4.6 or Rule 3. Thus the total of full and split charges to steps t and t is upper bounded by where we used (3) in the last step. Otherwise, i.e., if we use a close split charge and step t = t + 1 does not get a full back charge, then we have 2α·(w p1 − w f ) < w f + w f by Rule 3. Since d j = t by Lemma 4.4(c), we have w j ≤ w p1 and 2α·(w j − w f ) < w f + w f . Also, step t + 1 does not receive a full up charge by Lemma 4.4(b). We thus bound the total of full and split charges to steps t and t + 1 by using (3) in the last step again.
Analysis of chain charges. We now analyze chaining steps starting with a lemma below consisting of several useful observations. In particular, Part (c) motivates the name "chaining" for such steps.
Lemma 4.9. If step t is a chaining step, then the following holds: Moreover, if step t + 1 is also a chaining step, then (c) j is scheduled by the algorithm in step t + 1, i.e., g = j, (d) 2α·w f ≥ w j + w k (recall that k is the packet scheduled in step t + 1 in OPT).
Proof. Recall that Algorithm CompareWithBias(α) never schedules a packet lighter than the heaviest expiring packet. As in step t it schedules f with w f < w j (by Rule 5 for chain charges), (a) follows. Furthermore, it follows that f is expiring in step t, because otherwise the algorithm would schedule j, since both would have the same deadline and j is heavier. Thus (b) holds as well. Now assume that step t + 1 is also in the chain and for a contradiction suppose that g = j. Since j is expiring and pending for the algorithm in step t + 1, we have w g > w j and w k > w g as step t + 1 is in the chain.
Summarizing, the algorithm sees all packets f, j, g, k in step t (some are pending and some may be lookahead packets), and they are all distinct packets with w f < w j < w g < w k , d f = t, (r j , d j ) = (t, t + 1), and both g and k can be feasibly scheduled at time t + 1. Thus, independently of the release times and deadlines of g and k, the plan at time t containing f would not be optimal -a contradiction. This proves that (c) holds.
Finally, we show (d). Since f is expiring in step t by (b) and both j and k are considered for the plan at time t and satisfy (r j , d j ) = (t, t + 1), (r k , d k ) = (t + 1, t + 2), w f < w j < w k , we use Lemma 4.2 with a = f, b = j, and c = k and get the inequality in (d).
First we show that chaining steps does not receive charges of other types.
Lemma 4.10. If step t is a chanining step, then t does not receive a full charge or a split charge.
Proof. By Lemma 4.9, f is expiring, thus step t does not receive a full back charge. As w j > w f , the step also does not get a full up charge or a split charge from step t. So it remains to show that f does not receive a split charge.
First observe that step t cannot receive a close split charge from step t − 1 in OPT, because j is pending in step t in ALG, while Lemma 4.4(b) states that a split charge from step t − 1 would require j to be scheduled at time t − 1 in ALG.
Finally, we show that step t does not receive a distant split charge. For a contradiction, suppose that step t receive a distant split charge from the packet x scheduled in step t − 2 in OPT. Let p 1 , p 2 , p 3 be the plan in step t − 2. According to Lemma 4.4(d) and (b), p 2 is scheduled in step t − 2 in ALG and in step t − 1 in OPT. Moreover, by Lemma 4.4(c), x is pending and expiring in step t − 2 and w p1 ≥ w x . As the algorithm scheduled p 2 in step t − 2 we get r p2 = t − 2 and w p1 < w p3 .
Observe that p 3 is not scheduled in OPT, since it is expiring in step t and j is not expiring, by Lemma 4.9(a). Thus we could increase the weight of OPT if we scheduled p 2 in step t − 2 instead of x and p 3 in step t − 1. This contradicts the optimality of OPT.
We now analyze how much charge does each chaining step get.
Lemma 4.11. If step t is a chaining step, then it receives a charge of at most R·w f .
Proof. By Lemma 4.10, step t does not receive any full or split charges; therefore we just need to prove that the total of chain charges to step t does not exceed R·w f . Case 1: t is the last step of a chain. If t is the only step in the chain then Rule 5a implies directly that the charge to t is at most R·w f . Otherwise, Lemma 4.9(c) implies that f is scheduled in step t − 1 in OPT, and thus the charge from step t − 1 is (1 − 2δ)·w f . The charge from step t is at most (R − 1 + 2δ)·w f by Rule 5c. So the total charge is at most R·w f . Case 2: t is not the last step of a chain. Since step t + 1 is also in the chain, by Lemma 4.9(c) we have that j is scheduled in step t + 1 in ALG and OPT has a packet k with w k > w j in step t + 1. From Lemma 4.9(d) we know that 2α·w f ≥ w j + w k .
There are two sub-cases. If t is the first step of the chain, then the charge to t is at most 2δ ·w j + δ ·w k ≤ 3 2 δ ·(w j + w k ) ≤ 3αδ ·w f < R·w f , where the last inequality follows from (8). Otherwise, using Lemma 4.9(c), f is scheduled in step t − 1 in OPT, so the total charge to step t is at most where the last equality follows from (2).
Analysis of forward charges from chains. We now show that a forward charge from a chain does not cause an overload on the step just after the chain which may also get both a full charge and a split charge. (This is the only case when a step receives charges of all three types.) For the following lemmas we assume that step t − 1 is a chaining step. Recall that i is the packet scheduled in step t − 1 in OPT and e is the packet scheduled in step t − 1 in ALG. First, we prove some useful observations. Lemma 4.12. If step t receives a forward charge from a chain, then the following holds (a) j = e (that is, j is not charged using a full back charge), Moreover, if step t is not in a split-charge pair: (d) j is charged using a full up charge to step t, (e) step t does not receive a back charge.
Proof. Part (a) holds because e is expiring in step t − 1, by Lemma 4.9(b). Part (b) follows from (a) and the fact that step t is not chaining.
To show (c), Lemma 4.9(a) implies that d i = t. Also, since i = e, i is pending in ALG in step t. Now (c) follows, because each packet scheduled by the algorithm is at least as heavy as the the heaviest expiring packet. Part (d) follows from (a) and (b) and the assumption that t is not in a split-charge pair. Part (e) follows from (d) and Lemma 4.3.
Note that f may be the same packet as i or j. We start with the case in which f is not in a split-charge pair.
Lemma 4.13. If step t receives a forward charge from a chain C and t is not in a split-charge pair, then the total charge to step t is at most R·w f .
Proof. The proof is by case analysis, depending on the relative weights of j and e, and on whether C is a singleton or a long chain. In all cases we use Lemma 4.12 and the charging rules to show upper bounds on the total charge. Case 1: w j < w e . Case 1.1: The chain C is long. The charge to step t is then at most To justify inequality (11), note that 2 − R − 2δ ≥ 0 by (5) and 1 − δ ≥ 0 by the choice of δ, so we can apply inequalities w j ≤ w f and w i ≤ w f from Lemma 4.12(b) and (c). The last step (12) follows from equation (4).
Case 1.2: The chain C is singleton. We assume that w i > R·w e , otherwise there is no forward charge from the chain. Then the charge to step t is where in the last step we used Lemma 4.12(c).
Case 2: w j > w e . We claim first that j is not expiring in step t, that is d j = t + 1. Indeed, if we had d j = t, then in step t − 1 the algorithm would have pending packets e and i, plus packet j (pending or lookahead), that need to be scheduled in slots t − 1 and t. Since w e < w i (because step t − 1 is a chaining step) and w e < w j (by the case assumption), packet e could not be in the plan in step t − 1 which is a contradiction. Thus d j = t + 1.
Recall that e is expiring in step t − 1 by Lemma 4.9(b) and both i and j are considered for the plan in step t − 1. Moreover, we know that w i > w e , w j > w e , (r i , d i ) = (t − 1, t) (by Lemma 4.9(a)), and (r j , d j ) = (t, t + 1). We thus use Lemma 4.2 for step t − 1 with a = e, b = i, and c = j, to get that 2α·w e ≥ w i + w j . Case 2.1: The chain C is long. The charge to step t is To justify inequality (13), we note that 1 − δ − (R − 1 + 2δ)/(2α) ≥ 0, by (6), so we can again apply inequalities w j ≤ w f and w i ≤ w f from Lemma 4.12(b) and (c). In the last step (14) we used equation (1).
Case 2.2: The chain C is singleton. We assume that w i > R·w e , otherwise there is no forward charge from the chain. Then the charge to step t is Inequality (15) is valid, because w i ≤ w f and w j ≤ w f , by Lemma 4.12, and 1 − R/(2α) ≥ 0 by (7). In step (16) we used (9).
We now analyze how the forward charge from a chain combines with split charges. First we observe that only the first step from a split-charge pair may receive a forward charge from a chain.
Lemma 4.14. If j is charged using a split charge to a pair of steps t and t (where t is t + 1 or t + 2), then t does not receive a forward charge from a chain.
Proof. By Lemma 4.4(b) we have k = f , which implies that steps t and t + 1 are not chaining steps.
Lemma 4.15. If j is charged using a split charge to a pair of steps t and t , f is the packet scheduled in t in ALG, and step t receives a forward charge from a chain C, then the total charge to steps t and t is at most R·(w f + w f ).
Proof. First we note that j is expiring in step t by Lemma 4.4(c) and f is not expiring in step t by Lemma 4.4(b), so f = i.
We claim w j < w e . Indeed, if w j > w e , then in step t − 1 the algorithm would have pending packets e and i, plus packet j (pending or lookahead), that need to be scheduled in slots t − 1 and t. Since w e < w i (because step t − 1 is a chaining step) and w e < w j , packet e could not be in the plan in step t − 1 which is a contradiction. Therefore w j < w e .
Let p 1 , p 2 , p 3 be the plan at time t. We split the proof into two cases, both having two subcases, one for long chains and one for singleton chains. Case 1: j is charged using a distant split charge or f gets a full back charge.
We claim that 2α·w i < w f + w f . Indeed, since i is expiring and pending in step t by Lemma 4.9(a), we have w i ≤ w p1 . As the algorithm scheduled f = p 2 by Lemma 4.4(d) we get 2α·w p1 < w f + w p3 . To prove the claim it remains to show w f ≥ w p3 .
If j is charged using a distant split charge, then by Lemma 4.5 we have w g < w p3 and in particular, g = p 3 . Thus p 3 is pending and expiring in step t + 2, hence w p3 ≤ w f . Otherwise, if j is charged using a close split charge, then f = g gets a full back charge. Hence d g = t + 2. Since also d p3 = t + 2 and the algorithm chooses the heaviest such packet, we have w p3 ≤ w g .
The claim follows, since Case 1.1: The chain C is long. We upper bound the total charge to steps t and t by = R·(w f + w f ) We can use w e < w i in (18), because 2 − R − 2δ ≥ 0 by (5). Equality (19) follows from 2 − R − 3δ = 0 by (4) and inequality (20) from (17). In the last step we use (3). Case 1.2: The chain C is singleton. We suppose that w i > R·w e , otherwise there is no forward charge from the chain. We upper bound the total charge to steps t and t by where we apply Equation 17 in (21), and we use (3) in the last step. Case 2: j is charged using a close split charge and f = g does not get a full back charge. We have 2α·(w p1 − w g ) < w f + w g by the definition of the close split charge. Since i is expiring and pending in step t by Lemma 4.9(a), we have w i ≤ w p1 . Hence 2α·(w i − w g ) < w f + w g . This is equivalent to Case 2.1: The chain C is long. We again suppose that w i > R·w e , as otherwise there is no forward charge from the chain. The total charge to steps t and t = t + 1 is We can use w e < w i in (23), because 2 − R − 2δ ≥ 0 by (5). Then we use 2 − R − 3δ = 0 by (4) in (24), Equation 22 in (25), and Equation 3 in the last step. Case 2.2: The chain C is singleton. We upper bound the total charge to steps t and t + 1 by where we apply (22) in inequality (26), and (3) in the last step.
We now summarize our analysis of CompareWithBias(α). If t is not in a split-charge pair, we show upper bounds on the total charge to step t. For each split-charge pair (t, t ), we show upper bounds on the total charge to both steps t and t . This is sufficient, since split-charge pairs are pairwise disjoint by Lemma 4.7, thus summing all the bounds gives the result.
For each step t, we distinguish three cases according to whether t is in a split-charge pair and whether t is a chaining step. In all cases, let f be the packet scheduled at time t in ALG and let j be the packet scheduled at time t in OPT. Case 1: Step t is not chaining and it is not in a split-charge pair. Then t receives at most one full charge from a packet p such that w p ≤ w f (by Lemma 4.3 and charging rules) and possibly a forward charge from a chain C; then Lemma 4.13 shows that the sum of a forward charge from a chain and a full charge is at most R·w f .

Case 2:
Step t is a chaining step. Then it does not receive a split charge or a full charge, by Lemma 4.10. Lemma 4.11 implies that step t receives a charge of at most R·w f . Case 3: (t, t ) is a split-charge pair, i.e., t is the first step of the split-charge pair and t = t + 1, or t = t + 2. Thus j is charged using a split charge. Let f be the packet scheduled in step t in ALG.
By Lemma 4.14 step t does not receive a forward charge from a chain. If step t also does not receive a forward charge from a chain, then the total charge to steps t and t is at most R·(w f + w f ) by Lemma 4.8. Otherwise, step t receives a forward charge from a chain and we apply Lemma 4.15 to show that the total charge to steps t and t is again at most R·(w f + w f ).

A Lower Bound for 2-bounded Instances with Lookahead
In this section, we prove that there is no online algorithm for PacketScheduling with 1-lookahead that has competitive ratio smaller than 1 4 (1 + √ 17) ≈ 1.281, even for 2-bounded instances. The idea of our proof is somewhat similar to the proof of the lower bound of φ for PacketScheduling [10,2,4].
Proof. Fix some online algorithm A and some ε > 0. We will show that, for some sufficiently large integer n and sufficiently small δ > 0, there is a 2-bounded instance of PacketScheduling with 1-lookahead, parametrized by n and δ, for which the optimal profit is at least (R − ε) times the profit of A.
Our instance will consist of phases 0, . . . , k, for some k ≤ n. In each phase i < n we will release three packets whose weights will grow roughly exponentially from one phase to next. The number k of phases is determined by the adversary based on the behavior of A.
The adversary strategy is as follows. We start with phase 0. Suppose that some phase i, where 0 ≤ i < n, has been reached. In phase i the adversary releases the following three packets: • A packet a i with weight w i , release time 2i + 1 and deadline 2i + 1, i.e., a tight packet.
• A packet c i with weight w i+1 , release time 2i + 2 and deadline 2i + 3. (The weights w i will be specified later.) Now, if A schedules an expiring packet in step 2i + 1 (a tight packet a i or c i−1 , which may be pending from the previous phase), then the game continues; the adversary will proceed to phase i + 1. Otherwise, the algorithm schedules packet b i , in which case the adversary lets k = i and the game ends. Note that in step 2i + 2 the algorithm may schedule only b i or c i , each having weight w i+1 . Also, importantly, in step 2i + 1 the algorithm cannot yet see whether the packets from phase i + 1 will arrive or not.
If phase i = n is reached, then in phase n the adversary releases a single packet a n with weight w n and release time and deadline 2n + 1, i.e., a tight packet.
We calculate the ratio between the weight of packets in an optimal schedule and the weight of packets sent by the algorithm. Let S k = k i=0 w i . There are two cases: either k < n, or k = n. Case 1: k < n. In all steps 2i + 1 for i < k algorithm A scheduled an expiring packet of weight w i and in step 2k + 1 it scheduled packet b k of weight w k+1 . In an even step 2i + 2 for i ≤ k it scheduled a packet of weight w i+1 . Note that there is no packet scheduled in step 2k + 3. Overall, A scheduled packets of total weight S k−1 + w k+1 + S k+1 − w 0 = 2S k+1 − w k − w 0 .
The adversary schedules packets of weight w i+1 in steps 2i + 1 and 2i + 2 for i < k and all packets from phase k in steps 2k + 1, 2k + 2 and 2k + 3. In total, the optimum has a schedule of weight 2S k+1 − 2w 0 + w k . The ratio is Case 2: k = n. As before, in all odd steps 2i + 1 for i < n algorithm A scheduled an expiring packet of weight w i and in all even steps 2i + 2 for i < n it scheduled a packet of weight w i+1 . In the last step 2n + 1 it scheduled a packet of weight w n as there is no other choice. Overall, the total weight of A's schedule is 2S n − w 0 .
The adversary schedules packets of weight w i+1 in steps 2i + 1 and 2i + 2 for i < n and a packet of weight w n in the last step 2n + 1 which adds up to 2S n − 2w 0 + w n . The ratio is R n = 2S n + w n − 2w 0 2S n − w 0 .
We start with an intuitive explanation which leads to the optimal setting of weights w i and the ratio R for the instances of the type described above. We normalize the instances so that w 0 = 1. We want to set the weights so that R k ≥ R − ε for all k ≥ 0 and R n ≥ R − ε. We first find the weights depending on δ such that R k = R for all k ≥ 1. Using w k = S k − S k−1 for k ≥ 1 and w 0 = 1, the condition R k = R for k ≥ 1 is rewritten as or equivalently as (2R − 2)S k+1 − (R + 1)S k + (R + 1)S k−1 = −(2 − R) .
The last equality is verified by a direct calculation; actually it is the equation that defines the optimal R for our construction (if β as the root of the characteristic polynomial of the recurrence is expressed in terms of R).