Online Facility Location with Predictions

opt xi ) . Our algorithm overcomes the fundamental Ω ( lognlog logn ) lower bound of OFL ( without predictions ) when η∞ is small , and it still maintains O ( log n ) ratio even when η∞ is unbounded . Furthermore , our theoretical analysis is supported by empirical evaluations for the tradeoffs between η∞ and the competitive ratio on various real datasets of different types . 1 INTRODUCTION . We study the online facility location ( OFL ) problem with predictions . In OFL , given a metric space ( X , d ) , a ground set D ⊆ X of demand points , a ground set F ⊆ X of facilities , and an opening cost function w : F → R+ , the input is a sequence of demand points X : = ( x1 , . . . , xn ) ⊆ D , and the online algorithm must irrevocably assign xi to some open facility , denoted as fi , upon its arrival , and an open facility can not be closed . The goal is to minimize the following objective∑ f∈F w ( f ) + ∑ xi∈X d ( xi , fi ) , where F is the set of open facilities . Facility location is a fundamental problem in both computer science and operations research , and it has been applied to various domains such as supply chain management ( Melo et al. , 2009 ) , distribution system design ( Klose & Drexl , 2005 ) , healthcare ( Ahmadi-Javid et al. , 2017 ) , and more applications can be found in surveys ( Drezner & Hamacher , 2002 ; Laporte et al. , 2019 ) . Its online variant , OFL , was also extensively studied and well understood . The state of the art is an O ( lognlog logn ) -competitive deterministic algorithm proposed by Fotakis ( 2008 ) , and the same work shows this ratio is tight . We explore whether or not the presence of certain natural predictions could help to bypass the O ( lognlog logn ) barrier . Specifically , we consider the setting where each demand point xi receives a predicted facility fpredxi that is supposed to be xi ’ s assigned facility in the ( offline ) optimal solution . This prediction is very natural , and it could often be easily obtained in practice . For instance , if the dataset is generated from a latent distribution , then predictions may be obtained by analyzing past data . Moreover , predictions could also be obtained from external sources , such as expert advice , and additional features that define correlations among demand points and/or facilities . Previously , predictions of a similar flavor were also considered for other online problems , such as online caching ( Rohatgi , 2020 ; Lykouris & Vassilvitskii , 2021 ) , ski rental ( Purohit et al. , 2018 ; Gollapudi & Panigrahi , 2019 ) and online revenue maximization ( Medina & Vassilvitskii , 2017 ) . 1.1 OUR RESULTS . Our main result is a near-optimal online algorithm that offers a smooth tradeoff between the prediction error and the competitive ratio . In particular , our algorithm is O ( 1 ) -competitive when the predictions are perfectly accurate , i.e. , fpredxi is the nearest neighbor of xi in the optimal solution for every 1 ≤ i ≤ n. On the other hand , even when the predictions are completely wrong , our algorithm still remains O ( log n ) -competitive . As in the literature of online algorithms with predictions , our algorithm does not rely on the knowledge of the prediction error η∞ . Theorem 1.1 . There exists an O ( min { log n , max { 1 , log nη∞OPT } } ) -competitive algorithm for the OFL with predictions , where η∞ : = max1≤i≤n d ( fpredxi , f opt xi ) measures the maximum prediction error , and foptxi is the nearest neighbor of xi from the offline optimal solution OPT 1 . Indeed , we can also interpret our result under the robustness-consistency framework which is widely considered in the literature of online algorithms with predictions ( cf . Lykouris & Vassilvitskii ( 2021 ) ) , where the robustness and consistency stand for the competitive ratios of the algorithm in the cases of arbitrarily bad predictions and perfect predictions , respectively . Under this language , our algorithm is O ( 1 ) -consistent and O ( log n ) -robust . We also remark that our robustness bound nearly matches the lower bound for the OFL without predictions . One might wonder whether or not it makes sense to consider a related error measure , η1 : =∑n i=1 d ( f pred xi , f opt xi ) , which is the total error of predictions . Our lower bound result ( Theorem 1.2 ) shows that a small η1 is not helpful , and the dependence of η∞ in our upper bound is fundamental ( see Section F for a more detailed explanation ) . The lower bound also asserts that our algorithm is nearly tight in the dependence of η∞ . Theorem 1.2 . Consider OFL with predictions with a uniform opening cost of 1 . For every η∞ ∈ ( 0 , 1 ] , there exists a class of inputs , such that no ( randomized ) online algorithm is o ( log nη∞ OPT log logn ) - competitive , even when η1 = O ( 1 ) . As suggested by an anonymous reviewer , it might be possible to make the error measure η∞ more “ robust ” by taking “ outliers ” into account . A more detailed discussion on this can be found in Section G. Empirical evaluation . We simulate our algorithm on both Euclidean and graph ( shortest-path ) datasets , and we measure the tradeoff between η∞ and the empirical competitive ratio , by generating random predictions whose η∞ is controlled to be around some target value . We compare with two baselines , the O ( log n ) -competitive algorithm by Meyerson ( 2001 ) which do not use the prediction at all , and a naive algorithm that always trusts the prediction . Our algorithm significantly outperforms Meyerson ’ s algorithm when η∞ → 0 , and is still comparable to Meyerson ’ s algorithm when η∞ is large where the follow-prediction baseline suffers a huge error . We observe that our lead is even more significant on datasets with non-uniform opening cost , and this suggests that the prediction could be very useful in the non-uniform setting . This phenomenon seems to be counter-intuitive since the error guarantee η∞ only concerns the connection costs without taking the opening cost into consideration ( i.e. , it could be that a small η∞ is achieved by predictions of huge opening cost ) , which seems to mean the prediction may be less useful . Therefore , this actually demonstrates the superior capability of our algorithm in using the limited information from the predictions even in the non-uniform opening cost setting . 1When the context is clear , we also use OPT to denote the optimal solution . Finally , we test our algorithm along with a very simple predictor that does not use any sophisticated ML techniques or specific features of the dataset , and it turns out that such a simple predictor already achieves a reasonable performance . This suggests that more carefully engineered predictors in practice is likely to perform even better , and this also justifies our assumption of the existence of a good predictor . Comparison to independent work . A recent independent work by Fotakis et al . ( 2021a ) considers OFL with predictions in a similar setting . We highlight the key differences as follows . ( i ) We allow arbitrary opening cost w ( · ) , while Fotakis et al . ( 2021a ) only solves the special case of uniform facility location where all opening costs are equal . This is a significant difference , since as we mentioned ( and will discuss in Section 1.2 ) ) , the non-uniform opening cost setting introduces outstanding technical challenges that require novel algorithmic ideas . ( ii ) For the uniform facility location setting , our competitive ratio is O ( log nη∞OPT ) = O ( log nη∞ w ) , while the ratio in Fotakis et al . ( 2021a ) is log ( err0 ) log ( err−11 log ( err0 ) ) , where err0 = nη∞/w , err1 = η1/w and w is the uniform opening cost . Our ratio is comparable to theirs when η1 is relatively small . However , theirs seems to be better when η1 is large , and in particular , it was claimed in Fotakis et al . ( 2021a ) that the ratio becomes constant when err1 ≈ err0 . Unfortunately , we think this claim contradicts with our lower bound ( Theorem 1.2 ) which essentially asserts that η1 = O ( η∞ ) is not helpful for the ratio . Moreover , when η1 is large , we find their ratio is actually not well-defined since the denominator log ( err−11 log ( err0 ) ) is negative . Therefore , we believe there might be some unstated technical assumptions , or there are technical issues remaining to be fixed , when η1 is large . Another independent work by Panconesi et al . ( 2021 ) considers a different model of predictions which is not directly comparable to ours . Upon the arrival of i-th demand point , a set of multiple predictions Si is provided , each suggesting a list of facilities to be opened . Their algorithm achieves a cost of O ( log ( |⋃i Si| ) OPT ( ⋃i Si ) ) where OPT ( ⋃i Si ) ) is the optimal using only facilities in⋃ i Si , and the algorithm also has a worst-case ratio of O ( lognlog logn ) in case the predictions are inaccurate . Similar to the abovemention Fotakis et al . ( 2021a ) result , this result only works for uniform opening cost while ours work for arbitrary opening costs . 1.2 TECHNICAL OVERVIEW . Since we aim for a worst-case ( i.e. , when the predictions are inaccurate ) O ( log n ) ratio , our algorithm is based on an O ( log n ) -competitive algorithm ( that does not use predictions ) by Meyerson ( 2001 ) , and we design a new procedure to make use of predictions . In particular , upon the arrival of each demand point , our algorithm first runs the steps of Meyerson ’ s algorithm , which we call the Meyerson step , and then runs a new procedure ( proposed in this paper ) to open additional facilities that are “ near ” the prediction , which we call the Prediction step . We make use of the following crucial property of Meyerson ’ s algorithm . Suppose before the first demand point arrives , the algorithm is already provided with an initial facility set F̄ , such that for every facility f∗ opened in OPT , F̄ contains a facility f ′ that is of distance η∞ to f∗ , then Meyerson ’ s algorithm is O ( log nη∞OPT ) -competitive . To this end , our Prediction step aims to open additional facilities so that for each facility in OPT , the algorithm would soon open a close enough facility . Uniform opening cost . There is a simple strategy that achieves this goal for the case of uniform opening cost . Whenever the Meyerson step decides to open a facility , we further open a facility at the predicted location . By doing so , we would pay twice as the Meyerson algorithm does in order to open the extra facility . As a reward , when the prediction error η∞ is small , the extra facility would be good and close enough to the optimal facility . Non-uniform opening cost . Unfortunately , this strategy does not extend to the non-uniform case . Specifically , opening a facility exactly at the predicted location could be prohibitively expensive as it may have huge opening cost . Instead , one needs to open a facility that is “ close ” to the prediction , but attention must be paid to the tradeoff between the opening cost and the proximity to the prediction . The design of the Prediction step for the non-uniform case is the most technical and challenging of our paper . We start with opening an initial facility that is far from the prediction , and then we open a series of facilities within balls ( centered at the prediction ) of geometrically decreasing radius , while we also allow the opening cost of the newly open facility to be doubled each time . We stop opening facilities if the total opening cost exceeds the cost incurred by the preceding Meyerson step , in order to have the opening cost bounded . We show that our procedure always opens a “ correct ” facility f̂ that is Θ ( η∞ ) apart to the corresponding facility in OPT , and that the total cost until f̂ is opened is merely O ( OPT ) . This is guaranteed by the gradually decreasing ball radius when we build additional facilities ( so that the “ correct ” facility will not be skipped ) , and that the total opening cost could be bounded by that of the last opened facility ( because of the doubling opening cost ) . Once we open this f̂ , subsequent runs of Meyerson steps would be O ( log nη∞OPT ) -competitive .

