{'fraction_non_alphanumeric': 0.044158533545529496, 'fraction_numerical': 0.009318735259716602, 'mean_word_length': 4.256399919371095, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Towards Effective Resource Procurement in MEC: a Resource Re-selling Framework

On-demand and resource reservation pricing models have been widely used in cloud computing, catering to different user requirements. Nevertheless, in Multi-Access Edge Computing (MEC), as the edge has limited resources compared to the cloud, on-demand users may not get their jobs served on time, or at all, if too many resources were reserved by reservation plan users. Concurrently, reservation plan users may possess excess un-utilized quota. To optimize this resource mismatch scenario, we propose a Sharing Quota Model (SQM) where reservation plan users can re-sell unused resource quota to on-demand users, with the mobile network operator (MNO) taking a commission. To analyze the user's aggregate behavior at equilibrium and investigate the MNO's incentive of allowing re-selling, we formulate a 3-stage non-cooperative Stackelberg Game. Solving this game, we characterize the optimal strategies of buyers and re-sellers. We show that on aggregate, users' optimal strategies give rise to 4 disjoint regions, dependent on the MNO's prices and supply levels. Based on this, we characterise the MNO's optimal prices for on-demand users. Numerical results show that having both the sharing and on-demand pool gives the MNO an optimal revenue when the on-demand pool's supply is low, and when the MNO's commission is low.


INTRODUCTION
The future Internet-of-things (IoT) in smart cities has an array of exciting applications like augmented and virtual reality, human computer interaction and real-time environmental monitoring. As end-devices have limited processing power, Multi-access Edge Computing (MEC) has been introduced to imbue the network edge with cloud computing capabilities. In MEC, the network edge (e.g. base station or wifi access point) is equipped with an edge server, which users can offload their computing-intensive tasks to [1], [2]. This helps users meet the stringent latency requirements of MEC tasks like augmented reality, intelligent video acceleration and connected vehicle decision making, as the tasks do not need to travel through the core network to faraway cloud data centers, avoiding the wide-area-network (WAN) delay of cloud computing [3].
As computing resources are limited at the edge, researchers have been actively investigating the computation offloading problem, optimizing the allocation of MEC re-sources to different users. [1], [4]- [7]. Besides dealing with the technical challenges of computation offloading, along the road towards implementation of MEC, resource pricing and procurement solutions to optimize revenue [8]- [14] can serve as complementary mechanisms to control user demands for MEC resources and ensure good quality-ofservice despite limited available resources. In cloud computing platforms (e.g. AWS and Azure), the commonly used pricing and procurement models are the On-Demand pricing model (OPM) and the Resource Reservation model (RRM). [15]- [17], as they each cater to the different needs of different types of users. Specifically, in the On-Demand pricing model, users pay to use computing resources, as and when they need it, and they are not required to make any long term commitment [18]. The On-Demand model has also been used in edge computing (e.g., in AWS Local Zones [19] and Juniper [20]). In MEC, it would be suitable for individual mobile users using, for example, virtual reality or mobile gaming applications in a one-off manner; for firms when they have special one-off events in which they put up augmented reality displays or machine learning platforms; or even content providers in regions where they have fewer users and thus more variable demands. In contrast, for the Resource reservation model, users reserve computing resource instances in advance, across multiple timeslots, (e.g. for a year), for a discounted price [21]. This model also has been used in edge computing (e.g., AWS Local Zones [19]) and caters to users (e.g., corporations) who use computing resources in bulk, at periodic and pre-determined timings, and more frequently in general. In MEC, these may include firms behind public augmented reality setups, with a constant need of computing capabilities, or IoT vendors with periodic sensing and data analytical requirements for their IoT networks.
Will such plans be able to optimize both revenue and computing resource allocation in MEC? While edge computing is advantageous latency-wise over clouds through the proximity to end users, unlike centralised clouds where data centers have near-limitless compute resources on demand due to there being thousands of servers [22], MEC involves small-scale data centers placed at the network edge [1], [2]. The server capacity at edge nodes will be limited due to physical constraints [7], and the servers have a lower task processing rate (in CPU cycles per second) as compared to the more powerful servers at the cloud [23]. Therefore, the difficulty which arises from jointly using the On-Demand pricing and Resource Reservation pricing models in MEC is that after the resources are reserved in advance by the Resource Reservation users, there might be fewer resources available for users who buy resources on-demand, as and when they need it. Consequently, the on-demand users may have to wait a longer time for their jobs to be serviced, which may jeopardize the utility of MEC since edge computing jobs tend to be more latency -sensitive than jobs in cloud computing [1], [3], resulting in a lower quality of service (QoS) experienced by users and user demand not being met. Cloud providers complement the on-demand and resource reservation models and monetize excess demand through the use of spot instances, leasing the unused capacity at data centers to users at a discounted price [24]. However, we are unable to consider spot pricing in edge computing because unlike the cloud, there is a lack of spare capacity at the edge. In MEC, the main challenge is not monetizing spare capacity but rather ensuring sufficient capacity for on-demand users. Simply raising the price of resource reservations, and thus reducing the amount of reserved resources, may not suffice as users with long-term usage needs may continue to prefer fixed upfront expenses compared to on-demand expenses that may fluctuate and may be hard to predict.
In light of this, to optimize computing resource allocation in MEC, we consider a mobile network operator (MNO) that owns multiple edge servers. We propose and investigate the possibility of the MNO creating a sharing platform, titled the Sharing Quota Model (SQM), inspired by the ones in the mobile data trading market [25], [26]. In this novel framework, reservation plan users can re-sell their excess reserved quota via the platform to on-demand users, while the MNO collects a commission from transactions. This sharing platform has the potential for a win-win-win situation. Specifically, the on-demand users will be able to attain a higher QoS (lower delay) and a higher probability of getting their jobs served, the reservation plan users will obtain extra income by re-selling their unused resource quota, and the MNO collects a commission from the transaction. Furthermore, the higher QoS and lower delay experience of on-demand users would benefit the MNO in the long run due to higher customer satisfaction. To best integrate the sharing platform with the on-demand pricing and resource reservation models, the following research questions arise: a) How would on-demand users respond to the sharing platform? Would they still buy from the on-demand platform? What would the equilibrium behavior of users at the aggregate level look like? b) Given the users' decisions, what is the impact on the MNO's revenue? Does the MNO have an incentive to create this resource sharing platform? How should it set prices such that revenue is optimized, whilst minimizing the unmet demand of the ondemand users?
To answer the above questions and investigate the feasibility of the sharing platform in MEC computing resource allocation, we formulate a 3-stage non-cooperative Stackelberg Game amongst the MNO, re-sellers (reservation plan users) and buyers (on-demand users). This game characterises the decision making and conflicting incentives of the three parties, with the MNO aiming to optimize its revenue, the on-demand users aiming to maximize their welfare whilst (hopefully) getting their computing jobs served, and the reservation users aiming to maximize the welfare they attain from re-selling their reserved quota. At the first stage of the Stackelberg Game, the MNO selects prices for the quota in both the sharing platform (pool of re-sold quota from reservation plan users) and the original on-demand pool, to optimize its Revenue Maximization Problem (RMP). Next, re-sellers (reservation plan users), decide whether or not to re-sell their reserved resources. This determines the supply of computing resource quota at the sharing pool. Finally, viewing the prices and relative supply, buyers (ondemand users) decide whether or not to purchase resource quota, and from which pool (sharing pool vs on-demand pool) they would like to. Our contributions are summarized as follows: • We explore optimizing resource procurement schemes in MEC. With a direct application of on-demand and resource reservation pricing plans, on-demand users face potentially limited resource availability at the edge, while resource reservation plan users might have reserved excess unused resource quota. Therefore we propose a novel model integrating a sharing platform for the re-selling of unused resource quota.
• To quantify how the MNO, buyers and re-sellers interact in this scheme, as well as optimize the MNO's prices for revenue maximization, we formulate a 3stage Stackelberg Game. In this sequential game, the MNO selects prices to optimize its revenue. Following which, the re-sellers choose whether or not to sell, and the buyers choose which pool (or not) to buy from. We study two platform design optionsautomated re-selling of unused quota, and manual decision making for re-sellers. While the former may be less practical, it nevertheless gives us good insight into the aggregate behavior of buyers in light of the MNO's prices, by isolating the MNO-buyer interaction.
• Using backward induction on the Stackelberg Game, we characterise the buyer's optimal strategies for the above two design options (Proposition 1), and show that depending on the prices and relative supply of the sharing and on-demand pools, there would be 4 distinct regions (Proposition 2: both on-demand and sharing pools coexisting, only on-demand, only sharing, and none at all) at equilibrium. In light of the 4 regions, we optimize the MNO's revenue, and provide insights on the optimal price (Theorems 1 and 2, Corollary 1).
• Finally, we provide numerical results, which show how the system behaves at the optimal point. Our simulation results show that having both the sharing and on-demand pool gives the MNO an optimal revenue when q o , the on-demand pool's supply is low, and when δ, the platform's commission is low.
The rest of this paper is organized as follows. In Section 2, we introduce the related works. In Section 3, we describe the system model. Following which, we formulate the Stackelberg Game in Section 4. In Section 5, we present the game analysis and insights. Finally, we present numerical results in Section 6, discuss future areas of investigation in Section 7 and conclude this paper in Section 8.

