Location Optimization for Community Smart Parcel Lockers Based on Bilevel Programming

. With the rapid development of e-commerce and the dramatic upsurge in direct-to-consumer deliveries, the last-mile problem has become increasingly apparent. With the distinct advantages of bringing economies of scale and providing 24/7 contactless self-service, smart parcel lockers play a critical role in solving the last-mile problem. However, due to a lack of planning, myopia expansion, and an ambiguous proft model, smart parcel locker suppliers in China have been sufering huge economic losses, restricting their further development. In the study, on the basis of an in-depth analysis of the cost elements and major revenue sources of smart parcel lockers, we propose a bilevel programming model to optimize the location of community smart parcel lockers with the upper-level model maximizing the proft of a third-party smart parcel locker supplier and the lower-level model maximizing user satisfaction. Ten, a solution algorithm based on the genetic algorithm is proposed. Finally, some numerical experiments are carried out based on a medium-scale residential community in Jiading District, Shanghai. Te sensitivity analyses conducted in this study reveal how the user satisfaction evaluation and the investment budget infuence the expected proft. Te modelling framework and numerical results can provide third-party smart parcel locker suppliers with signifcant theoretical support and practical guidance on planning the investment budget and optimizing the smart parcel locker locations to maximize their proft.


Introduction
In the past decade, the e-commerce market has been growing at an ever-increasing pace. Statistics show that retail e-commerce sales amounted to approximately 4.9 trillion U.S. dollars worldwide in 2021 and are forecasted to grow by 50 percent over the next four years, reaching about 7.4 trillion dollars by 2025 [1]. Tis means a dramatic increase in direct-to-consumer express parcel deliveries. Te last leg of express parcel deliveries to consumers is often the least efcient, the most expensive, and the most polluting stage and has gradually become a hot research topic called the last mile problem [2,3], focusing on improving the efciency and reducing the cost and pollution of the last mile delivery.
Home delivery with time windows was frst proposed and applied by Webvan, the leading e-commerce company in the USA, to help customers get the products in a more efcient and cheaper way in 1999, and then it gradually became the most common means of last-mile delivery in the traditional sense [4], but this solution has some evident drawbacks. Nemoto et al. [5] frst raised the issue that the increasing number of freight vehicles for home delivery brought by B2C e-commerce may aggravate trafc congestion and environmental problems in urban areas. In addition, due to the limitations of the delivery time windows, customers must stay at home. It is worth noting that the length of the time window is inversely proportional to the operating cost of the carrier, i.e., if customers' time window is shortened, the carrier's delivery cost will increase [6]. However, Deforio et al. [7] pointed out that, for parcel deliveries with home delivery conditions, an ideal time window is 2 hours, meaning that a larger time window will not decrease the total cost but a smaller time window will signifcantly infuence the route organization, the number of vehicles required, and thus the total cost. It is challenging to handle the "failed frst delivery attempt" as well, which means that customers fail to respond during the frst delivery attempt and request a second delivery. Mangiaracina et al. [8] pointed out that the probability of failed delivery is one of the negative factors afecting the cost by comprehensively analyzing the cost components of last-mile deliveries. To address this issue, some scholars have studied both route optimization and innovative alternative delivery methods. Florio et al. [9] proposed a set-partitioning model considering the availability of customers during the delivery to minimize the number of expected failed deliveries, and their results showed that the fexibility in maximum route duration implied an increase in hit rate, while scheduled revisits may reduce the expected unsuccessful deliveries by more than 10%. Morganti et al. [10] concluded that parcel lockers and pickup points could improve the success rate of the frst delivery and optimize delivery rounds by analyzing the alternative solutions in Germany and France.
Alternative solutions to the last-mile problem have been studied extensively. Punakivi [4] compared the cost diference between home delivery and reception box or delivery box using simulation with the result that the unattended reception of goods could reduce costs by up to 60 percent. Visser and Nemoto [11] proposed some solutions such as outsourcing of logistics, cooperative delivery services, and optimised routing to cope with the impact of e-commerce on traditional distribution. Te primary version of pickup points was proposed for B2B [12], the version for B2C was frst raised by Feng and Huang [13], and then Augreau and Dablanc [14] conceptualized the proximity reception points. Te authors in [15] presented an empirical simulation approach to compare diferent delivery scenarios by estimating the overall distance, road occupancy rates, and GHG emissions rates with the conclusion that consolidation of home delivery and proximity reception points could lead to signifcant savings. Xu et al. [16] suggested two types of pickup systems incorporating collection and delivery points (CDPs) to deal with the failure of home deliveries. Ten, Wang et al. [17] explored the competitiveness of attended home delivery, reception box, and CDPs in diferent scenarios by calculating the costs based on their respective cost structures and operation efciencies, with the results showing that under normal circumstances, the operation efciency of CDPs was the highest, followed by reception box and then attended home delivery. Arnold et al. [18] proposed a quantitative simulation model to evaluate the operational and external costs of diferent B2C distribution scenarios; their results highlighted that customer self-pickup were highly cost-efcient. Cardenas et al. [19] pointed out that a sufcient number of packages delivered by the pickup point could beneft both the logistics carrier and the society for the reduction of the overall number of vehicle kilometres. Mangiaracina et al. [8] obtained by the overview that CDPs could reduce the probability of failed deliveries. Te above studies show that alternative solutions that rely on user-selfpickup, especially the CDPs, have a huge advantage in solving the last-mile delivery.
CDPs mainly include the shop-in-shop pickup points and smart parcel lockers. Te shop-in-shop pickup points have been widely used in recent years, but customers can only pick up and send out parcels during the business hours of the shop. On the other hand, smart parcel lockers have the distinct advantage of bringing economies of scale and providing self-service postofce 24 hours a day, seven days a week, which can efectively avoid the failed frst delivery attempts and are more environmentally friendly [20,21]. In addition, the "contactless" feature of smart parcel lockers ofers sanitary advantages during pandemics such as COVID-19 [22]. As a result, the market penetration rate of smart parcel lockers has been increasing around the world.
In Germany, DHL developed Packstation in 2001, providing automated booths for self-service collection and dispatch of parcels. As of 2022, more than 8,000 Packstation machines were deployed in Germany, and the number of registered Packstation users/customers reached 8 million in Germany according to the Deutsche Post [22]. InPost, the leading company in the parcel locker industry in Poland, has set up more than 17,000 parcel lockers with more than 7 million registered users/customers. In China, smart parcel lockers such as JingDong and China Post Express Easy frst appeared in the market in 2012. With China's preferential policies, new smart parcel locker companies continue emerging. Currently, the main participants include ecommerce enterprises, courier enterprises, and third-party operation enterprises, and more than 772,000 groups of parcel lockers have been deployed in China as of 2020 [23].
Although smart parcel lockers have evident superiority in solving the last-mile challenges, issues such as high initial investment and operational cost, blind expansion, and vague proft model lead to huge economic losses limiting their development. According to Zhongyan Puhua, the net profts of Fengchao in 2019 and frst quarter of 2020 were 781 million yuan and 245 million yuan, while the net proft of China Post Express were 517 million yuan and 159 million yuan [24]. Moreover, the two smart parcel locker suppliers with the highest market shares in China are facing long-term losses. In practice, we believe that it is the diference between the revenues and the costs that determines the profts, and less costly systems are not more proftable. To compute the profts of smart parcel locker suppliers, not only the cost but also the revenue generated by user demands should be considered. However, to the best of our knowledge, most current location optimization approaches only take the costs or the coverage of parcel lockers into account while lacking consideration for revenues afected by user demands, which do not truly address the actual problem. Terefore, it is of practical and scientifc signifcance to optimize the proft by examining the cost components and the revenue sources. In this study, we aim to propose an innovative model to optimize the locations of residential smart parcel lockers after conducting a comprehensive analysis on cost and revenue components. Its objective is to maximize the proft (total revenue minus total cost) of the third-party parcel locker supplier while appropriately considering the user satisfaction. Te remainder of this paper is organized as follows: Section 2 summarizes the relevant literature on smart parcel lockers. Section 3 presents the bilevel programming model we propose for the location optimization problem of community smart parcel lockers after detailed description of the assumptions and notation used in the paper. Section 4 describes the solution algorithm based on the genetic algorithm (GA). In Section 5, we conduct some numerical experiments and sensitivity analysis. Section 6 concludes the work.

