{'fraction_non_alphanumeric': 0.05256123745672845, 'fraction_numerical': 0.012422768502694886, 'mean_word_length': 3.876388888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Optimal Power Control and Scheduling for Real-Time and Non-Real-Time Data

We consider a joint scheduling-and-power-allocation problem of a downlink cellular system. The system consists of two groups of users: real-time (RT) and non-real-time (NRT) users. Given an average power constraint on the base station, the problem is to find an algorithm that satisfies the RT hard deadline constraint and NRT queue stability constraint. We propose two sum-rate-maximizing algorithms that satisfy these constraints as well as achieving the system's capacity region. In both algorithms, the power allocation policy has a closed-form expression for the two groups of users. However, interestingly, the power policy of the RT users differ in structure from that of the NRT users. The first algorithm is optimal for the on-off channel model with a polynomial-time scheduling complexity in the number of RT users. The second, on the other hand, works for any channel fading model which is shown, through simulations, to have an average complexity that is close-to-linear. We also show the superiority of the proposed algorithms over existing approaches using extensive simulations.


I. INTRODUCTION
Quality-of-service-based scheduling has received much attention recently. It is shown in [2] and [3] that quality-ofservice-aware scheduling results in a better performance in LTE systems compared to best-effort techniques. Depending on the application, quality-of-service (QoS) metrics capture long-term throughput [4], short-term throughput [5], per-user average delay [6], average number of packets missing a specific deadline [7], or the average time a user waits to receive its data [8]. Real-time audio and video applications require algorithms that take hard deadlines into consideration. This is because if a real-time packet is not transmitted on time, the corresponding user might experience intermittent connectivity of its audio or video.
The problem of scheduling for wireless systems under harddeadline constraints has been widely studied in the literature (see, e.g., [9] and [10] for a survey). In [7] the authors consider binary erasure channels and present a sufficient and necessary condition to determine if a given problem is feasible. The work is extended in three different directions. The first direction studies the problem under delayed feedback [3]. The second considers general channel fading models [11]. The third studies multicast video packets that have strict deadlines and utilize network coding to improve the overall network performance [12], [13]. Unlike the time-framed assumption in the previous works, the authors of [14] assume that arrivals and deadlines do not have to occur at the edges of a time The work in this paper has been supported by NSF Grant ECCS-1307982. Parts of this work have been accepted in IEEE WCNC 2017 conference [1]. frame. They present a scheduling algorithm under the on-off channel fading model and present its achievable region under general arrivals and deadline patterns but with a fixed power transmission. In [15] the authors study the scheduling problem in the presence of real-time and non-real-time data. Unlike real-time data, non-real-time data do not have strict deadlines but have an implicit stability constraint on the queues. Using the dual function approach, the problem was decomposed into an online algorithm that guarantees network stability and satisfies the real-time users' constraint.
Power allocation has not been considered for RT users in the literature, to the best of our knowledge. In this paper, we study a throughput maximization problem in a downlink cellular system serving RT and NRT users simultaneously. We formulate the problem as a joint scheduling-and-powerallocation problem to maximize the sum throughput of the NRT users subject to an average power constraint on the base station (BS), as well as a delivery ratio requirement constraint for each RT user. The delivery ratio constraint requires a minimum ratio of packets to be transmitted by a hard deadline, for each RT user. Perhaps the closest to our work are references [15] and [16]. The former does not consider power allocation, while the latter assumes that only one user can be scheduled per time slot. The contributions in this paper are as follows: • We present two scheduling-and-power-allocation algorithms. The first is for the on-off channel fading model while the second is for the continuous channel fading model. • We show that both algorithms are optimal. That is, both satisfy the average power constraint, the delivery ratio requirement constraint, in addition to achieving the capacity region. However, the complexity of the first is polynomial in the number of users, while the second is shown to have an average complexity that is close-tolinear. • We present closed-form expressions for the power allocation policy used by both algorithms. It is shown that the power allocation expressions for the RT and NRT users have a different structure. • Through simulations, we show the complexity and throughput performances of the proposed algorithms over baseline ones.
The rest of this paper is organized as follows. In Section II we present the system model and the underlying assumptions. The problem is formulated in Section III. For the on-off channel model, the proposed power-allocation and scheduling algorithm as well as its optimality is presented in Section IV. In Section V we present the optimal algorithm for the continuous channel model as well as another optimal algorithm with a lower complexity. The capacity region of the problem is presented in Section VI. Simulation results and comparisons with baseline approaches is presented in Section VII. Finally, the paper is concluded in Section VIII.

II. SYSTEM MODEL
We assume a time slotted downlink system with slot duration T seconds. The system has a single base station (BS) having access to a single frequency channel. The interference coming from all other neighboring BSs is assumed to be treated as noise. There are N users in the system indexed by the set N {1, · · · , N }. The set of users is divided into the RT users N R {1, · · · , N R }, and NRT users N NR {N R + 1, · · · , N } with N R and N NR N − N R denoting the number of RT and NRT users, respectively.
We model the channel between the BS and the ith user as a fading channel with power gain γ i (k). The distribution and statistics of γ i (k) is arbitrary and need not be known to the BS nor to any of the users. In this paper, we present the problem for the on-off channel fading case in Sections III and IV and then we generalize this to the continuous fading case in Section V. The on-off model [7] corresponds to the wellknown binary erasure channel model and models whether the channel is in outage or not. While the continuous fading model is more general and captures all independent and identically distributed channel distributions its solution, as will be seen, has a higher complexity.
For the on-off channel model, if channel i is in a non-outage state during the kth slot then γ i (k) = 1, otherwise γ i (k) = 0. Channel gains are fixed over the whole slot and change independently in subsequent slots and are independent across users. Hence, the channel gain follows a Bernoulli process. Channels with a more general fading model will be discussed in Section V. Moreover, γ i (k) is known to the BS, for all i ∈ N , at the beginning of the each slot.

A. Packet Arrival Model
Let a i (k) ∈ {0, 1} be the indicator of a packet arrival for user i ∈ N at the beginning of the kth slot. {a i (k)} is assumed to be a Bernoulli process with rate λ i packets per slot and assumed to be independent across all users in the system. Packets arriving at the BS for the RT users are called realtime packets. RT packets have a strict transmission deadline. If an RT packet is not transmitted by this deadline, this packet is dropped out of the system and does not contribute towards the throughput of the user. However, RT user i is satisfied if it receives, on average, more than q i % of its total number of packets. We refer to this constraint as the QoS constraint for user i. Here we assume that real-time packets arriving at the beginning of the kth slot have their deadline at the end of this slot.
On the other hand, packets arriving to the BS for the NRT users can be transmitted at any point in time. Thus, packets for NRT user i are stored, at the BS, at user i's (infinite-sized [17]) buffer and served on a first-come-first-serve basis. Since the arrival rate λ i , for NRT user i, might be higher than what the system can support, we define r i (k) as an admission controller for user i at slot k. At the beginning of slot k, the BS sets r i (k) to 1 if the BS decides to admit user i's arrived packet to the buffer, and to 0 otherwise. The time-average number of packets admitted to user i's buffer is And the queue associated with NRT user i is given by where r i (k) is the admission control decision variable for NRT user i at the beginning of slot k. We note that no admission controller is defined for the RT users since their buffers cannot build up due to the presence of a deadline.

B. Service Model
Following [11] we assume that more than one user can be scheduled in one time slot. However, due to the existence of a single frequency channel in the system, the BS transmits to the scheduled users sequentially as shown in Fig. 1. At the beginning of the kth slot, the BS selects a set of RT users denoted by S R (k) ⊆ N R and a set of NRT users S NR (k) ⊆ N NR to be scheduled during slot k. Thus a total of N k |N k | users are scheduled at slot k where N k S R (k) ∪ S NR (k) (Fig. 1). Moreover, the BS assigns an amount of power P i (k) for every user i ∈ N k . This dictates the transmission rate for each user according to the channel capacity given by Finally, the BS determines the duration of time, out of the T seconds, that will be allocated for each scheduled user. We define the variable µ i (k) to represent the duration of time, in seconds, assigned for user i ∈ N during the kth slot ( Fig.  1). Hence, µ i (k) ∈ [0, T ] for all i ∈ N . The BS decides the value of µ i (k) for each user i ∈ N at the beginning of slot k. Since RT users have a strict deadline, then if an RT user is scheduled at slot k, then it should be allocated the channel for a duration of time that allows the transmission of the whole packet. Thus we have where L is the number of bits per packet, that is assumed to be fixed for all packets in the system. The extension to multiple packet types of different lengths will be addressed in Section V-C. Equation (4) means that, depending on the transmission power, if RT user i is scheduled at slot k, then it is assigned as much time as required to transmit its L bits. Hence, unlike the NRT users that have µ i (k) ∈ [0, T ], µ i (k) is further restricted to the set {0, L/R i (k)} for the RT users. For ease of presentation, we denote Q(k) [Q 1 (k), · · · , Q NNR (k)] T .
In the next section we present the problem formally.

III. PROBLEM FORMULATION FOR ON-OFF CHANNELS
We are interested in finding the scheduling and power allocation algorithm that maximizes the sum-rate of all NRT users subject to the system constraints. In this paper we restrict our search to slot-based algorithms which, by definition, take the decisions only at the beginning of the time slots. Now define the average rate of user i ∈ N NR to be Thus the problem is to find the scheduling, power allocation and packet admission decisions at the beginning of each slot, that solve the following problem lim sup where (6) says that no packets should be admitted to the ith buffer if no packets arrived for user i. Constraint (7) means that the queues of the NRT users have to be stable. Constraint (8) indicates that the resources allocated to a RT user i need to be such that the fraction of packets transmitted by the deadline are greater than the required QoS q i . Constraint (9) is an average power constraint on the BS transmission power. Finally constraint (11) guarantees that the sum of durations of transmission of all scheduled users does not exceed the slot duration T . In this paper, we assume that the NRT user with the longest queue has enough packets, at each slot, to fit the whole slot duration which is a valid assumption in the heavy traffic regime. It will be clear that the generalization to the non-heavy traffic regime is possible by allowing multiple NRT users to be scheduled but this is omitted for brevity.
IV. PROPOSED ALGORITHM FOR ON-OFF CHANNELS We use the Lyapunov optimization technique [18] to find and optimal algorithm that solves (5). We do this on four steps: i) We define, in Section (IV-A) a "virtual queue" associated with each average constraint in problem (5). This helps in decoupling the problem across time slots. ii) In Section IV-B, we define a Lyapunov function, its drift and a, per-slot, reward function. The latter is proportional to the objective of (5). iii) Based on the virtual queues and the Lyapunov function, we form an optimization problem, for each slot k, that minimizes the drift-minus-reward expression the solution of which is the proposed power allocation and scheduling algorithm. In Section IV-C, we propose an efficient way to solve this problem optimally. iv) Finally, we show that this minimization guarantees reaching an optimal solution for (5), in Section IV-D.