RELATED WORKS
Researchers have been actively investigating optimizing the allocation of MEC resources across users and tasks, while balancing the user's delay requirements with minimizing the energy consumption, under various scenarios [4]- [7]. Another line of work is collaborative edge computing to maintain the quality of service for users in light of user mobility. This involves strategies like VM or service migration across base stations [14], [27]- [29] and user association optimization [30].
Besides, towards the implementation of MEC systems there is a need to investigate optimizing revenue while maintaining the quality of service for users (delay, job service rate, etc) [8]- [13]. For example, [8] used the Fisher market model to model the MEC market, where services are buyers. [9] jointly optimized over the resource prices and the devices' budget allocation strategies to maximize system utility. [10] modelled a dynamic game characterising the interaction between the edge resource owners, infrastructure providers, and service users. While our model follows the user payoff model of [10], nevertheless we are modelling a distinct scenario, involving a novel hybrid sharing, on-demand and resource reservation framework. Thus, unlike [10] we must further account for re-seller incentives, leading to distinct results. To the best of our knowledge, there has not been work on improving the integration of the on-demand and the resource reservation pricing models in MEC.
Maximizing revenue in cloud computing by improving on the on-demand and reserved instance models was studied in [17], [31]- [33]. These works focused on spot instances, which use the spare capacity at data centers, purchased at discounted prices [24]. For example, [17] proposed a truthful auction for spot instances, to prevent dishonest users. [31] proposed a dynamic pricing policy for spot instance prices using a finite horizon stochastic program to balance future and present pricing. [32] formulated a capacity segmentation revenue maximization problem, splitting the resources amongst on-demand, reserved instances and spot pricing models. The above works focused on spot instances and unutilized capacity at data centers. Unlike in cloud computing, the edge server has limited resources for the spot instance model to be used, and therefore we propose a platform for the re-selling of reservation plan users' unused quota to optimize revenue and resource utilization.
The mobile data market has seen the existence of platforms (e.g. China Mobile Hong Kong's 2nd exChange Market) which provide a secondary data market, allowing users to buy and sell data from each other [25], [26]. These works [25], [26], [34] perform a game theoretic analysis to characterise the equilibrium and optimal decisions under various scenarios, as well as propose alternative platform designs [35]. Nevertheless, they study a scenario distinct from the edge computing market -here all the users buy resources under the same scheme (monthly data plans with usage quotas), unlike in the computing resource market where there is the availability of the on-demand and resource reservation models which lease resources at different timescales.

THE RESOURCE PROCUREMENT MODEL
We consider an edge MNO that provides edge computing service to N users. The MNO has 2 resource procurement schemes for users to choose from, namely the Resource Reservation Model (RRM) and On-Demand Pricing Model (OPM). inspired by cloud pricing schemes [15]- [17], and used in current edge pricing schemes [19], [20]. Under OPM, the users purchase credits to offload their jobs at the edge servers "on the go", as and when they need it. They pay p o per unit of resource consumed (CPU cycles), to the MNO. Customers of on-demand pricing could include individual mobile users, e.g. users of applications like AR/VR or mobile gaming, or firms who are using AR or machine learning applications for one-off special events or displays. These users' demand for computing is sporadic, not following a consistent usage pattern across timeslots.
The RRM is catered to customers who have consistent computing requirements across different timeslots. The RRM allows them to reserve (i.e. commit to) computing resource in advance across multiple timeslots, e.g. for a year, at a discounted price per timeslot of p r . Customers of the reservation plans include users who use computing resources in bulk, at periodic timings, and more frequently in general. For example, these may include IoT vendors with constant sensing and data analysis requirements for their large IoT network, autonomous driving firms, entities behind long-term public augmented reality setups.
We assume that the user has chosen between the resource procurement schemes OPM and RRM based on its application's usage requirements: sporadic, one-off vs consistent, frequent and long-term. The details of the user usage model will be in covered the following subsections. The computing resources at the edge server are first provisioned to the reserved users, with the remaining resources forming the on-demand pool.
Nevertheless, unlike cloud resource allocation where data centers have huge amount of computing resources, the server capacity at edge nodes is limited [1], [2], and the data processing rate is less powerful [23]. Hence, after resources are reserved in advance by RRM users, there might be less resources left for on-demand users. At the same time, RRM users may find that for specific timeslots, they have excess computing resource quota (for CPU cycles) which they do not require. In this work we propose and explore the impact of adding a resource sharing scheme, the Sharing Quota Model (SQM). In this integrated scheme (see Figure 1), RRM users act as re-sellers, selling their excess unused resource quota at a price of p r per unit of resource to on-demand users (buyers). The resold resources form the sharing pool and increase the total supply available to ondemand users (buyers). The MNO acts as a middleman and takes a commission of δ from the transaction. We investigate the impact that adding SQM has on the profits of the MNO, and hence whether this scheme is feasible.
Re-sellers: The re-sellers are users who have previously reserved resources from RRM, and who have excess resources available for sale. Under the proposed sharing scheme SQM, they have 2 choices s = {sell, no} in each timeslot. They can choose whether to sell their excess computing resource quota via the MNO's platform to ondemand users (buyers), or not. Without loss of generality, we consider the payoff per unit resource quota for seller i, which is expressed as: Recall that p r is the per unit price set by the MNO for the transaction, and define δ as the commission level which the MNO takes from the transaction. We let g i represent the inconvenience cost of selling for seller i (factoring in uncertainty of usage, and the inconvenience of checking the app to decide to share). In this paper, we consider per unit resources in the payoff functions of both buyers and re-sellers. Buyers and re-sellers with multiple units can be considered as multiple buyers or re-sellers. Note that if we had considered users buying/re-selling distinct quantities of resources, with the resource usage level of users following U [0, 1], the impact would be that the supply and revenue functions are multiplied by a constant factor.
The inconvenience cost depends on the extent to which each re-seller is willing and able to expend time, energy and resources to periodically check the app, factor in the uncertainty of personal usage, and decide whether or not to sell the excess resource quota. This differs across different vendors and owners, and differs across applications. g i is a random variable which follows the uniform U [0, 1] distribution, as it captures the varying levels of personal costs across the users. While the distribution has an impact on the way revenue is computed, we perform simulations using both uniform and beta (which has a gaussian-like structure) distributions in Section 6, showing similar results across distributions.
As we can see from Eq. (1), a seller's decision will be impacted by the price p r , the commission level δ, and the inconvenience cost g i . Seller i will share/sell when its profit (1 − δ)p r is greater than its cost g i . To obtain the total proportion of re-sellers willing to sell/share, we integrate over the users whose inconvenience cost g i is less than or equals to (1 − δ)p r . As g i follows the uniform U [0, 1] distribution, the proportion of re-sellers willing to share/sell will be: The quality of the sharing pool, q s , indicates the total supply of resource quota available for buyers, and therefore is dependent on the proportion of re-sellers who are willing to share their unused quota, (1 − δ)p r . The quality (i.e. supply) has an impact on the utility the buyer receives from the sharing pool because the higher the quality (i.e. supply) of the pool, the higher the likelihood the buyer is able to get quota for job computation from the pool. It can be expressed as 1 : with q s (p r ) being a strictly increasing, twice differentiable and concave function.

Buyers:
The buyers are on-demand users who purchase quota to offload their jobs at the edge servers on the go, i.e. not in advance. As mentioned above, users, device owners and vendors in MEC have various applications such as AR/VR, mobile gaming, human computer interaction, IoT smart city sensors, intelligent vehicles. These buyers send their computing jobs to the edge server, with different willingness to pay (represented by u i for user i). The willingness to pay is the buyer's utility of job computation at the edge server. For example, some jobs are more urgent and considered more of a necessity than others (e.g. public AR/VR displays, autonomous vehicle computation), and therefore the buyers will still be willing to pay despite the price p r increasing. On the other hand, some jobs are considered less urgent, or are not viewed as necessities from the buyer's perspective, resulting in a lower willingness to pay: given a high price of resource quota p r , the buyer is more likely to choose not to purchase the edge computing service. We let u i follow the uniform U [0, 1] distribution, to represent how the willingness to pay differs across users. Note that the distribution does not have an impact on the payoff maximizing strategies of the buyers, or the equilibrium outcome of user decisions in light of fixed prices. While it has an impact on the way revenue (Eq. (6)) is computed, we perform simulations using both uniform and beta distributions in Section 6 which show similar results across distributions. 1. Function qs(pr) may have various forms in realistic MEC systems, but our analysis permits any functional form. We will discuss a concrete form for numerical results in Section 6. The inconvenience cost of re-seller i. δ The MNO's commission percentage. pr Price per-unit of re-sold quota at the sharing platform. po Price per-unit resource at the on-demand pool. qo Supply, and hence quality at the on-demand pool. qs (pr) Supply and hence quality at the sharing platform.
Revenue of the MNO.
Under SQM, these on-demand users now have 3 options b ∈ {on-demand pool, sharing pool, none}. 2 Note that, b = none means not buying from both the on-demand pool and sharing pool. Therefore the payoff of buyer i is: where u i is buyer i's willingness to pay for a unit resource quota, as described earlier and used in [10]. The payoff when users choose the on-demand and sharing pool respectively is their willingness to pay (satisfaction) u i multiplied by the quality/supply of the pool (q o or q s ) minus the payment (p o or p r ). The quality/supply (q o or q s ) indicates the relative supply of resources available at the ondemand and sharing pool respectively. The quality at the on-demand pool, q o , is the amount of supply of computing resources (in CPU cycles) at the on-demand pool, after the resource reservation users have reserved their portion. 3 As mentioned earlier, the quality at the sharing pool, q s (p r ), is a function of the proportion of re-sellers who are willing to resell. The higher the quality (supply) at each pool, the higher the likelihood the buyer is able to get its request served at that pool, and therefore the buyer's payoff π b i (u i ) is an increasing function of the quality q s (p r ) or q o . As different buyers have different willingness to pay u i , different buyers will make different choices, based on which choice maximizes their individual payoff. Our model is not meant to perfectly capture each individual user's actions, but rather give an approximation of these actions which is accurate on an aggregate level across all users, hence allowing us to model the equilibrium behavior and the optimal decisions for the MNO to make. We summarize the key notations used throughout this paper in Table 1.

PROBLEM FORMULATION
The MNO's objective is to optimize its revenue, when integrating the sharing scheme SQM with the existing pricing models. Its Revenue Maximization Problem (RMP) is: 2. For simplification, we use b = o, b = s, and b = n to represent b = on-demand pool, b = sharing pool, and b = none, respectively.
3. Note that in traditional centralised cloud computing, the supply at data centers (i.e. the qo equivalent) would be much larger in magnitude. where In Eq. (6) To analyse the strategic behaviours and the dynamic interaction amongst the three parties and to obtain equilibrium insights, we formulate a non-cooperative Stackelberg Game [36] (Fig. 2). In Stage 1, the MNO (the leader) sets the on-demand and sharing pool prices p o and p r , to maximize its revenue R(p r , p o ), as in Eq. (7). In Stage 2A, given p r and δ, the re-sellers (followers) individually decide s, whether they would like to share or not. A re-seller's decision depends on which choice maximizes their individual payoff π s i , following Eq. (8). The collective decision of all re-sellers would result in a supply/quality of q s (p r ) for the sharing pool, which would influence the decisions of the buyers in Stage 2B. In Stage 2B, given the prices p r and p o , and the supply/qualities q s (p r ) and q o , the buyers (followers) individually decide b, which pool they would buy from. A buyer's decision depends on which choice maximizes their individual payoff π b i , as presented in Eq. (9). The decisions of the followers (the re-sellers and buyers) would in turn affect the revenue of the leader MNO.

GAME ANALYSIS
In this section, we solve the Stackleberg Game (Eqs. (7), (8) and (9)), and present insights and analysis on the equilibrium outcome. We analyze two distinct platform designs which the MNO could implement for the re-selling portion of the sharing platform. Firstly, in Section 5.1, we explore the option where the MNO implements automatic re-selling of unused resource quota on the part of users. While this may not be as feasible in practice given that the MNO may not know which re-sellers have excess quota, nevertheless, this portion of the study gives insights on buyer decisions and the aggregate outcome at equilibrium in light of MNO prices, by isolating the MNO-buyer interaction. In Section 5.2 we explore the option where the MNO implements manual decision making for re-sellers: re-sellers weigh their personal inconvenience cost g i when deciding whether or not to re-sell quota in the sharing pool, according to Eq. (1).

Case 1: Automatic Re-Selling of Unused Quota
In this subsection we analyze the scenario where the MNO implements automatic re-selling of unused resource quota on the part of re-sellers.
As there is no decision making on the part of re-sellers, we have q s (p r ) as a constant q s . The resulting game between the MNO and the buyers is:

The buyer's optimal strategies
We solve this game by backward induction [36], solving Stage 2 first, and using the equilibrium outcome of Stage 2 to solve Stage 1 and obtain the MNO's optimal prices. Buyers try to maximize their payoffs π b i by choosing whether they will buy computing resource quota from the on-demand pool, the sharing pool, or not buy at all, given the prices p o , p r , and the relative supply q o and q s . Proposition 1 shows which strategies buyer i will take, given its willingness to pay u i .

Proposition 1.
For given values of prices (p o , p r ) and quality/supply (q o , q s ), the payoff maximizing strategy for buyer i will be: Proof: We compare π o i (µ i ), π s i (µ i ), and 0, and find the conditions under which each strategy maximizes buyer i's payoff. When π o i (µ i ) is the largest, we have b = on-demand pool. When π s i (µ i ) is the largest, we have b = sharing pool. Otherwise, b = none.
Note that Prop. 1 is independent of the distribution of u i , users' willingness to pay. Fig. 3 provides a geometric description of Proposition 1 (Prop. 1a in particular). For example, if q s > q o (corresponding to Prop. 1a), and when u i satisfies po qo < u i ≤ pr−po qs−qo , we can see from Fig. 3a that the buyer's payoff from the on-demand pool would be positive and higher than that from the sharing pool. Hence, the buyer with u i satisfying po qo < u i ≤ pr−po qs−qo would choose the on-demand pool. Proposition 1 shows that buyers with higher willingness to pay u i will choose the option with higher quality/supply (q o or q s which is the gradient of all the payoff graphs in Fig. 3), as we can see in all three graphs. For an example, we look at the case where q s > q o in Fig. 3. Users with higher u i choose the sharing pool when p r − p o ≤ 0 (Fig. 3c), and also when 0 ≤ pr−po qs−qo ≤ 1 (Fig. 3a). Nevertheless, we see that when the price p r for the sharing pool is too high such that pr−po qs−qo > 1 (Fig. 3b, where pr−po qs−qo is the intersection of the two graphs), none of the users will choose the sharing pool even with q s > q 0 . In the special case where q s = q o (Proposition 1c), the qualities/supply of the two options are the same. Geometrically, this means that the gradients of the two payoffs will be the same. If the on-demand pool has a higher price (p o > p r ), the buyers will choose the sharing pool, and vice versa. When the buyers's willingness to pay is low (u i < min( pr qs , po qo )), the buyer will choose neither.

The MNO's price selection strategy
Following the buyers' optimal selection strategies (Proposition 1), and integrating over the collective behavior of all of the buyers, there will be 4 regions at equilibrium, with boundary conditions as functions of q o , q s , p o and p r . These 4 regions correspond to the 4 scenarios of whether users will choose the sharing and/or on-demand option, or choose not to buy at all. In Proposition 2, we characterize these 4 regions.

Proposition 2.
For given values of prices (p r , p o ) and quality/supply (q s , q o ), the equilibrium will satisfy exactly one of the following 4 conditions: where (a) + = a if a ≥ 0, and 0 otherwise. In R1, buyers buy from both pools or neither, like in Fig. 3a. In R2, buyers buy from the on-demand pool or from neither, as in Fig. 3b. In R3, buyers buy from the sharing pool or from neither, as in Fig. 3c. In R4, buyers will buy from neither pool.   3. Illustrations of buyers' payoff, and therefore the decision they make, at different willingness to pay, with qs > qo.
Proof: The boundary conditions of the four regions are deduced through Fig. 3.
Prop. 2 is independent of the distribution of u i , users' willingness to pay. This proposition indicates how the relative magnitudes of the prices p r , p o , and supply q s and q o impact the equilibrium outcome. Specifically, when (p r , p o , q s , q o ) satisfies the boundary conditions of one of the regions, the collective behavior of buyers (who behave according to Proposition 1), will result in the equilibrium outcome being in that region. For example, when the prices p o and p r satisfy the conditions p o < q o , p r ≥ min( qs qo , 1)p o + (q s − q o ) + , it will not be incentive compatible for any buyers to choose the sharing pool (regardless of u i ), and the outcome is R2. The special case when q s = q o in Proposition 1 also fits this 4 region framework. If 1 < min( pr qs , po qo ), the users will choose not to buy and the resulting scenario will be R4. In the alternative where 1 < min( pr qs , po qo ) does not hold, if the on-demand price is higher (p o > p r ) the users will choose the sharing pool and we end up in R3, and vice versa for R2.
With the 4 disjoint regions involving different pools being purchased from (Proposition 2), the revenue function R(p o , p r ) can be simplified as follows: In R1, buyers are willing to buy from both the on-demand and sharing pool. The two terms in the objective R R1 (p o , p r ) correspond to the revenue obtained from the two pools. In R1 with q s ≥ q 0 , ( pr−po qs−qo − po qo ) and 1 − pr−po qs−q0 are the proportion of the buyers who choose the on-demand and sharing pool respectively. In R4, buyers find it optimal to not purchase from either pool, and hence the MNO's revenue is 0.
Therefore, to optimize the revenue maximization problem, we will split the problem into four subproblems as follows: max For subproblem R R1 (p o , p r ), we further split it into 2 subproblems R R1a (p o , p r ) and R R1b (p o , p r ) corresponding to the 2 cases where q s ≥ q o and q o > q s . In the following, we give Theorem 1 to characterise the optimal prices p o and p r . Theorem 1. When buyers make decisions according to Proposition 1, given a fixed (q o , q s ), and if the condition (δ + 1) 2 q s < 4δq o holds, the MNO's optimal prices will be as follows.
• To maximize R R1a (p 0 , p r ) in R1, we have: If Eq. (15) is satisfied Else, Else, . Note that, in the latter two cases, a is any price p r which satisfies the boundary conditions of R2 (Eq. (16)), and b is any price p o which satisfies the boundary conditions of R3 (Eq. (17)).
Proof: See Appendix 1. In Theorem 1, (δ + 1) 2 q s < 4δq o is the condition under which the Hessian of R1b's objective has negative eigenvalues, and hence the condition under which subproblem R1b is convex. We use the KKT conditions to solve the problem. For subproblem R1a, the gradients are 0 at p * o,1a = 2δqo(qo−qs) 4δqo−(δ+1) 2 qs and p * r,1a = qs(δ+1)(qo−qs) 4δqo−(δ+1) 2 qs . If this point is within the boundary conditions, it is the optimal point. If it is not, the optimal point would be at one of the boundaries (with regions R2 or R3), specifically being ( qo 2 , q s − qo 2 ) (boundary with R2) or ( qo 2 , qs 2 ) (boundary with R3). Likewise for subproblem R1b. For subproblems R2 and R3, the optimal solutions of p * o,2 = qo 2 and p * r,3 = qs 2 hold at the boundary as well. These optimal prices agree with intuition, that as the quality/supply (likelihood of buyer getting service) q o (or q s ) increases, the MNO can increase the price to increase its revenue.

Case 2: Re-sellers weigh inconvenience cost when deciding to re-sell quota
In this subsection, we analyse an alternative platform design in which the MNO implements manual decision making for re-sellers: re-sellers weigh their inconvenience cost g i when deciding whether or not to re-sell quota in the sharing pool, according to Eq. (1). As mentioned in Section 3, the inconvenience cost g i factors in the re-seller's uncertainty of usage during the timeslot, and the inconvenience of checking the app to decide. It differs across users and applications as it depends on the extent to which each application vendor (or individual device owner) is willing and able to expend time, energy and resources to periodically check the app, factor in uncertainty of usage and decide whether or not to sell the excess resource quota at the current time. Here g i follows the uniform U [0, 1] distribution as it captures the varying levels of inconvenience across users. In Section 6, we perform simulations using both uniform and beta (which has a gaussian-like structure) distributions, showing similar results across distributions.
Under this scenario, we solve the Stackelberg Game (Eq. (7), (8) and (9)). Firstly, in Stage 1 the MNO decides the prices p r and p o . Following which, in Stage 2A the re-sellers decide whether they want to sell their excess resource quota, based on what maximizes their payoff (Eq. (1)), resulting in a quality/supply of q s (p r ). Finally, in Stage 2B, the buyers would make a decision, aiming to maximize their individual payoffs (Eq. (4)), given the values of (p r , p o , q s (p r ), q o ). We solve the Stackelberg Game by backward induction, solving Stage 2 first, and using the equilibrium outcome of Stage 2 to solve Stage 1 and obtain the MNO's optimal prices.

The re-seller's optimal strategy
The following Proposition shows the re-seller's optimal strategy. Proposition 3. For given p r , re-seller i with inconvenience cost g i 's optimal strategy would be: Collectively, by Eq. (2) this results in a proportion (1 − δ)p r of re-sellers being willing to rent out their unused resources and therefore following Eq. (3), the total quality/supply of the sharing pool will be which is a function of price p r .

The buyer's optimal strategy
Given (q s (p r ), q o ) and (p r , p o ), a buyer's strategy would still follow Proposition 1 in Section 5.1, with the substitution of q s by q s (p r ). Hence, their collective strategies would form distinct regions R1 to R4 at equilibrium, where the four regions indicate whether or not the sharing and/or ondemand pools are feasible. This is according to Proposition 2 in Section 5.1. Once again, the only difference is that q s is replaced by q s (p r ).

The MNO's optimal price
Given the strategies of the re-sellers and buyers in Stages 2A and 2B, corresponding to the regions in Proposition 2, the MNO's revenue maximizing problem R(p o , p r ) can be split into the following subproblems.
and R R4 C2 (p o , p r ) is a constant of 0, corresponding to R4 in Proposition 2 (where users choose neither the on-demand nor sharing pool). Other than R4, the other regions are considered with two subproblems which correspond to the disjoint cases q s (p r ) ≥ q o and q o > q s (p r ). This allows us to replace the terms involving min() and () + . For example, R R1a C2 (p o , p r ) and R R1b C2 (p o , p r ) both correspond to the situation when we are in R1 (where at equilibrium, buyers choose both to buy from the on-demand pool and the sharing pool). They differ depending on whether q s (p r ) ≥ q o or not.
The subproblems are not jointly convex with respect to p o and p r . Hence, with p r and q s (p r ) given, we optimize with respect to p o to attain insights on the MNO's optimal price in R1 and R2. The MNO's revenues in R3 and R4 are not related to p o (since no users buy from the on-demand pool) and are constant with p r and q s (p r ) given.

Theorem 2.
Given (p r , q s (p r )), the MNO's optimal on-demand price p * o at each region is given by: qs(pr) are points on the region boundaries.
Proof: See Appendix B. Theorem 2 gives us insights on how the MNO should set the on-demand price p o , given that the other parameters p r and q s (p r ) are fixed. In R1, when users buy from both the sharing and on-demand pool, the price p o at which the gradient of the revenue is 0 is qopr(1+δ) 2qs(pr) for R1a and pr(δ+1)+qo−qs(pr) 2 for R1b. We seperately analyse the cases when qopr(1+δ) 2qs(pr) (the point at which the gradient of the revenue is 0) lies within the region's boundaries, and when it does not. Case 1: , it is the optimal price, as the problem is convex with respect to p o . Likewise for pr(δ+1)+qo−qs(pr) 2 in R1b. These functions indicate that the optimal price p * o increases with respect to the on-demand expected quality (supply) q o and platform commission δ. As the on-demand supply q o increases, the increase in on-demand price p o would not deter users away from the on-demand pool. Likewise, when the MNO's commission δ increases, re-sellers will be deterred from selling their unused resource quota, resulting in a smaller supply at the sharing-pool. With a potentially lower payoff at the sharing pool, the increase in the ondemand price p o would not deter users away from the on-demand pool. At the same time, as the sharing supply q s (p r ) increases, the sharing pool is seen as more attractive to users (due to the potentially higher individual payoff). In light of this, the optimal on-demand price p * o has to decrease. ) do not lie within R1a's (respectively R1b's) boundaries, the optimal points p * o,1a (and p * o,1b ) will lie on the region's boundaries, since the problems are convex. Specifically, the optimal prices will be argmax {B1,B2} R R1a C2 (p o , p r ) (and argmax {B1,B2} R R1b C2 (p o , p r )). In R2, where buyers only choose the on-demand pool, the price p o at which the gradient of the revenue is 0 is qo 2 . We seperately analyse the cases when qo 2 (the point at which the gradient of the revenue is 0) lies within the region's boundaries, and when it does not. Case 1: If p * o = qo 2 lies within R2's boundary (p r ≥ p o + (q s (p r ) − q o ) for R R2a C2 (p o , p r ) and p r ≥ qs qo p o for R R2b C2 (p o , p r ) respectively), it is the optimal on-demand price because the problem is convex with respect to p o . Therefore, the optimal ondemand price is an increasing function of the on-demand pool's supply q o . This indicates that as the supply of the ondemand pool q o increases, the rise in the on-demand price will not deter users away from the on-demand pool. Case 2: If p * o = qo 2 does not lie within region R2's boundaries, the optimal point will lie on the boundary p r = B 1 for R R2a C2 (p o , p r ) and p r = B 2 for R R2b C2 (p o , p r ), respectively. This is because, the optimization problems are convex with respect to p o .
On this basis, we then focus on the joint optimization of p o and p r for the MNO's optimal revenue, which will be the maximum of the revenues across the four regions. According to Corollary 1, the MNO's optimal revenue is calculated as max pr R max (p r ).
Corollary 1. Given (p r , q s (p r )), the MNO's optimal revenue will be where R R3 C2 (p r ) = N p r δ(1 − pr qs(pr) ) is the revenue in R3 (the region where the buyers only choose the sharing pool), if the boundary conditions of R3 (Eq. (17)) were met. And 0 is the revenue in R4 (the region where the buyers choose neither the sharing pool nor the on-demand pool), if the boundary conditions of R4 (Eq. (18)) were met.
Since the optimal on-demand price p * o in R max (p r ) is obtained in Theorem 2, the optimization in (35) can be addressed by using a linear search across p r . In Section 6, we discuss the joint optimization of p o and p r and the resulting insights at the optimal and equilibrium point.