Literature Review
We summarize and analyse the relevant literature on smart parcel location optimization from four aspects: usability or users' preference, cost analysis, user satisfaction, and location optimization.
First, some classical studies on usability or users' preference of parcel lockers are summarized as follows: based on the survey data, Iwan et al. [25] evaluated the usability of parcel lockers from the user perspective, concluded that the parcel locker service was trusted by Polish Company InPost's users, and proposed building parcel lockers in the vicinity of public transport stops or stations. Iwan et al. [25] focused on the analysis of usability and efciency of parcel lockers based on the survey of InPost. Tey concluded that parcel lockers gained increased popularity, and the most critical expectation of parcel locker users was close to home. Kedia et al. [26] interviewed the residents of Christchurch, and their analysis results showed that the factors infuencing residents' acceptance of collection and delivery points (CDPs), could be categorised into several measurements, such as CDP network density, parking availability at CDPs, spatial location of CDPs, proximity to consumers' home or ofce, safe and secure operation, and hours of operation of CDPs. Lachapelle et al. [27] explored the development, site characteristics, and regional location characteristics of parcel lockers in fve South East Queensland cities in Australia and found that the parcel lockers were usually installed near posts, gas stations, arteries in the suburbs, and industrial parks where cars often passed or were parked. Vakulenko et al. [28] investigated the customer perspective of value creation and revealed the elements of customer value that were created with parcel lockers, including four types: functional, emotional, social, and fnancial. Verlinde et al. [29] assessed urban citizens' perceptions of smart parcel lockers. Teir results showed that the most satisfying advantage of parcel lockers was the 24/7 service for customers and that the security should be paid attention to.
Second, some scholars have studied the cost component analysis of smart parcel lockers and compared their costs with traditional delivery options. Te cost elements mainly include the initial fxed cost for the purchase and installation, the land occupation cost, couriers' transport cost, the operating cost, the maintenance and management cost, and the failed delivery cost when customers are absent [30][31][32].
Tere are also some studies comparing the costs of diferent delivery methods. Van Duin et al. [33] presented a model to quantify the delivery cost reduction entailed by parcel lockers compared to traditional delivery options. Seghezzi et al. [32] developed a model to compare the delivery costs of traditional B2C e-commerce home delivery and deliveries through parcel lockers considering both urban and rural areas. Te result shows that home delivery costs are much higher and that it is more proftable to build parcel lockers in rural places than in urban locations. However, there is little research on revenue analysis. Several studies summarized the direct revenue sources of smart parcel lockers, which were broadly divided into fve categories, including delivery fees from charging the courier for the delivery of the package, postage revenues from charging users for package sending, advertisement revenues, overtime penalty charges, and revenues from other value-added services [34,35]. On the other hand, Yuantong Research Institute included some other indirect revenue sources, including labour cost reduction brought by express efciency improvement and website trafc monetization brought by an accurate marketing system, among others [36,37].
Tird, the relevant literature also shows that service quality and perceived value, i.e., user satisfaction, have a direct or indirect efect on the proftability of frms [38,39]. Strauss et al. [22] identifed that the four critical success factors of parcel lockers were location, cost, environment, and user satisfaction. Lai et al. [39] analyzed a survey dataset of 321 consumers in China using structural equation modeling and concluded that timeliness was the strongest predictor that positively impacted user satisfaction with parcel locker services. In 2020, Yang et al. [30] proposed a bilevel programming model for parcel locker location optimization with the upper-level model determining the optimal location by minimizing the planners' cost and the lower-level model giving an equilibrium demand distribution by minimizing the consumers' pickup cost. However, they did not consider revenue in the upper-level model and only considered the total distance-based cost in the lowerlevel model. Tus, when distances are equal, the model will place parcel lockers at the location with less demand, producing less revenue, which conficts with proft maximization and is one of the research problems to be solved in our study.
Fourth, recent studies focus on smart parcel locker location optimization from diferent perspectives. For example, Rohmer and Bernard [40] gave an overview of the facility location problem for parcel lockers, and they pointed out that more attention should be paid to the scheduling and allocation of parcel lockers involving the capacity management of the locker stations. Lagorio and Pinto [41] studied the main factors and variables afecting parcel locker location, including availability, accessibility, safety, environmental impact, costs, delivery times, usage, and regulation, which provides valuable advice on the location of parcel lockers. Deutsch and Golany [21] frst developed a quantitative approach to determine the parcel locker network layout based on the objective to maximize the total proft, consisting of the revenue from customers who used the service, minus the facilities' fxed and operational setup costs, the discounts in the delivery costs for customers who needed to travel in order to collect their parcels, and the loss of potential customers who were not willing to travel for service. Tey set a precedent in the location of smart parcel lockers, while the analysis of the cost components, the revenue sources, and user satisfaction is limited. Tang [42] presented a location selection model based on a gravity method combined with an analytic hierarchy process for smart parcel lockers in colleges and universities. Te study takes the impact of demand numbers into account but lacks consideration of costs and revenues. Huang and Zhang [43] proposed a Dijkstra-based algorithm to optimize the location selection for smart parcel lockers in rural areas by considering the average daily demand, the average daily trafc, and the per capita disposable income. Che et al. [44] proposed a multiobjective model with objectives including maximizing demands that can be satisfed, minimizing the number of demand points simultaneously covered, and minimizing total idle capacity to plan the location of smart parcel locker facilities. Both studies consider the coverage of parcel lockers but do not assess their proftability. Pan et al. [31] presented a bilevel model with the lower level dealing with the facility location problem and the upper level on the vehicle routing problem, which is more suitable for ecommerce or courier enterprises. Schwerdfeger and Boysen [45] studied the dynamic deployment of mobile parcel lockers and worked on optimizing the changing locations of lockers to minimize the locker feet while satisfying all customers. Lin et al. [46] studied a parcel locker location problem and generalized the traditional facility location problems based on the binomial logit model and the multinomial logit model, which used the threshold Luce model to predict customers' likelihood of using the locker service to estimate the revenue. However, among the studies on parcel locker location optimization in the literature, the negative proft issue of smart parcel locker suppliers is hardly addressed, especially from the perspective of third-party parcel locker suppliers. Rabe et al. [47] proposed a model combining an SD simulation model with a facility location problem optimization model, aiming to minimize the total operational cost, and then developed an optimizationsimulation method to solve it. With the objective of minimizing the total cost, Rabe et al. [48] combined facility location, system dynamics, and Monte-Carlo simulation to propose scenarios of evolution and the optimal determination of a network of smart parcel lockers for Dortmund (Germany), on the basis of DHL pickup stations characteristics. Serrano-Hernandez et al. [49] combined a facility location problem with multiagent modelling for a scenario simulation in the city of Pamplona (Spain) to minimize the operational and service costs. Te above studies provide innovative approaches to the location of smart parcel lockers, but lack consideration of the impact of revenue on layout.
In summary, we believe that the following gaps exist in the current studies; frst, most of the existing studies consider the costs of smart parcel lockers, but lack consideration of the revenues, which are also decisive for proft. Moreover, most of the studies ignore the point that, to some extent, users also exist as decision-makers in delivery services. To fll these gaps, we have made the following innovations; frst, we consider both costs and revenues in the model to estimate the net benefts of the suppliers more realistically. In addition, we propose a bilevel programming model to describe the problem, refecting the interactions between smart parcel locker suppliers and users.