A. Problem Decoupling Across Time Slots
We define a virtual queue associated with each RT user as follows is a measure of how much constraint (8) is violated for user i. We will later show a sufficient condition on Y i (k) for constraint (8) to be satisfied. Hence, we say that the virtual queue Y i (k) is associated with constraint (8). Similarly, we define the virtual queue X(k), associated with constraint (9), as To provide a sufficient condition on the virtual queues to satisfy the corresponding constraints, we use the following definition of mean rate stability of queues [18,Definition 1] to state the lemma that follows.
Proof. Proof follows along the lines of Lemma 3 in [18].

Lemma 1 shows that when the virtual queue
k=0 is mean rate stable, then constraint (9) is satisfied. Thus, our objective would be to devise an algorithm that guarantees the mean rate stability of Y i (k) for all RT users as well as the mean rate stability for X(k).

B. Applying the Lyapunov Optimization
The quadratic Lyapunov function is defined as where U(k) (Y(k), Q(k), X(k)), and the Lyapunov drift as ∆(k) is the conditional expectation of the random variable x given U (k). Squaring (2), (13) and (14) taking the conditional expectation then summing over i, the drift becomes bounded by where We define B max as an arbitrarily chosen positive control parameter that controls the performance of the algorithm. We shall discuss the tradeoff on choosing B max later on.
represents the average number of bits admitted to NRT user i's buffer at slot k, we refer to as the "reward term". We subtract this term from both sides of (16), then use (18) and rearrange to bound the drift-minus-reward term as where Ψ R (i, k) and Ψ NR (i, k) are given by respectively, where we used (4) in (20). The proposed algorithm schedules the users, allocates their powers and controls the packet admission to minimize the right-hand-side of (19) at each slot. Since the only term in right-hand-side of (19) that is a function in r i (k) ∀i ∈ N NR is the fourth term, we can decouple the admission control problem from the joint scheduling-and-power-allocation problem. Minimizing this term results in the following admission controller: set (10), (11) and (12).
(22) This is a per-slot optimization problem the solution of which is an algorithm that minimizes the upper bound on the driftminus-reward term defined in (19). Next we show how to solve this problem in an efficient way.