NUMERICAL SIMULATIONS
In this section we provide numerical results on the optimal and equilibrium outcome of the Stackelberg Game (Eq. (7), (8) and (9)). These results give us insights and show the practical implications of integrating the sharing pool with the On-Demand Pricing and Resource Reservation model. In many of our experiments, for each combination of (ondemand supply q o , commission δ, and normalization parameter a), we optimize over the prices (p o , p r ), obtaining the optimal revenue, and hence optimal region.
Firstly, we define a specific form of q s (p r ), which indicates the relationship between the price p r and the resulting quality/supply q s (p r ), as follows: We use a log function, which models the law of diminishing marginal returns [37]. The relative supply/quality (i.e. likelihood of buyers getting their jobs served) of the sharing pool increases as the proportion of re-sellers willing to sell (1 − δ)p r increases. The parameter a is the normalization parameter, normalizing the function of the proportion of resellers log(1 + (1 − δ)p r ) willing to re-sell to a magnitude such that the supply level q s (p r ) is comparable with the supply at the on-demand pool q o . For our numerical simulations, we use Eq. (37) as the specific form of q s (p r ) and set the number of buyers and the number of re-sellers (N ) to be 50. We perform experiments with the willingness to pay u i and the willingness to share g i following the Uniform Impact of the on-demand supply q o on the optimal revenue and region : Firstly, we show how the MNO's optimal revenue and region vary with respect to the on-demand quality/supply q o in Fig. 4a and 4b where we set δ = 0.2 and a = 2. Given that we do not know what is an appropriate normalization parameter which relates the supply function q s (p r ) to the supply of the on-demand pool q o , we set a = 2 first, and later decrease the normalization parameter to a = 1.5. To obtain the optimal revenue and region, we optimize over the prices (p o , p r ), given each combination of (on-demand supply q o , commission δ, and normalization parameter a). For both cases where the resellers' willingness to share and the buyers' willingness to pay follow uniform and beta distribution, it can be seen that for smaller values of q o , i.e., when the on-demand supply is lower, it is more beneficial to supplement buyers with the sharing pool to buy quota for job computation (Region R1). This additional income adds to the revenue of the MNO. Nevertheless, as q o increases, the additional income from the sharing pool does not outweigh the increase in revenue from the on-demand pool N on-demand p o (1 − po qo ), hence Region R2 is optimal.
Impact of the commission δ on the optimal revenue and region: In Fig. 4c, we plot the optimal revenue for the MNO against q o , for different values of commission δ. Conversely, in Fig. 4d, we plot the optimal revenue of the MNO against the commission δ, for different values of q o . In Fig. 4e and f we show the optimal region at equilibrium for different values of δ, (with g i and u i taking values from the Uniform[0,1] and Beta(2,2) distributions respectively). Once again, to obtain the optimal revenue and region, we optimize over the prices (p o , p r ), given each combination of (on-demand supply q o , commission δ, and normalization parameter a). These graphs show that when the commission δ is smallest, it is not profitable to have sharing (hence the optimal region is R2), because the platform does not get much revenue from sharing due to its commission being small. As δ gets larger, it becomes profitable to have the sharing platform (Region R1) due to the increase in commission for the platform and hence revenue N on-demand p o ( pr−po qs(pr)−qo − po qo ) + N share p r δ(1 − pr−po qs(pr)−qo ). On the other hand, for larger δ, the re-sellers will be less likely to choose to re-sell their unused resource quota. This is seen in Eq. (1), as their payoffs are inversely proportional with respect to δ, and in q s (p r ) = a log(1 + (1 − δ)p r ) (Eq. (37)) where the sharing pool's supply q s is inversely proportional to δ. This results in a lower quality/supply sharing pool, and therefore a smaller revenue which the MNO can obtain from sharing, making Region R2 (purely on-demand) optimal at high δ.
Impact of the on-demand price p o on the revenue and region : In Fig. 4g, we show how the revenue varies as the on-demand price p o increases, for given values of q o , δ = 0.2, a = 2, p r = 0.5. As the price increases, the equilibrium region shifts from R2 (purely on-demand) to R1 (both on-demand and sharing) as more buyers choose the sharing platform due to the on-demand price increasing. As the on-demand price increases even further, the region transitions to R3 (purely sharing) due to the on-demand price being too high. Nevertheless, R3 is not optimal for the platform because it only collects a proportion δ of the amount transacted.
Impact of the normalization parameter a on the optimal revenue and region : Given that it is not clear what is an appropriate normalization parameter which relates the supply function q s (p r ) to the supply of the on-demand pool q o , we explore different normalization parameters. In contrast to Fig. 4a, we set a smaller normalization parameter a = 1.5 for Fig. 4h. Once again, to obtain the optimal revenue and region, we optimize over the prices (p o , p r ), given each combination of (on-demand supply q o , commission δ, and normalization parameter a). With a smaller a, a higher price p r comes with a lower quality/supply q s (p r ) relative to q o and therefore a lower payoff for buyers at the sharing pool. Hence, buyers have lower incentive to buy resources from the sharing pool. That is why region R2 (purely ondemand) gives the optimal revenue for all values of q o in Fig. 4h. Nevertheless, although R1's optimal revenue is not the optimal over all regions under this set of parameters, users will still buy from the sharing pool and it's revenue is non-zero, as seen in Fig. 4h.
Analyzing individual buyer payoffs : Finally, we plot individual buyer payoffs (Eq. (4)) at equilibrium conditions in Fig. 4i. As we can see, buyers with lower willingness to pay u i choose neither pool. As their willingness to pay (utility of the job computation) increases, their payoff increases. We can see that for the q o = 0.1 and q o = 0.2 plots, users with high willingness to pay choose the sharing pool, as visualised through the different gradients.
In summary, Figs. 4a to 4i show that under the combination of low δ, low q o , and large a, having the sharing platform (Region R1) is optimal. Besides, it is not optimal to have Region R3 (purely sharing), due to the MNO only being able to take a proportion δ of the revenue N share p r δ(1 − pr qs(pr) ).