Methodology
With the objective of maximizing the proft of the thirdparty smart parcel locker supplier as well as the overall user satisfaction, we propose a bilevel programming model to optimize the location of community smart lockers. Te upper level is to maximize the proft, i.e., the diference between the total revenue and the total cost of the thirdparty smart parcel locker supplier, and the decision variable is the number of parcel locker groups to be built at candidate points. Te lower level's objective is to maximize the overall user satisfaction, and its decision variables is whether a demand point is served.

Assumptions.
To simplify the modelling, some assumptions are made in the study, which are listed as follows: (1) Each demand point represents a group of users/ customers (2) If a demand point is served, all users of the demand point are served (3) Te location information of the candidate supply points and demand points of parcel lockers are given (4) Te annual maximum turnover of the newly built parcel locker is given, and parcel lockers are operated according to the maximum turnover (5) Users at served demand points only collect and send packages at their closet parcel lockers (6) All parcels sent by the courier are assumed to be received by the users (7) All parcel lockers are of the same size (8) Te overall user satisfaction is evaluated by both the travel cost (the distance between the demand point and the parcel locker) and the number of users served (9) Te market competition of parcel locker suppliers is not considered (10) All carriers are willing to use parcel lockers due to economies of scale brought by parcel lockers Regarding Assumption 1, Durand and Gonzalez-Feliu [15] showed how home deliveries and pickup points difer in organization to deal with the same set of customers that the parcels from the same area usually are delivered to one pickup point. Moreover, we consider that the customers of the same building are almost the same distance to the parcel locker. Terefore, we assume a group of customers from a building as one demand point; Assumption 2 is derived from Assumption 1: if a point is delivered, it means that all customers are delivered. In our early work, we obtained information on the geographic coordinates of demand points, existing and candidate parcel lockers points through data crawling, which are usually available, so we make Assumption 3; in order to simulate the reality of a single smart parcel locker limited by its maximum capacity and to obtain the required number of smart parcel lockers under that limit, we set Assumption 4; the Assumption 5 is made to minimize the travelling time and cost of customers and improve users' satisfaction so as to enhance the functional utility of the smart parcel lockers [50,51]; we set Assumption 6 to simplify the delivery and disregard the case where the customer does not come to pick up their parcels; as for Assumption 7, in a standardization viewpoint, we assume the lockers with homogeneous characteristics, and in practice, La Poste or DHL can have lockers of diferent sizes, but in general there are only 2 or 3 diferent sizes, which can lead to a form of simplifcation; the longer the distance, the lower the user satisfaction, moreover, the more needs that are satisfed, the greater the total beneft of the service, which motivated the Assumption 8 [42,46]; Assumption 9 indicates that our study does not involve competition between parcel locker companies; as for Assumption 10, we only consider the parcels delivered by smart parcel lockers, which is a limitation of our model.