C. Efficient Solution for the Per-Slot Problem
We first solve for the NRT variables then use its result to solve for the RT variables.
1) NRT variables: To solve this problem optimally, we first find the optimal power-allocation-and-scheduling policy for the NRT users through the following lemma.

Lemma 2.
If an NRT user i is scheduled to transmit any of its NRT data during the kth slot, then the optimum power level for this NRT with respect to (w.r.t.) problem (22) is given by Moreover, in the heavy traffic regime, the optimum NRT user to be scheduled, if any, w.
Proof. We observe that, for any i ∈ N NR , the only term in (22) that is a function in P i (k) is Ψ NR (i, k). Differentiating (21) w.r.t. P i (k) for all i ∈ N NR , equating the results to 0 and noting the minimum and maximum power constraints (10), we get the water-filling power allocation formula (23). This completes the first part of the lemma.
To prove the second part, we substitute by (23) in (21) to get Ψ * NR (i, k). We continue the proof by contradiction. Suppose that the optimal scheduled NRT set is given by S * . Thus, there exists some values α > 0 and β > 0 such that the corresponding scheduler would be µ i * NR (k) = α and µ j (k) = β, while µ l k (k) = 0 for all l k / ∈ {i * NR , j}. In other words, α seconds are assigned to i * NR and β seconds assigned to j. However, if user i * NR has enough backlogged data, which happens in the heavy traffic regime, then we can increase its assigned duration to µ i * NR = α + β and thus set µ j (k) = 0, to get an increase in the objective of (22) by β (Ψ * NR (i * NR , k) − Ψ * NR (j, k)) > 0 which contradicts with the optimality of S * NR (k) and completes the proof of the lemma.
Lemma 2 provides the optimal scheduling policy for the NRT users, at the kth slot, as well as the optimal power allocation w.r.t. problem (22). The lemma shows that if any of the NRT users is going to be scheduled in the kth slot, then only one of them is going to be scheduled. This means that the scheduling policy for the NRT users is which is a manipulation of (11). Substituting (24) and (22), the latter becomes subject to (12), (10) and which is simpler than (22) since it is not a function in the NRT variables except µ i * NR (k). Finding the optimal value of µ i * NR (k) solves the NRT scheduling problem. We will first solve for µ i (k) for all RT users then use (24) to find µ i * NR (k).