FUTURE WORK
For future work, we will study the long-term scenario where users may switch between reserving resources in advance, and buying on the go through the on-demand and sharing pools. Here, another layer would be added to the stackelberg game and users will make decisions based on their expected payoffs in the long run. The expected payoff would depend on the users' application requirements: the probability of them needing job computation at the edge consistently over all timeslots vs one-off and sporadically, the prices set by the MNO and the expected supplies of the different options, which is influenced by the aggregate decisions of other users.
(a) The MNO's optimal revenue and region against on-demand supply qo. δ = 0.2, a = 2, with u i , g i following the uniform U (0, 1) distribution.
(e) The MNO's optimal revenue and region against commission δ. qo = 0.2, a = 2, with u i , g i following the uniform U (0, 1) distribution.
(i) The individual buyer's payoff against willingness to pay u i , δ = 0.2, a = 2. Another line of investigation is to study how the sharing framework can be implemented across multiple edge nodes, with different users being associated with different nodes due to proximity. In light of this, the on-the-go (on-demand and sharing) queues and the sharing supply would differ across nodes. If users are allowed to associate with other nearby nodes, it is thus of interest to investigate how the MNO can jointly price and allocate the resources across nodes to the different users, to maximize revenue and minimize the number of unmet jobs.

CONCLUSION
In this paper we proposed a novel resource sharing platform to enhance the usage of the on-demand pricing and resource reservation models in edge computing. This helps to optimize the scenario where the on-demand users face a limited supply remaining at the edge server, whilst users under the resource reservation model have reserved excess computing resources, by allowing the re-selling of unused resource quota. We formulated a 3-stage Stackelberg Game to investigate the user's optimal strategies and equilibrium behavior, as well as whether the MNO has an incentive to provide such a resource sharing platform. By analyzing the formulated game, we characterised the optimal strategies of the re-sellers, buyers and MNO, and showed that there would be 4 regions (both sharing and on-demand, only ondemand, only sharing, none at all) at equilibrium after buyers' decisions. Based on these 4 regions, we optimized the MNO's revenue and analytically characterised the MNO's optimal on-demand prices. Our numerical results show that having a sharing pool gives the MNO an optimal revenue when the on-demand pool's supply is low and when the platform's commission is low.