Mathematical
Model. Before the model formulation, we frst introduce the notation used in the paper and then analyse the cost components and the revenue sources of the third-party smart parcel locker supplier in detail.

Notation.
Te notations used in our model are listed in Table 1.

Upper-Level Optimization.
Te objective of the upperlevel optimization model is to maximize the proft of thirdparty parcel locker suppliers, which is the diference between the total revenue and the total cost. Based on the cost components considered in literature [30][31][32], in this paper, we divide the cost components into three categories: (1) fxed facility costs; (2) venue fees; and (3) operating costs.
Te fxed facility costs refer to the manufacturing or purchase and installation costs of the parcel lockers. Te total fxed facility cost at candidate supply point i can be expressed as where f i is the fxed facility cost of each smart parcel locker group at candidate supply point i and z i is the number of smart parcel locker groups to be built at the candidate supply point i. Te venue fees refer to the costs of renting a venue for the smart parcel lockers. Similarly, the total venue fee at the candidate supply point i can be presented as i∈I s i z i . (2) Te operating costs refer to the costs of hiring people to perform operation and maintenance work such as cleaning, maintenance, and repairing during the operation of the smart parcel lockers. Te total operating cost at the candidate supply point i can be denoted by i∈I c i z i .
In addition, based on the study on proft maximization of parcel lockers conducted by Li [34], we divide the revenue sources into fve categories: (1) delivery fees from charging the courier for the delivery of the package; (2) postage revenues from charging users for package sending; (3) advertisement revenues; (4) overtime penalty charges; and (5) revenues from other value-added services.
Delivery fees refer to the fees paid by the couriers when the packages are delivered to the smart parcel lockers i∈I j∈J px ij δ j .
Te postage revenues refer to the fees that users need to pay when sending packages through the smart parcel lockers i∈I j∈J qy ij δ j .
Te advertisement revenues refer to the revenues gained from advertisement on parcel lockers, which is one of the main revenue sources i∈I a i z i .
Te overtime penalty fees refer to the fees that users need to pay when their packages are overtime i∈I j∈J Revenues from other value-added services refer to the revenues from the smart parcel locker company's collection of membership fees from users and the income from the selfstorage service To maximize the proft of the smart parcel locker supplier, i.e., maximize the diference between the total revenue and the total cost, the upper-level planning model is built as follows: Equation (9) gives the formulation for calculating the proft. Constraint 10 means that the sum of the fxed facility costs, the venue fees, and the operating costs should be less than the investment budget. Te number of smart parcel locker groups built at candidate supply point i should be a natural number. Constraint 11 indicates that only when the candidate supply point i closest to the demand point j is chosen to build smart parcel lockers, users at the demand point j can choose whether to go to the supply point i for service. Constraint 12 means that the total demand of the candidate supply point i should be less than or equal to the total turnover capacity of the built smart parcel lockers. Te average cost to be paid by a courier to deliver a package q Te average cost to be paid by the user to send a package A Te annual turnover capacity of each smart parcel locker