2) RT Variables:
To find the scheduler of the RT users that is optimal w.r.t. problem (25), we first solve for [P i (k)] i∈NR given a fixed set S R (k), then we discuss the scheduling policy that solves for this set. To solve for [P i (k)] i∈NR , we present the following definition then present a theorem that discusses the optimum power allocation policy for the RT users.

Definition 2. We define the Lambert power allocation policy for the RT users as
Theorem 1. Given any set S R (k), if the Lambert power policy results in i∈SR(k) L/ log(1 + P i (k)) ≤ T , then it is the optimum RT-users' power allocation policy given that S R (k) is the scheduling set at slot k. Otherwise, the optimum power allocation policy is given by Proof. We prove this theorem by applying the Lagrange optimization [20,Ch. 5] technique to problem (25) then use the complementary slackness condition.
Since µ i (k) ≥ 0 for all i ∈ N R (see (4)), then we have the constraint µ i * NR (k) ≤ T always holds from (24). Thus we define the Lagrange multiplier φ to be the multiplier associated with the constraint µ i * NR (k) ≥ 0. The Lagrangian becomes Differentiating (28) with respect to P i (k) and equating to 0 After some manipulations and denoting we get Thus we getP eP = φ γ i (k) − 1 e −1 which has two solutions inP (see [19]), one of them yields a negative value for P i (k). Hence, with the help of W 0 (·), which is the inverse function of xe x , we can write a unique solution for (29) as (32) To calculate (32), we need to find the value of φ satisfying the complementary slackness condition φµ i * NR (k) = 0. Hence we have one of the two following possibilities might yield the optimal solution: 1) setting φ = 0 and thus µ i * NR (k) ≥ 0, or 2) setting µ i * NR (k) = 0 and thus φ ≥ 0. If setting φ = 0 yields i∈SR(k) L/ log(1 + P i (k)) ≤ T then the Lambert power allocation policy in (26) is optimum since there exists no other non-negative value for φ that yields i∈SR(k) L/ log(1+ P i (k)) = T while satisfying µ i * NR (k) = 0 (to satisfy the complementary slackness). On the other hand, if setting φ = 0 yields i∈SR(k) L/ log(1 + P i (k)) > T , then φ cannot be 0. Thus we have µ i * NR (k) = 0, which means that the time slot will be allocated for RT users only. The corresponding value of φ should satisfy i∈SR(k) L/ log(1 + P i (k)) = T . From (32), we observe that P i (k) = P j (k) for all i, j ∈ S R (k) because γ i (k) = 1 for all i ∈ S R (k). Thus we have L|S R (k) |/ log(1 + P i (k)) = T . This yields the power allocation policy (27) and completes the proof.
Theorem 1 gives closed-form expressions for the power function of the RT users given any scheduling set S R (k). To find the optimum scheduling set S R (k) that solves problem (25), we present the following definition then mention a theorem that decreases the complexity of this search.
Definition 3. At slot k, the set S R (k) is said to be a "candidate" set if and only if Y i (k) ≥ Y j (k) for all i ∈ S R (k) and all j / ∈ S R (k). Otherwise it is called a "non-candidate" set.
We note that the definition of candidate sets assumes that all RT users have γ i (k) = 1. If this assumption does not hold at some time slot k, then we eliminate the users with γ i (k) = 0 from the system for this time slot and consider only those with γ i (k) = 1.
Theorem 2. The optimal RT set that solves (25) is one of the candidate sets.
Proof. We prove this theorem by contradiction. Suppose that S * R (k) is the optimal set and that it is not a candidate set. That is, ∃i ∈ S R (k) and j / ∈ S R (k) such that Y i (k) < Y j (k). It is easy to show that the Lambert power policy results in the fact that P i (k) depends on |S R (k) | and not on S R (k) for any i ∈ S R (k) and any S R (k). Thus, replacing user i with user j results in having P j (k) = P i (k) which means that X(k)P j (k)µ j (k) = X(k)P i (k) µ i (k) holds. But since Y i (k) < Y j (k), swapping the two users increases the objective function of (25) and results in a candidate set. This contradicts with the fact that S R (k) is optimal while being non-candidate.
Theorem 2 says that there will be no scheduled RT users having a value of Y j (k) smaller than any of the unscheduled RT users. This theorem suggests an algorithm to reduce the complexity of scheduling the RT users from O 2 NR to O (N R ). This algorithm is to list the RT users in a descending order of their Y i (k). Without loss of generality, in the remaining of this paper, we will assume that Y 1 > Y 2 · · · > Y NR .
We now propose Algorithm 1 which is the scheduling and power allocation algorithm for problem (5). Algorithm 1 is executed at the beginning of the kth slot and, without loss of generality, it assumes: 1) all RT users in the system have received a packet at the beginning of the kth slot, 2) all users in the system have an "on" channel. If, at some slot, any of these assumptions does not hold for some users, these users are eliminated from the system for this slot. That is, they will not be scheduled. In addition, we assume heavy traffic regime, thus the NRT user with the longest queue has enough data to fill the entire time slot. We define the set S RT to be the set of all candidate sets.

