key: cord-0965394-hocp48ta authors: Liu, Kanglin; Liu, Changchun; Xiang, Xi; Tian, Zhili title: Testing facility location and dynamic capacity planning for pandemics with demand uncertainty date: 2021-11-25 journal: Eur J Oper Res DOI: 10.1016/j.ejor.2021.11.028 sha: 87bdb1515557729d67aa6c66d9a21d6c5ae453d4 doc_id: 965394 cord_uid: hocp48ta The outbreak of coronavirus disease 2019 (COVID-19) has seriously affected the whole world, and epidemic research has attracted increasing amounts of scholarly attention. Critical facilities such as warehouses to store emergency supplies and testing or vaccination sites could help to control the spread of COVID-19. This paper focuses on how to locate the testing facilities to satisfy the varying demand, i.e., test kits, caused by pandemics. We propose a two-phase optimization framework to locate facilities and adjust capacity during large-scale emergencies. During the first phase, the initial prepositioning strategies are determined to meet predetermined fill-rate requirements using the sample average approximation formulation. We develop an online convex optimization-based Lagrangian relaxation approach to solve the problem. Specifically, to overcome the difficulty that all scenarios should be addressed simultaneously in each iteration, we adopt an online gradient descent algorithm, in which a near-optimal approximation for a given Lagrangian dual multiplier is constructed. During the second phase, the capacity to deal with varying demand is adjusted dynamically. To overcome the inaccuracy of long-term prediction, we design a dynamic allocation policy and adaptive dynamic allocation policy to adjust the policy to meet the varying demand with only one day’s prediction. A comprehensive case study with the threat of COVID-19 is conducted. Numerical results have verified that the proposed two-phase framework is effective in meeting the varying demand caused by pandemics. Specifically, our adaptive policy can achieve a solution with only a 3.3% gap from the optimal solution with perfect information. In 2020, coronavirus disease 2019 has resulted in large economic losses, and the corresponding damage continues to escalate. As of January 26, 2021, more than 100 million cases have been confirmed worldwide (CNN, 2021) . In addition to COVID-19, other epidemic diseases have also caused astonishing damage to economic and social development, including the 2014-2016 Ebola virus disease, which led to more than 10,000 deaths in West Africa (CDC, 2016) ; the novel swine-origin influenza A (H1N1) virus, which was first discovered in 2009 and caused tens of millions of confirmed cases and 12,469 deaths in the United States (CDC, 2019) ; and the mosquito-borne Zika virus (ZIKV), which has affected 72 countries and territories, causing more than 500 thousand locally acquired cases by September 1, 2016, in the Americas alone (Duong et al., 2017) . Such infectious diseases have remained among the top causes of death globally. In practice, governments and organizations have taken many measures to address the spread of epidemic diseases. Expanding access to testing is of great importance to the general public. With the rapid spread of the epidemic, testing is central to planning response activities in all countries during and after the pandemic. Accurate, effective, and efficient testing can lead to early outbreak detection, which will allow health authorities to quickly isolate and treat infected patients, guide people to consciously perform social distancing, and guide policymakers in lockdown policies of certain areas/activities if needed. Hence, to keep the pandemic under control or prepare for the next wave, a well-planned testing strategy is necessary for both disease prevention and intervention. Establishing such a testing system involves not only locating testing centers or assigning people to the testing facilities but also distributing resources, e.g., test kits, to test centers while considering potential demand uncertainty for testing. In fact, large-scale emergencies have already attracted significant attention from academia in recent decades. Tomasini and Van Wassenhove (2009) addressed the life cycle of disaster management and included four phases, i.e., mitigation, preparedness, response, and rehabilitation. Mitigation represents the proactive social components of emergencies, which are composed of laws and restrictions that can help to increase resilience and decrease vulnerability under the threat of disasters. Preparedness is a long-lasting and structured decision process that determines the response mechanisms to counter factors that society has not been able to mitigate; for example, cities have fire departments to attend to the relief needs and execute regulations associated with fire safety. Response is related to the acts of attending to disasters; this happens after the initial outbreak, such as transportation of emergency supplies, location-relocation of temporary shelters, and evacuation of affected communities. Rehabilitation comes after response and helps victims restore normality. As stated by Tomasini and Van Wassenhove (2009) , the middle steps, preparedness and response, fall into the scope of disaster logistics, which also represent our research focus. Before disasters, much research focused on prepositioning relief supplies (Rawls and Turnquist, 2010; Wenjun et al., 2018; Velasquez et al., 2020) , locating critical distribution/medical facilities (Mostajabdaveh et al., 2019; Liu et al., 2019) , building fortifications of critical infrastructures (Liberatore et al., 2011; Parajuli et al., 2021) , etc. In the response phase, research topics such as relocating patients/communities (Mills et al., 2018; Xu et al., 2020) , adjusting capacities (Alem et al., 2021) , resource allocation (Yu et al., 2018 (Yu et al., , 2019 , and evacuation (Regnier, 2008; Wang, 2020) are being further investigated. Our research belongs to the category of studies on jointly optimizing the pre-and post-humanitarian operations in a single program, which are more complex (Jabbarzadeh et al., 2014; Charles et al., 2016; Vatsa and Jayaswal, 2021; Alem et al., 2021) . After the outbreak of COVID-19, more researchers began to focus on optimizing related operations with respect to pandemics; interested readers can refer to a recent review paper Queiroz et al. (2020) for more details. In our study, the first problem is where to locate testing facilities and how to design their capacities during the preparedness phase (i.e., how many test kits they should receive daily and how to decide staffing levels in each facility). Faced with dynamic and uncertain demand volumes, as well as the geographical layout of facility candidates and demand sites, researchers have conducted a number of studies on how to locate retail stores, optimize inventory and production, and manage stock levels as demand for products fluctuates by season (Shen et al., 2011; Basciftci et al., 2021b) . Among them, many focus on the resilience and reliability of facility locations under uncertain demand and disruptions using stochastic or robust optimization approaches. Establishing an operational system for epidemic resource distribution presents a very similar set of challenges but under unknown disease spread and human behavioral uncertainties. In this study, we present a comprehensive framework to optimize the locations of testing centers, their capacities, and shipment amounts in the background of pandemics. As the provided framework is presented in a generic form, it aims to address various resource allocation problems during different phases of a pandemic by a stochastic programming (SP) approach for different scenarios in practice. We formulate the first-stage phase into a sample average approximation (SAA) formulation to meet predetermined fill-rate requirements. The greatest challenge of SAA is to address all the scenarios simultaneously. To overcome this difficulty, we adopt an online gradient descent algorithm, which constructs a near-optimal approximation for a given Lagrangian dual multiplier. Finally, we develop an online convex optimization-based Lagrangian relaxation approach to solve the first-phase problem. The second problem involves how to adjust resources dynamically to face varying demand caused by pandemics during the response phase. The demand for large-scale emergencies such as COVID-19 fluctuates significantly with time. Taking the situation in China as an example, the State Council Information Office of the People's Republic of China announced five stages of fighting COVID-19. In the second stage, the peak value of newly confirmed cases on the Chinese mainland reached 15,152 on February 12, 2020. Since April 29, 2020, the Chinese government began to focus on sporadic cases and case clusters in some locations, and inbound cases were also generally under control (China's State Council Information Office, 2020). Faced with complicated and changeable situations, governments update policies to adapt to the epidemic. For example, Beijing Municipal Health Commission (2020a ,b, 2021 announced that the number of official COVID-19 testing facilities increased from 46 (April 15, 2020) to 128 (June 23, 2020) to 252 (January 8, 2021). Therefore, it is beneficial to involve a dynamic setting while performing optimization. As stated in Sheu (2010) , a dynamic supply chain network design is essential for emergency logistics planning in disasters. In the first problem, we generate possible scenarios to describe future demand uncertainty and obtain an initial location and capacity planning strategy at the very beginning. However, the generated scenarios may have zero probability and lead to an unsatisfying solution. Fortunately, the second problem enrolls scenarios that are derived from the online realized demand data, which dynamically adjust the initial decisions and improve the reliability of the overall solution approach. For the solution approach, the proposed stochastic facility location and dynamic capacity planning problem lies in the scope of sequential decision-making with uncertainty. According to Powell (2016 Powell ( , 2019a , the range of related problems, which is so wide that they have been studied by dozens of distinct academic communities, includes the Markov decision process (Puterman, 2014) , approximate/adaptive/neurodynamic programming (Powell, 2011; Bertsekas and Tsitsiklis, 1996) , SP (Shapiro et al., 2014) , robust optimization (Ben-Tal et al., 2009 ) and online learning (Albers, 2003) . However, each community develops tailored techniques to address specific problems, and the technique is very likely to be inefficient under different settings. Powell (2016) identified four classes of policies that span all the approaches and claimed that any solution to a sequential decision problem consisted of one or a hybrid of the four classes. Among the aforementioned communities, the Markov decision process (MDP) and SP are two major modeling approaches that have been used in stochastic dynamic capacity planning (Basciftci et al., 2021a) , and review papers on strategic capacity planning, such as Van Mieghem (2003); Martínez-Costa et al. (2014) ; Sabet et al. (2020) , are identified for more details. However, formulating MDP and SP problems requires additional constraints or variables along with the curse of dimensionality and is often computationally intractable (Basciftci et al., 2021a) . In the field of MDP, dynamic programming (DP) algorithms, such as value iteration and policy iteration, are well understood for small-scale problems, while approximated dynamic programming (ADP) and approximate linear programming (ALP) restrict the search of the linear span of a small number of features so that larger-scale instances can be solved (Malek et al., 2014) . According to Martínez-Costa et al. (2014) , the preferred procedure for solving dynamic capacity planning models in recent papers is commercial software (such as CPLEX), while in older papers, DP algorithms (Rajagopalan et al., 1998; Shulman, 1991) were mainly proposed; however, commercial software has evolved. For SP, SAA is a major technique for dealing with expected values of random variables. Two major drawbacks of SP include the difficulty of identifying representative scenarios and the computational intractability of large-scale problems (Snyder, 2006) . Worse still, the SAA method is unlikely to solve problems in a single program, such as our case study with hundreds of enumerated scenarios. Therefore, a method that can capture system properties based on available data and quickly obtain satisfying solutions with a performance guarantee is urgently needed. In this paper, we employ an online convex optimization (OCO) approach to address the dynamic and stochastic demand during pandemics. The proposed adaptive policy uses one day's prediction to make a decision and is proven to achieve the "target-based optimal solution", i.e., the solution that minimizes the Euclidean distance to any predetermined multiobjective target. When new data become available, the problem is solved repeatedly and is easy to implement. In summary, we focus on testing facility location and dynamic capacity planning problems simultaneously facing varying demands caused by pandemics. The contributions are summarized as follows. • We propose an easy-to-implement two-phase framework to solve testing facility location and dynamic capacity planning problems facing varying demand caused by pandemics. • The first phase aims to locate testing facilities and design their capacities using a sample average approximation formulation. An online convex optimization-based Lagrangian relaxation approach is proposed. Specifically, we adopt an online gradient descent algorithm to overcome the difficulty that all scenarios should be addressed simultaneously in each iteration. The proposed approach can construct a near-optimal approximation for a given Lagrangian dual multiplier in polynomial time. Numerical experiments validate the effectiveness of the proposed algorithm. • The second phase is to dynamically adjust resources facing varying demand caused by pandemics. We design the dynamic allocation policy and adaptive dynamic allocation policy to adjust decisions with respect to varying demands; the latter policy is proven to be asymptotically consistent, which means that it can achieve the "target-based optimal solution" when the planning horizon tends to infinity. • A comprehensive case study with the threat of COVID-19 is conducted, where time series data, demographic data, economic data, and geographic data are collected to reflect real life conditions. Extensive numerical results show the effectiveness of the two-phase approach. The remainder of this paper is organized as follows. Section 2 presents a thorough literature review of previous research. Section 3 is composed of a problem statement and model formulation. The two-phase solution approach is explained in Section 4. A case study is given in 5. Finally, Section 6 concludes the paper and points out future research directions. Since the outbreak of COVID-19, studies related to pandemics have gained increasing amounts of attention; within this body of literature, our study belongs to the stream of studies on emergency facility location and capacity design. To construct a reliable emergency response system, researchers have made efforts to better locate critical facilities, such as emergency medical services (EMS) stations (Beraldi and Bruni, 2009; Noyan, 2010; Liu et al., 2019) , temporary shelters (Kınay et al., 2018; Bayram and Yaman, 2018; Mostajabdaveh et al., 2019) or prepositioning facilities (Rawls and Turnquist, 2010; Hong et al., 2015; Zhang and Li, 2015; Elçi and Noyan, 2018; Ni et al., 2018) . Our research focuses on locating testing facilities, which extend the pure strategic location problem to a dynamic setting. Related papers are summarized in Table 1. A series of papers focused on a static location model, which assumed that the location and the corresponding capacity remain unchanged during the entire horizon regardless of the variations of demand (Jabbarzadeh et al., 2014) . Bayram et al. (2015) developed a mixed-integer nonlinear program to study the location of shelters and evacuation routes after disasters, where the total evacuation time (a nonlinear function of the flow on segments) is minimized. Kılcı et al. (2015) proposed a mixed-integer linear programming (MILP) model for selecting shelters with area utilization. The model was validated by real data from Kartal, Istanbul, Turkey, and a case study was conducted on the 2011 Van earthquake. Chen and Yu (2016) Demand fluctuations and variations are important features during pandemics. When demand varies, dynamic facility locations and capacity planning problems can improve system performance by increasing the utilization of resources on hand . Generally, the entire planning horizon is divided into several time periods, and the decisions are made periodically (Melo et al., 2009) . Dynamic location problems have been extensively studied since the pioneering work of Ballou (1968) . We refer interested readers to review papers such as Nickel According to Ni et al. (2018) , mitigation and preparedness are predisaster relief actions, while response and recovery pertain to postdisaster relief actions; therefore, we generally classify operations before and after emergencies as two separate phases. Most of the aforementioned papers solely optimized a single phase. For static problems, most papers, with only one exception Mostajabdaveh et al. (2019) , focused on predisaster strategic decisions, i.e., determining the location and size of emergency facilities in preparation for potential disasters. For dynamic problems, researchers have mainly focused on the dynamic deployment of resources or victims after emergencies, such as relocation of EMS vehicles (Peng et al., 2020) , relocating communities (Xu et al., 2020) and optimizing evacuation routes (Regnier, 2008) . Studies considering humanitarian operations both pre-and postdisaster simultaneously are limited, and our paper belongs to this category. (2018) is the most relevant paper that uses MDP techniques; they examined a multilocation inventory system to optimize inventory transshipment sources, destinations, and the number of units with dynamic and stochastic demand and employed DP introduced by Bellman (1966) to solve smallscaled instances and an ADP approach to find near-optimal policies. According to their results, DP can solve problems to optimality, but it is not able to tackle real-life instances due to the enormous size of the states and decision spaces. Although ADP can obtain a near-optimal solution for real-life cases, the computational time is still unsatisfactory (for instance, the case with 20 facilities and 28 days was solved in 2,059.55 seconds by ADP). As our problem is more complex, MDP-based techniques are not suitable in our setting; compared with Meissner and Senicheva (2018) , our extensions can be summarized in the following two aspects. First, in addition to transportation flow and inventory, location is also an important decision variable in our study, while they assumed location as an input parameter. Second, our case study is composed of 66 facility candidates, 333 demand sites, and 250 days, which is much larger than their largest instance (20 facilities and 28 days). Currently, SP has become a fundamental methodology to address related problems by enumerating the underlying scenarios. Rawls and Turnquist (2010) In this paper, we formulate a two-stage stochastic program (reformulated by the SAA approach) considering fill-rate constraints to solve our first-phase problem. The main challenge of the SAA approach is that increasing the number of scenarios will lead to an exponential increase in computational complexity, and it may not solve a large-scale instance such as the one that we examine. To overcome this difficulty, we adopt a novel approach by using an online environment where demand arrives over time so that short-term tactical strategies (such as capacity and assignment) can be adjusted once the situation changes, i.e., the OCO technique. The OCO method was first introduced by Zinkevich (2003) and could obtain a near-optimal approximation for a given guarantee and computational tractability, the OCO framework has been successfully used in optimization areas such as online ride-matching (Lyu et al., 2019b) and production network optimization (Lyu et al., 2019a) ; we introduce this advanced algorithm to humanitarian logistics, where a unique and converged step direction is proposed based on the special structure of our problem. Specifically, we implement the online gradient descent algorithm in the Lagrangian relaxation approach to achieve a sublinear regret bound compared with the offline optimization approach. We consider a general multiperiod testing facility location and capacity design problem. The original network is composed of J facility candidates and I demand sites. Total supplies delivered by a single facility should not exceed its current capacity, and a certain demand site can be served by different facilities, i.e., a multisourcing assignment setting. The goal of this problem is to identify the optimal location and capacity strategies during the entire time horizon with the objective of minimizing the total operational cost. As demand uncertainty can never be underestimated, we introduce parameter d as representative of random demand. A type-II service level constraint is involved to keep customers satisfied, and unmet demand is strictly penalized in the objective. Service fairness another important issue for planners is achieved by defining the maximum covering distance. Throughout this paper, we use bold-face letters to denote vectors and matrices, such as d; let set [R] = {1, 2, ..., R} for any positive integer R; and use lower-case letters and upper-case letters to denote input parameters and decision variables, respectively. Notations are summarized as follows. [J] Set of facility candidates, [J] = {1, 2, · · · , J}, indexed by j. [I] Set of demand sites, [I] = {1, 2, · · · , I}, indexed by i. [T ] Set of time periods, [T ] = {1, 2, · · · , T }, indexed by t. f j Fixed construction cost of opening a facility at node j. a jt Varying construction cost of investigating one unit of capacity at facility candidate j in period t. η Unit transportation cost. c ij Travel distance between demand site i and facility candidate j. p it Unit penalty cost of unmet demand at demand site i in period t. M Maximum amount of capacity (a large positive number). β i Expected demand fill rate (type-II service level) at demand site i. T max Maximum covering distance. Cov i Set of location candidates that can cover demand site i, Dem j Set of demand sites that could be served by facility j, Decision variables X j Binary variable; equals 1 if a facility is built at node j and 0 otherwise. S j (t) Continuous variable; capacity available of facility j in period t. Y ij (t) Continuous variable: amount of relief supplies that travels from facility j to demand site i in period t. W i (t) Continuous variable; unmet demand of node i in period t. To ensure that every demand site could obtain prompt relief service with equal probability, we define the maximum distance that demand sites could be covered (T max ) and use sets Cov i and Dem j to denote responsive service regions. Without loss of generality, the mathematical model is based on the following assumptions: (a) Facilities are built in the first period with a corresponding initial capacity and are not be destroyed later. (b) Capacity could be adjusted with realizations of time-varying demand. As building a facility can be expensive and the effect is long-lasting, facilities are unlikely to be destroyed once built; therefore, assumption (a) has been widely used in related studies such as that of Jabbarzadeh et al. Essentially, the determinate facility location and capacity configuration problem with perfect information can be formulated as the following MILP. [P1] min The objective function (1a) To better fit reality, we divide the problem into two phases: a construction phase and an operational phase (see Figure 1 ). Specifically, we first decide the location and initial capacities of the testing facilities, and then infrastructures go into service with capacity expansion decisions in each time period. During the operating process, it is less time-consuming and more convenient to adjust facility capacities facing varying demands. As shown in Figure 1a , the initial location and capacity strategies are first determined during the construction phase (t = 1); in regard to Figure 1b , which is named the operational phase, capacity adjustment is allowed; for example, the capacity of facility C is enlarged in period 2, and the capacities of facilities B and D are further expanded in period 3. Moreover, assignment policies could also be modified; see the red-colored lines in Figure 1b . Solving problem [P1] requires addressing T time periods simultaneously, which might result in a large-scale MILP. Furthermore, as demand parameter d it is unknown in the initial stage, it is unlikely to obtain a perfect estimation of future demand. To circumvent computational difficulties and compensate for the lack of full information, we propose a two-phase algorithm to solve this problem, which is in line with reality and easy to implement. • Phase I (Construction Phase). Location design and capacity initialization: Determine the location X j and the initial capacity S j (1) with predicted demand. During the time horizon, we evaluate future demand by K (K = T ) predicted samples, which correspond to T different periods, and the k th sample denotes the predicted demand at the corresponding time period. Thus, problem [P1] could be considered a single-period location and capacity design model with K scenarios. We employ a Lagrangian relaxation algorithm to solve the reformulated model, where an OCO technique, namely, online gradient descent, is used to solve the subproblem within each iteration. • Phase II (Operational Phase). Dynamic capacity planning: Determine the capacity increment ∆S j (t), allocation schedule Y ij (t), and corresponding decisions W i (t) dynamically. After observing the revealed demand at time period t, we make capacity planning decisions dynamically, with the objective of minimizing various costs, including varying construction cost of capacity expansion, transportation cost, penalty cost of unmet demands, and satisfying the service level of each demand site. In this section, we develop a Lagrangian relaxation algorithm to determine the location design X j and the initial capacity S j (1) given expected service level targets. For simplicity, we use S j to replace S j (1) in this subsection. The multiperiod model is first transformed into a single-period model with K demand scenariosd i (k), where a j and p i are the corresponding expected values computed as For problem (P3), we consider its Lagrangian dual formulation by introducing the Lagrangian dual multiplier λ in correspondence with the service level constraints, which can be formulated as Following the classic paradigm of Nocedal and Wright (2006) , problem [P4] could be solved iteratively by minimizing the inner problem regarding original decision variables (X, S, Y , W ) and maximizing the outer optimization model with respect to the Lagrangian multiplier (λ). Suppose in the n th iteration with respect to λ, the inner minimization problem with fixed λ n is [P5]. [P5] φ n (X, S|λ = λ n , d =d) = min s.t. (3c)-(3i). Define (X n * , S n * ) as the optimal solution of [P5] when λ = λ n , i.e., (X n * , S n * ) = arg min φ n (X, S|λ = λ n , d =d). Note that problem [P5] requires addressing all demand scenarios simultaneously and would result in a time-consuming MILP if K is large. Instead of finding X n * and S n * directly, we use an online gradient descent algorithm to develop a feasible capacity profile S n (k − 1), k ∈ [K] of [P5], and use these to construct a near-optimal approximation of S n * . Afterward, X n * could be obtained through a simple injective function As X j can always be observed through the injective function π, we only focus on S j while solving problem [P5]. In accordance with the roadmap of the OCO technique, [P5] only depends ond i (k), Y ij (k) and W i (k) with fixed capacity profile S n (k − 1) and the corresponding location X n (k − 1), k ∈ [K]. Therefore, we can obtain a decomposed subproblem [P6] by letting λ = λ n , X = X n (k − 1), S = S n (k − 1) and d =d(k). [P6] f n k (S n (k − 1), λ n ,d(k)) = min Based on the dual form of problem [P6], S n j (k) could be updated according to the gradient descent direction (find more details in Step 3.2 of Algorithm 1). With fixed λ, we obtain a near-optimal S n j after dealing with all K samples. Finally, the entire algorithm terminates whenever λ converges. Detailed procedures of the algorithm are presented as follows: Algorithm 1. OCO-based LR for location design and capacity initialization algorithm. • Input: Demand distribution D • Output: Location design X * , capacity initialization S * and the initial assignment policy Y * . [DM] min Assume the optimal solutions of the above DM are X * , S * , and Y * . Set the iteration number n = 0, and, • Step 3: Compute the location design and capacity initialization. Execute the iteration process. In each iteration n, we use the online gradient descent algorithm to compute a near-optimal approximation for S n * . -Step 3.1. For k = 1, 2, ..., K, do the following: * Solve the following primal problem given the demand scenariod(k) and the Lagrangian dual multiplier λ n : , * Solve the following dual problem: where b ij = 1 if c ij ≤ T max , otherwise, b ij = 0. * Update the capacity. Denote the step size γ(k) := 1 √ k and step direction where 1(·) is the indicator function. v j (t) denotes the optimal solution to the dual problem that corresponds to the capacity constraint, and thus, its value depends on S n (k − 1). Here, 1 S n j (k−1)=0 · f j + a j denotes the cost of increasing capacity, while v j (k) is the profit as capacity increases. Therefore, if ∇ S n j (k−1) f (·) ≤ 0, the planner tends to increase the capacity; otherwise, the capacity should be decreased to reduce cost. Thus, we define the gradient as follows: -Step 3.2. Compute the average capacity and expected allocation quantity on each flow over K where Y n ij (k) denotes the optimal solution to the primal problem in scenario k with fixed λ n . • Step 4: Dual multiplier update. Update the dual multiplier λ n+1 as follows: where 1 √ n represents the step size. • Step 5: Iterate until the algorithm terminates. Define a predetermined tolerance threshold and terminate the above process when max i∈I λ n+1 i − λ n i ≤ . Then, the optimal capacity S * =S n , the optimal location design X * =X n , and the corresponding initial assignment policy Y * =Ȳ n constitute the desired profile. Otherwise, let n = n + 1 and go back to Step 3. In Step 3 of Algorithm 1, we employ an online gradient descent algorithm to achieve a near-optimal approximation of S n * . Specifically, we aim to minimize the average regret from using {S n (k)} K k=1 over K scenarios, defined as Regret(K) := 1 K K k=1 f n k (λ n , X n , S n ,d(k)) − K k=1 f n k (λ n * , X n * , S n * ,d(k)) . Theorem 4.1 is proposed to guarantee the performance of the online gradient descent algorithm. That is, the results obtained by the online gradient descent algorithm are a near-optimal solution of X n * . Theorem 4.1. The average regret of the online gradient descent algorithm satisfies the following nonasymptotic bound: Proof. The detailed proof is displayed in Appendix Appendix A.1. Theorem 4.1 shows that as K tends to infinity, the gap between our method and the optimal solution tends to be 0. This means our method can obtain the optimal solution when K → ∞. Furthermore, our method has an enormous advantage in that the computational complexity increases linearly with increasing K. Therefore, the computational difficulty of our method only depends on the complexity of the subprimal and subdual problems. However, the traditional method, which can obtain the optimal solutions, needs to address all K samples simultaneously. It is intractable when K → ∞, since the computational complexity increases exponentially with the increase of K. Given the location design X j and capacity initialization S j (1) obtained from subsection 4.2, we address a dynamic capacity planning problem to fulfill the requirements during the operational phase of each time period. In each time period t, we need to decide the capacity increment ∆S j (t), the allocation schedule Y ij (t) and the corresponding unmet demand W i (t). In this subsection, we propose two allocation policies, which can be implemented in different requirements: • Dynamic allocation (DA) policy with a single objective. This policy applies in the scenario where the planner focuses on the minimization of the total cost. • Adaptive dynamic allocation (ADA) policy with multiple objectives. This policy focuses on the case in which the planner has multiple predetermined targets and aims to achieve all these targets within a long time period. This policy is an intuitive allocation policy that solves the following submodel period by period. For each This policy focuses on the minimization of total cost. In practice, planners may have some predetermined targets before making decisions. For example, in humanitarian logistics, they aim to reduce the quantity of the unmet demand to zero. Therefore, in this subsection, we adopt an adaptive dynamic allocation policy, which can achieve all these targets if they are attainable and can obtain a point that is closest to the unattainable target. To better meet the requirements of this problem compared with the dynamic policy in subsection 4.3.1, we consider the following three objectives: varying capacity construction cost, transportation cost, and penalty cost for unmet demand. In addition, other objectives can also be involved, which has no influence on the following analysis. The three objectives are given as follows: a jt ∆S j (t), In a long period of time, the decision-maker aims to address the following multiobjective problem: The function g k (·, d) denotes the kth objective function under scenario d. In problem [AM0], each decision is made at period t using only the historical information available up to period t, i.e., while future information such as {d(t + 1), · · · , d(T )} is unknown. Next, we define the predetermined multiobjective target. Based on the solution of Phase I, we define the multiobjective targets τ = {τ 1 , τ 2 , τ 3 }, where τ 1 = 0, τ 2 = η i∈[I] j∈[J] c ij Y * ij , τ 3 = 0, and Y * denotes the achieved assignment solution of Phase I. After obtaining the initial location and capacity decisions in Phase I, we further explain the values of three targets in Phase II as follows: (1) minimize the total varying capacity expansion cost; (2) ensure that the transportation cost is near the predetermined value in Phase I; and (3) try to decrease the total penalty cost to zero. Let α k (d) be the debt of objective k under scenario d; i.e., the difference between target τ k and g k (·, d), α k (d) := g k (·, d) − τ k . In the beginning of each period t + 1, the average debt of objective k from periods 1 to t is recorded as w k (t + 1); i.e., Essentially, w k is positively correlated with the weight of objective k. If the required target is not achieved, where w k (t + 1) > 0, we need to give higher priorities to objective k. Otherwise, for those w k (t + 1) ≤ 0, their corresponding objectives have already been achieved, and no additional attention is necessary. Altogether, we use the vector w + k (t) = max{0, w k (t)} to quantify the gap between target τ k and the current solution g k (·, d(t)) at period t, which suggests the priority associated with each objective function. Next, we introduce our adaptive dynamic allocation policy. Algorithm 2. Adaptive dynamic allocation policy for capacity planning. • Input: Demand {d(1), d(2), · · · , d(T )}. • Output: Adjusted capacityS * . Step 1: Initialization. Set t = 1, initial weight w(1) = {1, 1, 1}. • Step 2: Solve the subproblem. Step 3: Update weights. For k = 1, 2, 3, we update the weights as follows: Update t = t + 1 and return to Step 2 if t < T ; otherwise, adjust the finalS * j by the incumbent number ∆S j ; thus, exportS * =S * + ∆S(T ). As a minimization problem, g k (·, d(t)) converges to τ k from the top during the iterations; therefore, α k (d) ≥ 0 at the initial stages. Definition (17) indicates that the objectives that deviate much from the corresponding target should receive more weight in the next period. Let g * k be the performance of objective k with the target-based optimal solution to an expected single-period problem; when objective 3 is taken as an example, represent the debt vector of the single-period problem (g * k ) with respect to target k (τ k ). Recall the theorem proposed by Lyu et al. (2019b) , which gives the theoretical performance guarantee of the proposed ADA policy w + (T + 1) and the expected single-period model (w * ) + . Theorem 4.2. (Lyu et al., 2019b) Consider the multiperiod, multiobjective dynamic capacity planning problem [AM0]. Weight vector w(t) under the ADA policy converges to the optimal weight vector w * . Specifically, it satisfies the following: where the expectation in inequality (18) is taken over d 1 , d 2 , ..., d T , and || · || 2 is the Euclidean norm of a vector. Proof. For the details of the proof, we refer readers to Lyu et al. (2019b) . We make the following three remarks about our policy. First, our policy can be used to examine the attainability of any predetermined targets. If the Euclidean norm of the vector w(T + 1) would not converge to 0 as T increases by using the ADA policy, then the corresponding target cannot be attained by any other non-anticipative policies. Second, the ADA policy is indeed nonanticipatory since the average vector w(T + 1) at period (t + 1) is calculated based on the debt from period 1 to t without observing future information. Third, the ADA policy does not require tracking another status of the system and can be easily applied to solve large-scale problems in real time. In this section, we use a case study to verify the efficiency and effectiveness of the proposed approaches. Testing data are generated based on a case study related to the preparedness phase of testing facility location design under pandemic threats. A laptop with an Intel Core 5 Duo 2.2 GB CPU and 4 GB of RAM and running Windows 10 is used to conduct all numerical experiments. We employ CPLEX 12.8 as the MILP, and the procedure terminates with a relative optimality tolerance 10 −4 . With respect to the time during COVID-19 exposure, we combine three sources of data as inputs to find the optimal locations of testing facilities and their corresponding capacity in Beijing, China. The first source is from the COVID-19 Data Repository (Dong et al., 2020) , which is attributed to the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University from GitHub (https://github.com/CSSEGISandData/COVID-19). The database achieved a complete list of all sources related to COVID-19, which includes the time series data of a number of confirmed cases, deaths, and recovered cases. In this paper, we adopt the number of active cases in Beijing from January 21, 2020, to September 27, 2020 (250 days in total). Figure 2 illustrates the critical trend of active COVID-19 cases, in which the peak value is 326, occurring on June 30, 2020. The second source is demographic and economic data from the Chinese census bureau or business investigation. The total population of 333 citywide towns from Beijing based on the 5th national census in 2010 is summarized and is available from China National Knowledge Infrastructure (CNKI The third source is the geographic data from Gaode web API. After the selection of demand sites and facility candidates, we obtain their corresponding longitudes and latitudes via Python 3.6 from Gaode. To better visualize the computational results, boundary data of the 16 districts of Beijing are also obtained in a similar manner. Figure 3 illustrates the locations of candidate facilities (green triangles) and demand sites (black dots), where Figure 3a depicts the distribution of critical nodes across the city, and Figure 3b focuses on details in the downtown area. The candidate facilities can be generally classified into four categories: 3A hospitals, regional hospitals, regional centers for disease control and prevention (CDCs), and commercial testing institutes. Interested readers can find details on facility candidates from Table D .8 of Appendix D. After gathering data from the above data sets, we summarize the input parameters as follows. [J] 66 facility candidates including 3A or regional hospitals, regional CDCs and commercial testing institutes. [I] 333 geographical centers of towns across from Beijing. [T ] 250 days from January 21, 2020, to September 27, 2020. f j see Table D .8 of Appendix D. a jt see Table D .8 of Appendix D. c ij distance between facility candidate j and demand site i (km). η set as 0.001. In Phase I, problem [P2] associated with uncertain demand could be solved by SAA and the OCO-based LR approach. We conduct several numerical experiments to compare the asymptotic consistency and computational efficiency. SAA is solved by CPLEX with a time limit of 3,600 seconds. Note that there are many methods to solve the SAA formulation, such as Benders decomposition. These algorithms do not reduce the complexity of the problem. Therefore, even if these algorithms can improve computational efficiency, the improvement will not be too large. Therefore, for convenience, we choose a commercial solver, i.e., CPLEX, as a benchmark. The number of input demands K is increased from 100 to 5,000; letd i be the expected value observed demand of town i from January 21 to September 27, 2020. d ik is uniformly generated from 20, 30, 40, 50, 66} and I ∈ {50, 100, 150, 200, 250, 333}, which are randomly selected from the 66 facility candidates and 333 town centers. Each instance is run 10 times, and we summarize the average performance. Table 5 indicates that CPLEX could not obtain an optimal solution for the instances when K ≥ 200 within 3,600 seconds, while OCO-based LR can obtain a near-optimal solution with a linearly increasing computational time (see Figure 4) . Generally, scenario-based approaches are not applicable to the decision problems that we work on. We will have a very large number of scenarios, which is time-consuming to compute the average value or expectation. Interestingly, our OCO-based LR can solve the instance with 66 facility candidates and 333 demand sites with 5,000 scenarios within an hour. The last column represents the objective gap between CPLEX and OCO-based LR. For instances with few scenarios, say K = 100, OCO-based LR obtains a near-optimal solution (no more than 0.3% higher than the optimal values) in no more than one minute, while the computational time of CPLEX is more than half an hour. The advantage of OCO-based LR is even significant when K increases. For example, when K = 1000, CPLEX could not obtain any feasible solution within 3,600 seconds, and LR converges in no more than 10 minutes. The results of numerical experiments show the superiority and effectiveness of our algorithm for solving the first-phase problem. To validate the effectiveness of our proposed two-phase framework, we adopt three benchmark policies: DM-F, DM-P, and DA. Although many methods can be used to solve classic settings, such as dynamic programming and Markov decision processes, they are difficult to implement to solve the settings under pandemics, as introduced in Section 1. Therefore, we select our own benchmarks. Specifically, Policy 1 (DM- F) can obtain the ideal optimal solution since it solves the settings in which all future information is known in advance. If our methods can achieve a solution very close to the ideal optimal solution, then we can validate that our method is effective. A total of five methods are implemented to solve the instance introduced above. Table 6 summarizes the inputs and methods that have been employed in each policy, and detailed descriptions of these approaches are listed below. • Policy 1. Deterministic model with full information (DM-F). We solve the multiperiod deterministic model [P1] with perfect knowledge of future demand. That is, it is assumed that all future information is known at the beginning of the first phase. However, it is impossible to obtain such full information in practice. Thus, this policy is treated only as a comparison of others, which provides the optimal solution in an ideal setting. • Policy 2. Deterministic model with predicted information (DM-P). We first apply a forecasting model to predict the future demand and then solve the multiperiod deterministic model [P1] with predicted demand. In this paper, we generate the predicted demand randomly; i.e., the predicted valuê d i (t) is located uniformly in the range of [0.95d t (t), 1.05d i (t)]. • Policy 3. Dynamic allocation policy (DA). We solve the single-period problems iteratively T times, and each problem corresponds to sequentially realized demand d i (t). In addition, the location and capacity strategies obtained at the current time period are set as the inputs of the next time period. • Policy 4. Lagrangian relaxation-based dynamic policy (LR-DA). We apply our two-phase approach to solve the problem. In the first phase, the LR algorithm introduced in section 4.2 is introduced, and the second phase program is approached by the dynamic allocation policy in section 4.3.1. • Policy 5. Lagrangian relaxation-based adaptive dynamic allocation policy (LR-ADA). The difference between Policies 4 and 5 is that we employ the ADA policy (see section 4.3.2) in the second phase of Policy 4. Table 7 summarizes the results of the five policies. The results show that the last three policies have an obvious advantage in computational time. The DA policy takes less time to solve than our two policies since our policies have one more location design and capacity initialization process. In actuality, the computational time of our two policies is acceptable in practice. For the total cost, we define a metric to measure the distance from the last four policies to the optimal one as follows: The DM-P policy achieves a gap of 98.8%, which means that a very small prediction error leads to enormous cost consumption. Therefore, the DM-P policy is not suitable to solve this problem. Our two policies can obtain gaps of 3.4% and 3.3%, which are smaller than the gap of 5.2% obtained by the DA policy. In summary, our two policies obtain the solution with the minimum distance from the ideal optimal solution in a very short time. Specifically, the LR-ADA policy achieves the solution with the minimum total cost. Figure 6 shows the results of location decisions in Phase I, and the background color represents the total population (which is proportional to demand). Note that Policies LR-DA and LR-ADA have the same results, which are plotted in Figure 6 (d). We can observe that our two policies build 34 facilities, more than the other three policies. This is because our policies consider future demand inflation when making location decisions by using a sample set with K scenarios. This can help reduce the varying construction and transportation cost in the future time period. The DA policy only builds 18 facilities during the first time period. However, its construction and transportation widely vary cost. Next, we focus on real-time performance. We define the average cost until time period t, i.e., objective value s . Figure 7 reports the results along the time dimension. Obviously, the DM-P policy incurs most of the cost of the capacity expansion due to an imprecise prediction. The two-phase LR-DA and LR-ADA policies perform well on the metric of varying cost. The transportation cost has a trend similar to the demand trend for all of the policies. Specifically, the LR-DA and LR-ADA policies perform the best, DA takes the second place, and the DM-P policy is in the last place. As unmet demand is not expected, the unit penalty cost p it is assumed to be relatively large. Therefore, the penalty cost of all policies is almost zero, except the DM-P policy, which also has little penalty cost. We define the regret of total cost (TC) as follows: Regret π (t) = For the DA policy, although it performs the best during the first 100 days because of the relatively small fixed cost, it obtains a larger regret than our two policies because of the increment of varying construction and transportation cost. For Figure 8(b) , it is obvious that the regret of the LR-DA policy fluctuates over time, while the LR-ADP policy converges gradually and stabilizes. Finally, compared with LR-DA, LR-ADP obtains a smaller regret, which highlights its superiority. In this paper, we propose a two-phase framework to optimize location and capacity design strategies during pandemics. Decisions pre-and postpandemic are merged in a sequential framework. In the first phase, strategic decisions, such as facility location and capacity initialization, are determined with predicted demand. Instead of solving scenario-based SP by SAA, we creatively develop an OCO approach with Lagrangian multipliers and prove its asymptotic consistency. In the second phase, two allocation policies, DA and ADA, are designed to adjust capacities with respect to fluctuating demands. Compared with the other three traditional policies, our two-phase framework shows great benefits from the perspectives of computational time and performance validation based on a real case study of the COVID-19 situation in Beijing. Several observations can be summarized from the numerical results. • The OCO-based LR method in Phase I overcomes the "curse of dimensionality" by SAA, providing a near-optimal and convergent solution in polynomial time, which dramatically increases computational efficacy. • The two-phase framework prefers relatively robust location solutions (building more facilities at the beginning) and performs much better in terms of transportation and penalty costs while facing real-time demand volatility. • For the two proposed two-phase solution approaches, LR-ADA admits a convergent and stable regret compared with LR-DA, as the asymptotic consistency of ADA has been theoretically proven. We present several limitations that could be further explored in future research. First, although capacity expansion and preventing closure of any constructed facilities are common assumptions in a dynamic facility location and capacity planning problem (Shulman, 1991; Jabbarzadeh et al., 2014; Charles et al., 2016; Yu and Shen, 2020; Vatsa and Jayaswal, 2021) , adding capacity is not always commensurate with the background of pandemics. For example, for large-scale infectious diseases (such as COVID-19) that may have multiple waves and reinfections (Arruda et al., 2021) , capacity initialization can be very costly based on early data. Incorporating new decisions, such as reducing or relocating testing facilities, is a beneficial way to reduce the total operational cost during the entire planning horizon. Second, there are many ways to formulate similar problems that belong to the scope of sequential decision-making with uncertainty (Powell, 2016 (Powell, , 2019a ; indeed, sometimes simpler formulations can be discovered. For example, the MDP formulation and ADP algorithm are possible approaches to solve the proposed problem, and we leave consideration of the MDPbased approach to future research. Finally, official datasets of an epidemic have been criticized for their poor reliability in terms of underestimation (Dyer, 2021) and statistical tests (Silva and Figueiredo Filho, 2021) , which may lead to unrealistic demand scenarios in the model. Thus, it is necessary to improve the reliability of input data before optimization instead of directly implementing open-access datasets. By transforming the above equation, we have, Now, by summing we get: The first inequality follows (A.1). The second inequality follows (A.2). The second equality decomposes K k=1 1 2γ(k) (S k−1 − S * ) 2 − (S k−1 − S * ) 2 into three parts. The third equality uses the fact that ||S k − S * || ≤ ||G|| and 1 2γ(K) (S K − S * ) 2 ≥ 0 Since we define γ(k) := 1 √ k , we obtain, Therefore, we have, It is easy to obtain the desire results. Input: Demand distribution D Output: Location design X * , capacity initialization S * and the initial assignment policy Y * . 1 Generate K demand samples d(k) independently according to the distribution of demand D. 2 Arbitrarily sort the K samples into a sequence. 3 Solve a deterministic model [DM] with the average demand. 4 Set the iteration number n = 0 and initialize X 0 , S 0 , λ 0 i . 5 while min i∈I λ n+1 i − λ n i > do 6 for k = 1, 2, ..., K do 7 Solve the following primal problem given the demand scenariod(k) and the Lagrangian dual multiplier λ n . Solve the dual problem. Update the capacity as S n j (k) := max S n j (k − 1) − γ(k)∇ S n j (k−1) f (·), 0 . Compute the average capacityS n and expected capacity planning quantityȲ n ij on each flow over K scenarios. Update the dual multiplier λ n+1 as λ n+1 is equal to 5.5 · (γ k /1000 +f τ /4), and the operational cost of facility type-τ in district k is γ k /160000 +f τ /160. The longitudes and latitudes of reported nodes are collected from Gaode. Online algorithms: a survey Building disaster preparedness and response capacity in humanitarian supply chains using the social vulnerability index Facility location dynamics: An overview of classifications and applications Modelling and optimal control of multi strain epidemics, with application to covid-19 Dynamic warehouse location analysis Adaptive two-stage stochastic programming with an application to capacity expansion planning Distributionally robust facility location problem under decision-dependent stochastic demand Compromising system and user interests in shelter location and evacuation planning Shelter location and evacuation route assignment under uncertainty: A benders decomposition approach Beijing Municipal Health Commission, 2020a. The list of COVID-19 testing facilities in Beijing Beijing Municipal Health Commission, 2020b. The list of COVID-19 testing facilities in Beijing Beijing Municipal Health Commission, 2021. The list of COVID-19 testing facilities in Beijing Dynamic programming Robust optimization A probabilistic model applied to emergency service vehicle location Neuro-dynamic programming CDC releases detailed history of the 2014-2016 ebola response in mmwr H1N1 pandemic (H1N1pdm09 virus) Prediction, Learning, and Games Designing an efficient humanitarian supply network Network based temporary facility location for the emergency medical services considering the disaster induced demand and the transportation infrastructure in disaster response Full text: Fighting COVID-19: China in action Global tally of confirmed coronavirus cases surpasses 100 million An interactive web-based dashboard to track covid-19 in real time Zika virus in asia Covid-19: Peru's official death toll triples to become world's highest A chance-constrained two-stage stochastic programming model for humanitarian relief network design Stochastic network design for disaster preparedness Dynamic supply chain network design for the supply of blood in disasters: A robust model with real world application Modeling and solving a large-scale generation expansion planning problem under uncertainty Locating temporary shelter areas after an earthquake: A case for turkey Modeling the shelter site location problem using chance constraints: A case study for istanbul Analysis of facility protection strategies against an uncertain number of attacks: The stochastic r-interdiction median problem with fortification A stochastic dynamic programming approach for multi-site capacity planning in tft-lcd manufacturing under demand uncertainty Distributionally robust optimization of an emergency medical service station location and sizing problem with joint chance constraints Capacity allocation in flexible production networks: Theory and applications Multi-objective online ride-matching. Available at SSRN 3356823 Linear programming for large-scale markov decision problems Multi-period stochastic covering location problems: Modeling framework and solution approach A review of mathematical programming models for strategic capacity planning in manufacturing Approximate dynamic programming for lateral transshipment problems in multilocation inventory systems Facility location and supply chain management-a review Dynamic distribution of patients to medical facilities in the aftermath of a disaster Inequity-averse shelter location for disaster preparedness Location and emergency inventory pre-positioning for disaster response operations: Min-max robust model and a case study of yushu earthquake Multi-Period Facility Location Numerical optimization Alternate risk measures for emergency medical service system design The impact of congestion on protection decisions in supply networks under disruptions Probabilistic envelope constrained multiperiod stochastic emergency medical services location model and decomposition scheme Approximate Dynamic Programming: Solving the curses of dimensionality (2nd) A unified framework for optimization under uncertainty The next generation of optimization: A unified framework for dynamic resource allocation problems, in: Optimization in Large Scale Problems A unified framework for stochastic optimization Markov decision processes: discrete stochastic dynamic programming Impacts of epidemic outbreaks on supply chains: mapping a research agenda amid the covid-19 pandemic through a structured literature review Capacity expansion and replacement in growing markets with uncertain technological breakthroughs Pre-positioning of emergency supplies for disaster response Public evacuation decisions and hurricane track uncertainty A strategic and global manufacturing capacity management optimisation model: A scenario-based multi-stage stochastic programming approach Online learning and online convex optimization Lectures on Stochastic Programming: Modeling and Theory The reliable facility location problem: Formulations, heuristics, and approximation algorithms Dynamic relief-demand management for emergency logistics operations under large-scale disasters An algorithm for solving dynamic capacitated plant location problems with discrete expansion sizes Using benfords law to assess the quality of covid-19 register data in brazil Dantzig-wolfe decomposition for solving multistage stochastic capacityplanning problems Facility location under uncertainty: a review Humanitarian logistics Commissioned paper: Capacity management, investment, and hedging: Review and recent developments Capacitated multi-period maximal covering location problem with server uncertainty Prepositioning disaster relief supplies using robust optimization Capacity planning with technology replacement by stochastic dynamic programming A two-stage stochastic programming framework for evacuation planning in disaster responses Location and emergency inventory pre-positioning for disaster response operations: Min-max robust model and a case study of yushu earthquake Disaster risk management models for rural relocation communities of mountainous southwestern china under the stress of geological disasters Rollout algorithms for resource allocation in humanitarian logistics Novel methods for resource allocation in humanitarian logistics considering human suffering On the value of multistage stochastic facility location with (or without) risk aversion. Working paper Multistage distributionally robust mixed-integer programming with decision-dependent momentbased ambiguity sets A novel probabilistic formulation for locating and sizing emergency medical service stations Online convex programming and generalized infinitesimal gradient ascent Proof. For simplicity, we use f k (S k−1 ) to replace f n k (S(k − 1), λ n ,d(k)) here. First, let us define:Therefore, we have,The detail procedure of OCO-based LR is presented as follows:Appendix C. The pseudocode of adaptive dynamic allocation policyThe detail procedure of adaptive dynamic allocation policy is presented as follows:Input: Demand {d(1), d(2), · · · , d(T )} Output: Adjusted capacityS * 1 Set t = 1, initial weight w(1) = {1, 1, 1}. Table D .8. We classify the sixty-six facility candidates into four types; let τ represent the facility type, and let τ = 1, 2, 3, 4 correspond to a 3A hospital, a regional hospital, a regional CDC and a commercial testing institute. Assuming the fixed operational cost of a type-τ facility isf τ , thenf 1 = 200,f 2 = 150,f 3 = 100, andf 4 = 50. Since there are 16 districts in Beijing, let γ k be the average house price of district k (k = 1, · · · , 16); then, the construction cost of facility type τ in district k