Lower-Level Optimization.
Te purpose of the lowerlevel optimization model is to maximize the user satisfaction, which is evaluated by two factors, i.e., the total demand served and the distance between smart parcel lockers and demand points, which solves the issue in Yang et al.'s study [30]. Te more demand served and the smaller the distance between the smart parcel lockers and demand points, the higher the user satisfaction. Tus, the objective of the lowerlevel planning model is formulated as δ j � 1, user j chooses to pick up the package at the nearest parcel locker, 0, otherwise, , ∀j ∈ J.
In equation (11), w is a parameter to adjust the relative weight placed on the served demand and the distance when evaluating the user satisfaction. Te larger the coefcient, the greater the weight placed on the served demand in user satisfaction evaluation. Similar to Constraint 11, Constraint 14 means that only when smart parcel lockers are built at the candidate supply point closest to the demand point j, users at the demand point j can go to the supply point for service. Constraint 15 means that each demand point will be served only when smart parcel lockers are built at its closest candidate supply point.

Model Applicability and Limitations.
We propose bilevel programming from the perspective of the smart parcel locker suppliers and the users. Te aim of the upperlevel optimization is to maximize the proft, which is estimated by subtracting the total cost from the total revenue to describe the real-world scenario as much as possible. Te aim of the lower-level optimization is to maximize user satisfaction, motivated by the studies conducted by [30,52], who took the users' pickup costs into account in the model. We construct a fractional function to describe user satisfaction, where the numerator is in the form of an exponential function, the base is the amount of demand to be met, the exponent is the adjustment factor w, and the denominator is the product of the user's pickup travel distance and the unit travel cost.
To clarify the intent of constructing the lower-level function in this way, we need to introduce the applicability of the model. First, constraint 10 indicates that our model is suitable for scenarios with limited budgets and is consistent with the reality of how suppliers invest. Moreover, the lower-level objective "user satisfaction" refers to an overall social beneft. Terefore, in the lower-level function, the larger the amount of demand being met, the more selected smart parcel locker supply points with a limited budget provide more services, the greater the social benefts, and the greater the overall satisfaction of users. Regarding the denominator of the function, the smaller the pickup costs for users, the higher the user satisfaction [46]. Te exponential function form is used in the numerator in order to adjust the weight of the served demand and the travel cost in the objective function through the adjustment factor w.
In summary, we believe that the applicability of the model is as follows: in this model, the decision game between smart parcel locker suppliers and users is considered, which is barely studied in the literature. Moreover, the model can optimize smart parcel lockers' locations given a limited budget. Furthermore, the results of the optimization can provide an appropriate estimate of the supplier's proft (i.e., the objective function value of upper level). However, the model still has some limitations. Te model is developed mainly for last-mile delivery through smart parcel lockers. We have not considered the impact of other delivery approaches on parcel lockers or the interest of logistics companies, which have been studied in the form of travel costs in vehicle routing planning models concerning lastmile problems [52,53].