D. Optimality of Proposed Algorithm
We first define R (opt) i to be the throughput of NRT user i under the optimal algorithm that solves (5). We define this algorithm to be the one that sets, at each time slot k, the variables P i (k), µ i (k), 1 i (k) and R i (k) to the valuesP i (k), µ i (k),1 i (k) andR i (k), respectively, where the latter values satisfy lim sup lim sup lim sup where R (opt) i is the optimal rate for user i ∈ N NR with respect to solving (5). The following theorem gives a bound on the performance of Algorithm 1 compared to the optimal algorithm that has a genie-aided knowledge of R (opt) i which, Algorithm 1 Scheduling and Power Allocation Algorithm 1: Define the auxiliary functions Ψ X (·) : S RT → R + and P X (·, ·) : S RT × N R → R + . 2: Initialize P X (S, i) = 0 for all S ∈ S RT and all i ∈ N R . 3: Sort the RT users in a descending order of Y i (k). Without loss of generality, assume that Y 1 > Y 2 · · · > Y NR . 4: Find the user i * NR with longest queue Q i (k) and set S R (k) to be an empty set. 5: while i ≤ N R do 6: S R (k) = S R (k) ∪ {i} and set the power according to (26) ∀i ∈ S R (k).
we show that, due to this knowledge it can solve the problem optimally.

Theorem 3. For the on-off channel model, if problem (5)
is feasible, then for any B max > 0 Algorithm 1 results in satisfying all constraints in (5) and achieves an average rate satisfying Proof. See Appendix A Theorem 3 says that Algorithm 1 yields an objective function (5) that is arbitrary close to the performance of the optimal algorithm that solves (5).

V. EXTENSIONS TO CONTINUOUS FADING CHANNELS
In the case of continuous fading, i.e. γ i (k) ∈ [0, γ max ] where γ max < ∞ is the maximum channel gain that γ i (k) can take, we expect the power allocation to depend on the channel gain. An algorithm that solves this case is a generalization of Algorithm 1 that assumes γ i (k) ∈ {0, 1}. However, as will be demonstrated later, the scheduling algorithm of the RT users has a higher complexity order than the special case of on-off channel gains.
We adopt the same model as in Section II except that we allow γ i (k) to take any value in the interval [0, γ max ], for all i ∈ N . The transmission rate for this case is still given by (3), and the optimization problem is the same as (5) with a new assumption for γ i (k).

A. Derivation of the Algorithm
Algorithm 2 is based on the same Lyapunov optimization procedure as explained in Section IV. Following this procedure, we reach optimization problem (25) with the new definition of γ i (k). We now present the solution for the NRT users followed by that of the RT users. Lemma 3. If user i ∈ N NR is scheduled to transmit any of its NRT data during the kth slot, then the optimum power level for this NRT w.r.t. problem (25) in the continuous fading case is given by Moreover, in the heavy traffic regime, the scheduled NRT user, if any, that optimally solves problem (5) is given by with ties broken randomly uniformly, while Ψ * NR (i, k) comes by substituting (37) in (21).
Proof. The proof is similar to that of Lemma 2 and is omitted for brevity. Lemma 3 presents the optimal power and scheduling policy for the NRT users. To solve for the RT users, we assume a fixed subset S R (k) ⊆ N R of RT users to be scheduled during the kth slot and find the power allocation of these users. Consequently, the optimum set S * R (k) is the one that maximizes (25). In Section V-B, we present an algorithm that finds this optimum set as well as discussing the complexity of this algorithm.
Assuming that the users in the set S R (k) are scheduled at the kth slot, the problem is to find the transmission power levels for all the users in this set. We answer this question in the following theorem. Lemma 3, is optimal w.r.t. (25) when φ is set to a non-negative value that satisfies (11).

Theorem 4. In the continuous-fading channel model, given some non-empty set S R (k), the power allocation policy
Proof Sketch: The proof is similar to that of Theorem 1. The only difference is that we have to obtain the optimum value of φ satisfying (11). We note that instead of finding φ > 0 using a 1-dimensional grid search, we can use the bisection method [21, Ch.9] which requires the monotonicity of the left-hand-side of (11), a fact that can be shown easily by showing that the derivative, of this left-hand-side, with respect to φ is always negative. Moreover, since the bisection algorithm needs a bracketing interval, it can be easily shown It is clear that the Lambert power policy in (39) has a different structure than the water-filling policy in (37). The reason is because the former is for the RT users while the later is for the NRT users. We plot the two policies in Fig.  2 with L = 1, T = 1, P max = 20 while Q i (k)/X(k) = 15. The Lambert policy is plotted assuming a single RT user is scheduled at slot k while the water-filling policy is plotted assuming a single NRT user is scheduled at slot k. We note that when a RT user i is the only scheduled user, (39) is equivalent to We contrast the fact that, while the water-filling is an increasing function in the channel gain, the Lambert is a decreasing function in the channel gain. This is because the RT user has a single packet of a fixed length to be transmitted. If the channel gain increases, then the power decreases to keep the same transmission rate resulting in the same transmission duration of one slot. This result holds when multiple RT users are scheduled as well as demonstrated in the following theorem.
Theorem 5. Let S R (k) be some scheduling RT set at slot k. The power P i (k) given by (39) is monotonically decreasing in γ i (k) ∀i ∈ S R (k).
Proof Sketch: Proof follows by differentiating (39) with respect to γ i (k) for some user i, while having φ satisfying (11), and showing that the resulting derivative is always nonpositive for γ i (k) ≥ 0.
The optimum scheduling algorithm for the RT users is to find, among all subsets of the set N R , the set that gives the highest objective function of (25).