Summary: This paper studies the classical online facility location problem in a metric space. Given a new demand in this space, the algorithm will either open a new facility by paying an opening cost $w(f)$ and assign the demand node to this facility, or it will assign the demand node to an existing open facility. The cost incurred by the algorithm is the sum of all the opening costs and assignment costs.  In this paper, the authors consider the setting where, along with every demand node, we are also given a prediction on which facility it gets assigned to in the optimal. Such predictions can potentially be acquired through historical data.   Their main contribution is an online algorithm for facility location with predictions that has a near-optimal competitive ratio. The competitive ratio relies on a parameter $\eta_\infty$ which is simply the largest prediction error, where prediction error for any demand point is the distance between the predicted facility and the facility that is assigned to the demand in the optimal solution. Intuitively, the authors show that if the predictions are accurate (i.e., $\eta_\infty$ is small), then their algorithm is $O(1)$-competitive. On the other hand, if the predictions are highly inaccurate, the algorithm will become $O(\log n)$ competitive.   The algorithm relies on an $O(\log n)$ competitive worst-case optimal (randomized) online algorithm by Meyerson. The idea becomes very simple when facilities have uniform opening costs: Suppose Meyerson’s algorithm opens a facility, one can simply also open a facility at the predicted location. By doing so, the cost incurred will not be more than twice that of Meyerson’s algorithm which is $O(\log n)$-competitive. However, when the predictions are accurate, opening the facilities at predicted locations lead to better future assignments leading to $O(1)$-competitive algorithm.  They extend this approach in a non-trivial way to the case with non-uniform opening costs.