Te Features of Bilevel Programming.
Bilevel optimization is a system optimization problem with a two-layer hierarchical structure. Its upper-and lower-level decision variables can afect each other [54]. To be specifc, bilevel programming problems involve two decision-makers at two diferent decision levels: the decision-maker at the lowerlevel (i.e., follower) has to optimize the lower-level objective function under "the given parameters" from the upper-level decision-maker (i.e., leader), and then the leader optimize the upper-level objective function with the information on the "reactions" from the followers. A general formulation of the bilevel programming is as follows [55] and [56]: where X is a vector of the upper-level decision variables and Y is a vector of the lower-level decision variables.
In the study, we describe the smart parcel locker supplier as the leader, who decides where to set the smart parcel lockers to maximize its proft frst, then conveys the decision to its users as "the given parameters." After that, the follower (i.e., the users) can choose whether to accept the service or not, which will infuence the supplier's proft, and then the "reactions" from users are transmitted to the supplier for further optimization. We believe that a bilevel programming model is suitable for the game between smart parcel locker suppliers and users.
Bilevel programming is recognized as an essential modelling tool because it allows for the formalization of hierarchical decision processes, which are commonly applied in energy, security, and revenue management [57]. However, due to the ability to model hierarchical decision processes, bilevel optimization issues are difcult to solve. Even its simplest case with a linear upper-and lower-level issue is NP-hard [58].

Te Solution Methods to Bilevel Programming.
Generally speaking, there are two kinds of algorithms that can solve the bilevel programming problem: deterministic algorithm and heuristic algorithm. Deterministic algorithms mainly include branch-and-bound [59], cutting planes [60], and penalty function-based approaches [61]. Heuristic algorithms mainly include the genetic algorithm [62], the simulated annealing algorithm [63], the neural network algorithm [64], and the particle swarm optimization algorithm [65]. Te heuristic algorithm has global optimization performance and strong versatility and is suitable for parallel processing. Kleinert et al. [57] pointed out that the development of solution algorithms for bilevel optimization issues is heavily infuenced by the structure and features of the lower-level problem as well as the coupling between the upper and lower levels. For example, the solution approaches vary greatly depending on whether the lower-level problem is continuous and convex or not and whether the decision variables are integers.

Genetic Algorithm.
As genetic algorithms are efective when dealing with complex search space problems [62], we choose the GA as the solution algorithm for the nonconvex pure integer bilevel programming model in the study. As the problem involves positive integer decision variables, the conversion between decimal numbers and binary numbers is designed to evaluate the ftness of the solution. To be specifc, each element in the decision variable is translated into a binary chromosome segment with a predefned length according to the value range of the decision variable. Ten, the entire chromosome is crossed and mutated. Finally, the entire chromosome is divided into multiple segments based on the value ranges of the decision variables and reconverted to decimal numbers to obtain the solution. Te following summarizes the process of the proposed GA: (1) Setting parameters: set the population size NP, crossover probability P c , mutation probability P m , and maximum number of iterations NG; the number of the current iteration times is recorded as g. to the lower-level planning to obtain its solution and record the solution as LX. We call UX m and LX together as TX. Ten, we evaluate the ftness of TX with the ftness evaluation using (13) and pass on the 20 individuals with the highest ftness values as elites to the next generation. (6) Termination or loop: if the number of the current iteration times g reaches NG, stop iteration, pick the solution with the highest ftness value as the optimal solution, otherwise, let g � g +1, go to (3).
Te ftness function is the only indicator for judging the survivability of ofspring, that is, an essential indicator to measure the superiority of the solution. To better refect the game between the upper and lower decision variables, the ftness function set in this paper is as follows: In equation (13), φ is a weight adjustment parameter, which we adjust to keep the magnitudes of the weights of the upper and lower level functions in the ftness function constant when the lower-level parameter w changes.