B. Proposed Algorithm and Proof of Optimality
The exhaustive approach to the scheduling problem is to evaluate the objective function of (25) for all 2 NR possible sets and choose the set that gives the highest objective function. This may be not practical when the number of RT users is large. Observing the approach in the special on-off case and inspired by Theorem 2 that reduces the search space, we provide here a similar approach. We first provide the following definition which is analogous to Theorem 2.
Theorem 6. At slot k, for any set S R (k), if there exists some i / ∈ S R (k) and some j ∈ S R (k) such that Y i (k) > Y j (k) and γ i (k) > γ j (k), then S R (k) cannot be an optimal RT set, with respect to problem (25), for the continuous channel model.

Proof Sketch:
The proof is carried out by contradiction. We can show that if Y i (k) > Y j (k) and γ i (k) > γ j (k) for some i / ∈ S R (k) and some j ∈ S R (k), then we could form another set S ′ (k) by swapping users i and j and thus increase the objective function of (25).
This theorem provides a sufficient condition for nonoptimality. In other words, we can make use of this theorem to restrict our search algorithm to the sets that do not satisfy this property. Before presenting the proposed algorithm, we define the set S RT as the set of all possible subsets of the set N R .

Theorem 7.
For the continuous channel model, if problem 5 is feasible, then for any B max > 0 and any ǫ ∈ (0, 1] there exists some finite constant C 2 such that Algorithm 2 satisfies all constraints in (5) and achieves an average sum throughput satisfying where R * i is the optimal rate for user i w.r.t. (5). Proof. The proof is similar to that of Theorem 3 and C 2 is defined as C 1 but with R max log (1 + P max γ max ). We omit the proof for brevity.
Due to the problem being a combinatorial problem with a huge amount of possibilities, we could not reach a closedform expression for the complexity order of this algorithm. However, simulations will show its complexity improvement over the exhaustive search algorithm.

C. Extensions to Packets with Different Lengths
Let L i (k) be the length of user i's packet at slot k, i ∈ N . It can be easily shown that the power-allocation-and-scheduling for the NRT users and the power allocation for the RT users, namely Lemma 3 and Theorem 4 do not change. That is, replacing L with L i (k) in (27) yields an optimal solution as well. However, there are two possible extensions for the scheduling algorithm for the RT users, namely Algorithm 2. We discuss them next.
Algorithm 2 Lambert-Strict Algorithm 1: Define the auxiliary functions Ψ X (·) : S RT → R + and P X (·, ·) : S RT × N R → R + . 2: Initialize P X (S, i) = 0 for all S ∈ S RT and all i ∈ N R . 3: Find the user i * NR given in (38) and calculate its power given by (37). 4: for S ∈ S RT do 5: if ∃ some i / ∈ S and some j ∈ S such that Y i (k) > Y j (k) and γ i (k) > γ j (k) then 6: Set Ψ X (S) = −∞.

17:
i ← i + 1. 18: end for 19: Set the optimum scheduling set S * R (k) = arg max S Ψ X (S). 20: Set P * i (k) = P X (S * R (k) , i) for all i ∈ N R , and set the NRT scheduler according to (24). 21: For each i ∈ N NR , set r i (k) = a i (k) if Q i (k) < B max and 0 otherwise. 22: Update equations (2), (13) and (14) at the end of the kth slot.

1) Homogeneous RT Users:
This is where all packets of all RT users have the same lengths at slot k but they change (randomly and independently) from a slot to the other. That is, L i (k) = L j (k) for all i and j, but L i (k 1 ) and L i (k 2 ) need not be the same for k 1 = k 2 . This could be the case if all RT users are streaming the same information from the same server, or if their packet lengths change from a slot to the other but are highly correlated across users in the sense that L i (k) = L j (k) is a valid approximation. In this case, Algorithm 2 is still optimal since it solves problem (25) which is a per-slot optimization problem, namely, it is not affected with the packet lengths at preceding and succeeding time slots.
2) Heterogeneous RT Users: This is where the packet length changes significantly from a user to the other in addition to its change (randomly and independently) from a slot to the other. In this case, the scheduling algorithm of the RT users proposed in Algorithm 2 is suboptimal. In order for the algorithm to be optimal, Steps 5 through 8 of the algorithm need to be removed. That is, the algorithm goes over all subsets of the set N R . The complexity of the optimal algorithm is exponential in the number of RT users. However, suboptimal algorithms could still be developed. One example is to modify Step 3 of Algorithm 1 by sorting the users according to a decreasing order of Y i (k)γ i (k)/L i (k). Consequently, this yields an algorithm of a linear complexity in N R . The sorting according to Y i (k)γ i (k)/L i (k) stems from the fact that RT users with higher Y i (k) and γ i (k) and lower L i (k) should be more favored to be scheduled.