Numerical Experiment
Te numerical experiments are carried out based on Yunxiang Expansion, a large-scale residential community in Nanxiang Town, Jiading District, Shanghai, as it is a typical community that requires parcel locker location optimization. First, some of the buildings in the community are equipped with smart parcel lockers, such as Bai Chao Parcel 8 Journal of Advanced Transportation Lockers, while others are not. Second, several residential buildings in the community have been gradually turned into shared ownership apartments, and the resident population is estimated to grow in the future. Tus, we divide the community into saturated and undersaturated areas according to the current smart parcel locker distribution. Te saturated area is defned as the area where existing smart parcel lockers can be reached within a 300-meter walk, while the other areas are undersaturated. Ten, we model and optimize the location of new parcel lockers for the undersaturated areas. Finally, some sensitivity analyses are conducted on the investment budget in the upper-level problem and the relative weight placed on the served demand and the distance in the lower-level problem.

Data Processing.
In order to analyse smart parcel lockers' supply and demand and divide the residential community into saturated and undersaturated areas, in the numerical experiments, relying on the Baidu Map Open Platform, we collect the coordinates of the centres of existing parcels locker points and residential areas by using Python for POI network crawling with smart parcel locker and residential as the keywords. Due to the COVID-19 lockdown in Shanghai, we assume the demand and users' behavioural preferences as presented in Tables 2 and 3, respectively. According to the data of State Post Bureau [66] and Huaon Intelligence [67], the per capita volume of express delivery in Shanghai is 135 pieces, and more than 60% of parcels were delivered via pickup points (smart parcel lockers and nearby shops). Terefore, we assume that the annual demand per household is 135 packages, and 40% of the households in the community choose smart parcel lockers for service (the rest 20% for nearby shop pickup), 90% of which are for receiving while the rest are for sending [68]. Moreover, we collect the household number of each residential community from rental information websites such as Anjuke. As for the users' behavioural preferences, we frst set the general range of the average membership fee, the average cost for storage service, and the average penalty fee for overtime pickups by referring to the data of Fengchao [69], the largest market share of smart parcel locker companies in China, and then randomly generate the specifc values of each community in the range. Te other proportional values are generated randomly. In practice, these parameters can be obtained using a survey. Other relevant parameters are summarized in Table 4.
Note that the advertisement revenue is calculated based on the public data of Ali in 2019, and the courier delivery cost and the user sending cost are defned based on the market price. We assume that a single parcel locker group has 95 compartments, and each compartment is turned around once every 24 hours. In addition, the parameters related to the genetic algorithm are set as follows: the φ in the ftness function is set to 1, the population size is set to 200, the hybridization probability is set to 0.95, the variation probability is set to 0.1, the maximum number of iterations is set to 1000, and the number of elites is set to 20.

Saturated and Undersaturated Area Division.
Given the coordinates of the demand points and existing smart parcel locker points, we use QGIS to visualize and divide the community into saturated and undersaturated areas. To be specifc, we frst draw the road network in QGIS and import the coordinates. Ten, we use the service area tool to obtain the areas within 300 meters of existing smart parcel lockers, which are defned as saturated areas. Similarly, the areas beyond 300 meters of existing smart parcel lockers are undersaturated areas. Figure 1 presents the distribution of the demand points, existing smart parcel locker points, and saturated and undersaturated areas.

Determine the Candidate Smart Parcel Locker Points.
In the study, we select the neighbourhood entrance or supermarket within 300 meters from demand points as the candidate supply points in the undersaturated areas, as shown in Figure 2. In reality, the smart parcel locker supplier can collaborate with the community to decide the candidate supply points. Also, Figure 2 shows that there are 9 demands points in the undersaturated areas.

Distribution and Optimization.
As GAs have a tendency to converge towards local optima, we divide the solution process to ten groups, and each group is solved fve times for a total of 50 solutions in order to ensure the reliability of the fnal results. Meanwhile, the parameters of the GA are appropriately adjusted according to the results of previous groups. In the end, the solution with the largest objective function value and better convergence is selected as the optimal solution among the 50 solutions. Te parameter values used in the experiment are listed in Table 4.
In the experiment, 46 of the 50 solutions converged to the same optimal solution. Te values of the upper-level objective function and variables are 1.65 × 10 5 and [0, 3, 0, 2, 0, 0, 2, 0], while the values of the lower-level objective function and variables are 38.06 and [1, 1, 0, 0, 0, 1, 0, 0, 0], respectively. Tis means 3 out of the 8 candidate supply points will build a total of 7 smart parcel lockers, which will serve three demand points ranking frst, fourth, and ffth in demands, as shown in Figure 3. Tis enables the budget and smart parcel lockers' capacity to be fully utilized to maximize proft.

Sensitivity Analysis.
In the study, the sensitivity analysis is mainly conducted on two parameters, the parameter w and the annual budget B. Parameter w is proposed to adjust the relative weight placed on the served demand and the distance in evaluating user satisfaction. Te larger the coefcient w, the higher the weight placed on the served demand, and vice versa. To study the infuence of the parameter w, we conduct some sensitivity analysis by setting w as 0.1, 0.5, 1.0, and 2.0, with the results presented in Figure 4. It turns out that w � 0.1 and w � 0.5 give the same optimal solution with the upper-level objective function value as 1.37 × 10 5 . Similarly, the optimal solutions of w �      Te results show how the relative weight parameter w infuences the allocation of smart parcel lockers and thus the proft of the third-party parcel locker supplier. With the increase of the parameter w, the demand factor dominates the lower-level planning, and then the smart parcel lockers planned to be built at a demand point with a smaller demand but a shorter distance are transferred to a demand point with a larger demand but a longer distance. Meanwhile, the net proft of the third-party smart parcel locker supplier increased from 1.37 × 10 5 to 1.65 × 10 5 . Tus, in practice, the parameter w should be adjusted appropriately.
In addition, we further conduct some sensitivity analyses on the investment budget to assist parcel locker suppliers in making wise investment decisions. As we assume that an additional parcel locker can be built if the budget increases by 66,500 yuan, we experiment with the investment budget from 100,000 yuan to 1,100,000 yuan at an interval of 100,000 yuan and 2,000,000 yuan to explore the relationship between the investment budget and the proft of the thirdparty parcel locker supplier. Te numerical results are presented in Table 5.
As can be observed in Table 5, further increasing the budget from 1,100,000 yuan cannot further increase the proft. It is calculated that the maximum budget for the community is 1,064,000 yuan and the maximum proft is 2.91 × 10 5 . We have further produced the ftting curve for the investment budget and the proft using the least squares method, as shown in Figure 5. Te proft functions are provided in (14). It is computed that the supplier starts to have a positive proft when the budget is sufcient to build two parcel locker groups, which is 13,300 yuan. It can be observed in Figure 5 that, overall, the proft increases with  the increase in the investment budget, but with a diminishing marginal proft if the investment budget is above 133,000 yuan and below 1,064,000 yuan. Further increasing the budget from 1,064,000 yuan will not improve the proft. Note that the R 2 of the ftting curve is 0.96, which means that the proft function can provide a reasonable estimate of the proft for a given investment budget. Note that even if the investment budget is sufcient, the optimized solution does not suggest serving all demand points with smart parcel lockers.      investment budget and the proft is presented, which can assist in third-party smart parcel locker suppliers' investment budget planning.

Conclusions
With the distinct advantages of bringing economies of scale and providing 24/7 contactless self-service, smart parcel lockers have great potential to solve the last-mile problem. However, issues such as poor planning, myopia expansion, and an ambiguous proft model led to huge losses for the smart parcel locker enterprises in China. Te focus of this study is to conduct an in-depth analysis of the cost elements and the revenue sources and then optimize the location of community smart parcel lockers from the perspective of third-party parcel locker suppliers. We have proposed a bilevel programming model to optimize the location of community smart parcel lockers with the upper level maximizing the proft of third-party smart parcel locker suppliers and the lower level maximizing user satisfaction. Ten, a solution algorithm based on GA is proposed.
To validate the proposed model and solution algorithm, we conducted some numerical experiments based on Yunxiang Expansion, a large-scale residential community in Nanxiang Town, Jiading District, Shanghai. Te numerical results show that the GA-based solution algorithm converges well. Furthermore, some sensitivity analyses are carried out to study how the weight adjustment parameter in user satisfaction evaluation and the investment budget infuence the proft. Te numerical experiments show that (1) with the increase of the weight adjustment parameter, the demand factor dominates the lower-level planning, and then the smart parcel lockers planned to be built at a demand point with a smaller demand but a shorter distance are shifted to a demand point with a larger demand but a longer distance, producing a higher proft; (2) overall, the proft increases with the increase of the investment budget but with a diminishing marginal proft, and the proft cannot be further improved once the budget is sufcient. Te modeling framework and numerical results can assist in third-party smart parcel locker suppliers' investment budget planning and parcel locker location optimization, providing valuable theoretical support and practical guidance. As the study focuses on the proft of the third-party smart parcel locker suppliers and user satisfaction, future studies can extend and appropriately consider the benefts of the courier. Second, we assume uniform parcel locker size in the study, and future research can generalize the practical applications and consider optimizing the size combinations of parcel lockers to further increase the supplier's proft.

Data Availability
All the data used are listed in the paper.

Conflicts of Interest
Te authors declare that they have no conficts of interest.