VI. CAPACITY REGION
In Section V, Algorithm 2 is shown to maximize the NRT sum-throughput subject to the system constraints. In this section we want to study the stability of the system. Specifically, we are interested to answer the following two questions: 1) What is the capacity region of the system under the continuous fading model? 2) What scheduling and power-allocation algorithms can achieve this capacity region?
Studying the system's capacity region means that we need to find all arrival rate vectors λ NR under which the NRT users' queues are stable (i.e. have a stationary distribution). This needs to be studied assuming that all arriving packets are admitted to their respective buffers. Hence we first eliminate the admission controller r (k) by replacing the queue equation (2) with More formally, the first question now becomes: what is the closure of all admissible arrival rate vectors? An admissible arrival rate vector is defined next.
Definition 4. An arrival rate vector λ NR [λ i ] i∈NNR is said to be admissible if there exists a power-allocation and scheduling algorithm under which constraints (7) and (8) are satisfied given the power and scheduling constraints (9)- (12).
For simplicity we henceforth assume that the channel gain γ i (k) ∈ M where M is a discrete finite set, the elements of which are in the range [0, γ max ]. With a slight abuse in notation, we define γ i (m) γ i (k) to be the gain of user i when the channel is in fading state m [γ 1 (m), · · · , γ N (m)] T ∈ M N during slot k. We also define µ i (m, k) and P i (m, k) to be, respectively, the duration and power allocated to user i ∈ N when the channel is in fading state m [γ 1 (m), · · · , γ N (m)] T ∈ M N during slot k, and π m to be the probability of occurrence of fading state m. We now mention the following definition then state Theorem 8 that answers the first question.
Proof. See Appendix B Theorem 8 says that R Lamb is in fact the system's capacity region. This answers the first question. Moreover, the second question is answered in the proof, as shown in Appendix B. In the proof, we show that with a simple modification to Algorithm 2 we can achieve this capacity region. The modification is by setting r i (k) = a i (k) for all i ∈ N NR .

VII. SIMULATION RESULTS
We simulate the system for the on-off channel model as well as the continuous channel model. For both models, we assume that all channels are statistically homogeneous, i.e. γ i = γ for all i ∈ N where γ is a fixed constant. Moreover, all RT users have homogeneous delivery ratio requirements, thus q i = q for all i ∈ N R for some parameter q. All parameter values used in the simulations are: L = 1 bits, P max = 20 and γ i = 1.
We compare the throughput of the RT users, which is the objective of problem (5), to that of a simple power allocation and scheduling algorithm that we call "FixedP" algorithm. In the FixedP algorithm, all scheduled users transmit with the maximum power, i.e. P i (k) = P max for all i ∈ N and all k ≥ 1, while the scheduling policy is to flip a biased coin and choose to schedule either the NRT users or the RT users. The coin is set to schedule the RT users with probability q (the delivery ratio requirement for all users), at which case the RT users are sorted according to Y i (k) and scheduled one by one until the current slot ends. On the other hand, when the coin chooses the NRT users, the FixedP policy assigns the entire time slot to the NRT user with the longest queue.

A. On-Off Channel Model
We assume that we have N = 20 users that is split equally between the RT and NRT users, i.e. N R = N NR = 20. Fig. 3 shows a substantial increase in the average rate of the proposed algorithm over the FixedP algorithm with over 200% at low P avg values and 60% at high P avg values. We simulated the system with B max = 10 4 , T = 1 and q = 0.3.
In Fig. 4, the sum of average NRT users' throughput is plotted while keeping P avg = 10 but changing q. We can see that the FixedP algorithm results in a large degradation in the throughput compared to Algorithm 1 which allocates the power and schedules the users optimally with respect to (5). The decrease in the throughput observed in both curves of Fig.  4 is due to the increase in the parameter q. This increase makes constraint (8) more stringent and thus decreases the feasible region decreasing the throughput.
In Fig. 5 we show the effect of increasing the number of users on the system's throughput. As the number of users increase, more RT users have to be scheduled. This comes at the expense of the time allocated to the NRT users thus decreasing the throughput for the two plotted algorithms.

B. Continuous Channel Fading Model
In this simulation setup, we assume the channels are fading according to a Rayleigh fading model with avg power gain of γ = 1. In Fig. 6, we plot the complexity of the Lambert-Strict algorithm as well as the exhaustive search algorithm with exponential complexity versus the number of users N R . The complexity is measured in terms of the average number of iterations, per-slot, where we have to evaluate the objective function of (25). Since this complexity changes from a slot to the other, we plot the average of this complexity. As the number of users increases, the Lambert-Strict algorithm has an average complexity close to linear. However, the there is no sacrifice in the throughput of the NRT users. This is shown in Fig. 7. The reason stems from the optimality of the Lambert-Strict algorithm that does not eliminate any RT users from scheduling unless it is a suboptimal user. We note that we simulated this system with B max = 100, T = 5, P avg = 10 and q = 0.9.

VIII. CONCLUSIONS
We discussed the problem of throughput maximization in downlink cellular systems in the presence of RT and NRT users. We formulated the problem as a joint power-allocationand-scheduling problem. Using the Lyapunov optimization theory, we presented two algorithms to optimally solve the throughput maximization problem. The first algorithm is for the on-off channel fading model while the second is for the continuous channel fading model. The power allocations for both algorithms are in closed-form expressions for the RT as well as the NRT users. We showed that the NRT power allocation is water-filling-like which is monotonically increasing in the channel gain. On the other hand, the RT power allocation has a totally different structure that we call the "Lambert Power Allocation". It is found that the latter is a decreasing function in the channel gain.
The two algorithms differ in the complexity of the adopted scheduling policies. The first algorithm has a linear complexity while the second is shown, through simulations, to have a close-to-linear complexity. We presented the capacity region of  the problem and showed that the proposed algorithms achieve this region.

APPENDIX A PROOF OF THEOREM 3
Proof. We divide the proof into two parts. First, we show that the virtual queues are mean rate stable. This proves that constraints (8) and (9) are satisfied. Second, through the Lyapunov optimization technique we show that the drift-minus-reward term is within a constant gap from the performance of the optimal, genie-aided algorithm [22], [23].
1) Mean Rate Stability: According to (22), Algorithm 1 minimizes Ψ(k) where the minimization is taken over all possible scheduling and power allocation algorithms including the optimal algorithm that solves (5). We define Ψ * (k) min Ψ(k). Thus we can write Ψ * (k) ≤Ψ(k) whereΨ(k) is the value of Ψ(k) evaluated at the optimal algorithm and is given bỹ whereP i (k),μ i (k),1 i (k) andR i (k) satisfy (33), (34) and (35). Taking E [·] to (49), summing over k = 0 · · · K − 1, dividing by K, taking the limit as K → ∞ and using (33), (34) and (35) gives Evaluating by Algorithm 1 in the right-side of (16), and taking E [·] with respect to U(k) to both sides gives Removing the two summations on the left-side of (51), summing over k = 0 · · · K − 1, dividing by K then taking the limit as K → ∞ yields where inequalities (a) and (b) in (52) follow from the inequality Ψ * (k) ≤Ψ(k) and (50), respectively. Jensen's inequality says that E [X(K)] ≤ E X 2 (K) . Dividing by K 2 , taking the square root, passing K → ∞ and using (52) completes the mean rate stability proof. Similarly we can show the mean rate stability of Y i (k).
2) Objective Function Optimality: Evaluating the righthand-side of (19) at the optimal policy that has a genieaided knowledge of the optimum reward r i (k) = R (opt) i we get ∆(k) − B max i∈NNR E U(k) [Lr i (k)] ≤ C 1 +Ψ(k) − B max i∈NNR R (opt) i which is similar to equation (20) in [18]. The optimality proof continues along the lines of Theorem 2 in [18].

APPENDIX B PROOF OF THEOREM 8
Proof. We divide our proof into two parts. In the first part (Achievability), we show that if λ NR is strictly within the region R Lamb , then the queues can be stabilized. And the algorithm that stabilizes these queues is a modified version of Algorithm 2. We show this using the Lyapunov optimization technique [24, pp.120]. In the second part (Converse), we show that if λ NR / ∈ R Lamb , then there exists no algorithm that guarantees the stability of the NRT queues.

1) Achievability:
We will show here that the following inequality holds under Algorithm 2 which is the key to the proof.
where B i (k) µ i (k) log (1 + P i (k) γ i (k)). Once this inequality is proven, the rest of the achievability proof works similar to Theorem 5.3.2 in [24, pp.120]. Since λ NR (1 + ǫ) ∈ R Lamb , to prove (53) we multiply (43) by λ i , (44) by λ i , and (46) by (−P avg ), then add the three inequalities after summing the first over i ∈ N NR and the second over i ∈ N R yielding i∈NNR − i∈N X(k)µ i (m, k) P i (m, k) T π m (55) where D i (m, k) µ i (k) log (1 + P i (k) γ i (k)) while inequality (55) follows since the objective of problem (22) is an upper bound on (55). But since the right-hand-side of (53) can be manipulated to give (62) where the left side of the inequality in (62) follows by evaluating (60) at Algorithm 2 while its right side follows from (56) which completes the proof of (53).

2) Converse:
The converse is done by showing that the upper bound of the sum of the number bits served from all NRT buffers under the best, possibly genie-aided, policy is less than the sum of bits arriving to the NRT buffers if the arrival rate does not satisfy (44) through (48). From the strict separation theorem [24, pp.10], if λ / ∈ R Lamb then there exists a vector β [β 1 , · · · β NNR ] T ∈ R NNR and a constant δ > 0 such that for any vector x ∈ R Lamb the following holds Define H(k + 1) = H(k) + i∈NNR β i (La i (k) − B i (k)) as the weighted sum of the queues where B i (k) µ i (k) R i (k) is the number of bits transmitted to user i at slot k. Hence we have Define the set K K (l) {k : m(k) = l, 0 ≤ k < K} we can bound the second term in (64) as follows i∈NNR β i lim sup