A Nearly Optimal Deterministic Algorithm for Online Transportation Problem
Abstract
For the online transportation problem with server sites, it has long been known that the competitive ratio of any deterministic algorithm is at least . Kalyanasundaram and Pruhs conjectured in 1998 that a deterministic -competitive algorithm exists for this problem, a conjecture that has remained open for over two decades.
In this paper, we propose a new deterministic algorithm for the online transportation problem and show that it achieves a competitive ratio of at most . This is the first -competitive deterministic algorithm, coming close to the lower bound of within a constant factor.
Keywords and phrases:
Online algorithms, Competitive analysis, Online metric matching, Online weighted matching, Online minimum weight perfect matching, Online transportation problem, Online facility assignment, Greedy algorithmCategory:
Track A: Algorithms, Complexity and GamesCopyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Online algorithmsFunding:
This work was partially supported by Japan Science and Technology Agency (JST) as part of Adopting Sustainable Partnerships for Innovative Research Ecosystem (ASPIRE), Grant Number JPMJAP2302.Editors:
Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele PuppisSeries and Publisher:

1 Introduction
1.1 Background
The online transportation problem (), also known as the online facility assignment, was introduced by Kalyanasundaram and Pruhs [12]. In this problem, servers are placed at sites on a metric space and an online algorithm receives (at most) requests one-by-one in an online manner. The number of servers at one site is considered its capacity. The task of an online algorithm is to assign each request irrevocably and immediately to one of the available servers. The cost of assigning a request to a server is determined by the distance between them. The objective of the problem is to minimize the sum of the costs of assigning all requests. We denote the problem as when there are servers and server sites.
The online transportation problem finds application in various scenarios. Here are two examples: In the first example, we regard a server site as a hospital, a hospital’s capacity as the number of beds it has, and a request as a patient. This problem can then be viewed as a problem of finding a way to assign patients to hospitals so that patients are transported to the hospital as close as possible. In the second example, we regard a server site as a car station, a capacity of the car station as the number of cars it can accommodate, and a request as a user of this car sharing service. The problem can then be viewed as a problem of designing a car sharing service that allows users to use car stations as close as possible.
The online metric matching (), or online weighted matching, is a special case of in which servers are placed at distinct sites, i.e., each server has unit capacity. Let denote with servers. Kalyanasundaram and Pruhs [10] and Khuller et al. [14] independently showed that for , the competitive ratio of any deterministic algorithm is at least . This immediately leads to a lower bound of on the competitive ratio of any deterministic algorithm for . Furthermore, they also proposed a -competitive algorithm for called Permutation in [10]. From this result, the Permutation algorithm could be expected to have a matching upper bound of on the competitive ratio for . However, Kalyanasundaram and Pruhs [11] reported without proofs that the competitive ratio of Permutation is and that the competitive ratio of the natural greedy algorithm is . These results imply the existence of a large gap between the upper bound and lower bound on the competitive ratio for . Since , when is sufficiently larger than , e.g., , this gap becomes even more pronounced. Based on this discussion, they posed the following conjecture.
Conjecture 1 (Kalyanasundaram and Pruhs [11]).
For , what is the optimal competitive ratio in terms of ? It seems that there should be a -competitive algorithm.
Since the publication of this conjecture, there have been many studies of and . Among them, Nayyar and Raghvendra [17] proved that the competitive ratio of the Robust-Matching algorithm [19] is , thereby reducing the upper bound on the competitive ratio for to . However, neither the upper nor the lower bounds on the competitive ratio have been improved since then.
1.2 Our contributions
In this paper, we propose a new deterministic algorithm called Subtree-Decomposition and show that it is -competitive for with server sites. This is the first deterministic algorithm achieving -competitiveness within a constant factor of Conjecture 1, significantly reducing the upper bound on the competitive ratio for from to . Given that the lower bound for is known to be , our algorithm achieves the best competitive ratio in terms of its order with respect to (and ). Furthermore, our algorithm processes each request in time, whereas the Robust-Matching algorithm, which has a competitive ratio of , requires time per request [19, Theorem 6]. In other words, when is close to (e.g. ), although the upper bounds and differ by only a poly-logarithmic factor, our algorithm is computationally more efficient than Robust-Matching.
We also develop a generic method to convert an algorithm designed for tree metrics into one for general metric spaces without significantly degrading the competitive ratio. This method can be applied to designing an online algorithm for optimization problems on a metric space, such as .
1.3 Our techniques
Reduction to a special class of instances
First, we will explain how to reduce the task of designing an -competitive algorithm for general instances of to the task of designing an algorithm for more specific instances. To this end, let us begin by defining two special cases of and introducing the concept of T-strong competitive ratio, which serves as a stricter performance measure for algorithms compared to the standard competitive ratio.
The first special case of is where each request is placed on the same position as a server (denoted by ) and the second one is a further special case of called online matching on a power-of-two tree metric (denoted by ). In this problem, a metric space is induced by a weighted tree in which the weight of each edge is a non-negative integer power of two, and the set of server sites coincides with the set of vertices. Let denote with servers and denote with a metric space . Note that is the number of servers in .
The T-strong competitive ratio is defined for on a tree metric (the “T” is derived from “tree”). While the standard competitive ratio measures both the cost of the algorithm and the cost of the optimal offline algorithm in terms of the sum of the edge weights along the path between requests and servers (commonly referred to as the “path distance”), the T-strong competitive ratio measures the algorithm’s cost using the path distance, whereas the cost of the optimal offline algorithm is measured using the weight of the heaviest edge on the path between the requests and servers (referred to as the “max-weight distance”). In other words, we say that an algorithm is T-strongly -competitive if, for any instance of on a tree metric, the cost incurred by the algorithm, measured by the path distance, is at most times the optimal offline cost measured by the max-weight distance. Since the max-weight distance is shorter than the path distance, the T-strong competitive ratio is greater than the standard competitive ratio in general.
In this paper, we demonstrate that if a greedy-like algorithm that only uses the positions of a current request and current available server sites (referred to as MPFS [9]222 MPFS is a class of algorithms that generalize the greedy algorithm (see Definition 6 for details). ) is designed to be T-strongly -competitive for with servers, it can be transformed into an -competitive algorithm for (Theorem 9). The proof is completed by establishing the following three claims:
-
(1)
If there exists a T-strongly -competitive algorithm for with servers, then there exists an -competitive algorithm for .
-
(2)
If there exists an -competitive algorithm for , then there exists an -competitive algorithm for .
-
(3)
If a certain MPFS algorithm is -competitive for , then that algorithm is -competitive for .
Claim (2) was previously proven by Meyerson et al. [16], and Claim (3) was proven by Harada et al. [9]. In this paper, we prove Claim (1). To this end, we begin by noting that it suffices to demonstrate a method for obtaining an -competitive algorithm for with a general -point metric space by using a T-strongly -competitive algorithm for on a tree metric (where the edge weights are not necessarily powers of two).
Next, we explain how to convert algorithm , which is T-strongly -competitive for a tree metric, into algorithm , which is -competitive for a general -point metric space . first treats the given metric space as a weighted complete graph, where the weight of each edge corresponds to the distance between its endpoints. then finds a minimum spanning tree (MST) of this graph and simulates algorithm on .
The key fact to prove that is -competitive for a general metric space is that the distance between any two points in the original metric space lies between the max-weight distance and the path distance on the MST . Using this fact, we can verify that is -competitive as follows: First, the ’s cost measured by the distance in is at most the ’s cost measured by the path distance on . Then, by the T-strong competitiveness of , the ’s cost measured by the path distance is at most times the optimal offline cost measured by the max-weight distance. Since the optimal offline cost measured by the max-weight distance is not greater than the optimal offline cost measured by the distance in , it follows that the ’s cost is at most times the optimal offline cost measured by the distance in .
Finally, we briefly explain why the distance in the original metric space lies between the max-weight distance and the path distance on the MST . By the triangle inequality, the distance in is at most the path distance. To see that the distance in is at least the max-weight distance, consider that if the distance in between two points and were smaller than the max-weight distance on , one could create a spanning tree with a smaller weight by adding edge to and removing the heaviest edge on the - path in . This would contradict being an MST.
The above discussion reduces the task of designing an -competitive algorithm for to designing a T-strongly -competitive MPFS algorithm for with servers.
Overview of our algorithm
In the following, we provide an overview of the T-strongly -competitive algorithm for with servers, which we refer to as Subtree-Decomposition (SD). Note that in , the set of vertices coincides with the set of servers, meaning that .
The proposed algorithm is based on a simple depth-first search (DFS) algorithm. The DFS-based algorithm begins by arbitrarily selecting one vertex in as the root before receiving any requests. When a request arrives at a vertex, the algorithm performs a DFS starting from that vertex, and assigns the request to the first available server it encounters.
Intuitively, one can understand why the T-strong competitive ratio of this DFS-based algorithm is at most when the given tree is unweighted (where each edge has unit weight) as follows: The nature of DFS ensures that any edge will be traversed at most twice by the algorithm’s assignments. In instances where there exist edges traversed more than twice, the optimal offline cost also increases in proportion to the number of such edges, resulting in a sufficiently small ratio of the algorithm’s cost to the optimal offline cost333Note that this statement is imprecise, as discussed and justified in this paper through the analysis via “hybrid algorithm” [7].. Thus, the algorithm’s cost measured by the path distance is roughly . On the other hand, for any request sequence where the algorithm incurs a non-zero cost, the optimal offline cost measured by the max-weight distance is at least 1. Therefore, the ratio of the algorithm’s cost measured by the path distance to the optimal offline cost measured by the max-weight distance is .
However, naive application of this algorithm to a weighted tree results in inefficiencies. For instance, if a request occurs at a vertex where the edges connecting it to its children have very large weights, while the edge connecting it to its parent has a very small weight, the algorithm will prioritize assigning the request to a more costly child. To address this inefficiency, SD performs a stepwise DFS, assigning the request at vertex to the first available server it encounters by prioritizing the exploration of lighter edges. Specifically, SD proceeds as follows:
-
(1)
Perform a DFS from , restricted to edges with weights no greater than 1.
-
(2)
If no available server is found in step 1, return to and perform another DFS, this time restricted to edges with weights no greater than 2.
-
(3)
In subsequent steps, double the threshold for edge weights and perform a DFS from until an available server is found.
Below, we provide an intuitive explanation for why SD is T-strongly -competitive for with servers. Let be the weight of the heaviest edge used in the optimal offline assignment. In this case, the optimal offline cost measured by the max-weight distance is at least . SD is designed to minimize the number of times it traverses heavy edges, and it can be shown that no edge with weight greater than is traversed in SD’s assignment. Furthermore, an edge with weight exactly is traversed at most twice by the nature of DFS. Similarly, edges with weight are traversed up to two times during the -th DFS and another two times during the final -th DFS, for a total of four traversals. Extending this reasoning, for each , the number of traversals for an edge with weight in SD’s assignment is expected to be at most . Therefore, the algorithm’s cost measured by the path distance is roughly at most , and the ratio to the optimal offline cost measured by the max-weight distance is .
1.4 Related Work
Online Metric Matching on a Line.
A line metric is one of the most interesting and well-studied metric spaces for these problems. In particular, on a line has been actively researched [15, 7, 2, 3, 20]. The best upper bound on the competitive ratio for on a line is [20], which is achieved by the Robust-Matching algorithm [19], and the best lower bound on the competitive ratio [18] is , where denotes the number of servers. Note that the lower bound can also be applied to any randomized algorithm for on a line. As can be seen from the above, the best possible competitive ratio for on a line has remained open.
There are also some studies on on a line. Ahmed et al. [1] addressed competitive analysis for on a line under the assumption that the server sites are evenly placed and each site has the same capacity. Under this assumption, they showed (with rough proofs) that the natural greedy algorithm is -competitive and the Permutation algorithm (called Optimal-fill in their paper) is -competitive for any . On the other hand, Harada and Itoh [8] studied on a line with a general layout of servers. They proposed an -competitive algorithm called PTCP (Policy Transition at Critical Point), where is the ratio of the diameter of a set of server sites to the maximum distance between two adjacent server sites. They also constructed a layout of servers where PTCP has a constant competitive ratio while Permutation (or Optimal-Fill) has at least an competitive ratio.
Online Transportation Problem with a Weaker Adversary.
For , models with a weaker adversary have also been well analyzed. Here, we will introduce two previous studies. Kalyanasundaram and Pruhs [12] studied under the weakened adversary model where the adversary has only half as many capacities of each server site as the online algorithm and the length of a request sequence is at most . They showed that the greedy algorithm is -competitive and presented an -competitive algorithm under this model. Chung et al. [5] also studied under another weakened adversary where the adversary has one less capacity of each server site against the online algorithm. Under this model, they presented an -competitive deterministic algorithm on an -HST [5] metric where and an -competitive randomized algorithm on a general metric.
Randomized Algorithms for Online Metric Matching.
There are also many studies on randomized algorithms for . For a general metric space, Meyerson et al. [16] showed the lower bound and the upper bound on the competitive ratio for with servers. The upper bound was improved to be by Bansal et al. [4]. As can be seen from the above, there still has been a gap between the upper bound and the lower bound for . For doubling metrics, Gupta and Lewi [7] showed an -competitive randomized algorithm.
Randomized algorithms for have not been studied for a long time, but recently Kalyanasundaram et al. [13] proposed an -competitive algorithm.
Stochastic Online Metric Matching.
Raghvendra [19] considered under the random arrival model in which the adversary chooses the set of request locations at the start but the arrival order is a permutation chosen uniformly at random from the set of all possible permutations. He proposed an algorithm called Robust-Matching and showed that it is -competitive and best possible for under the random arrival model, where denotes the -th harmonic number. Furthermore, Robust-Matching also has the best possible competitive ratio of under the normal adversarial model.
Gupta et al. [6] considered under online i.i.d. arrivals. In this model, requests are drawn independently from a known probability distribution over a metric space. They proposed an algorithm called FAIR-BIAS and showed that it is -competitive for a general metric space and -competitive for a tree metric under this model.
2 Preliminaries
2.1 Definition of Problems
In this section, we define the online metric matching, the online transportation and their variants.
Online Metric Matching
To begin with, we define the online metric matching (denoted by ). An instance of is represented by a quadruple , where is a set of points, is a distance function on , is a finite subset of , and . An element of is called a server and the -th entry of is called the request at time or -th request.
, and are given to an online algorithm in advance, while requests are given one-by-one from to . At each step, an online algorithm for maintains “assignment” that is initialized to . When a request is revealed, must assign to one of the available servers irrevocably. If is assigned to the server , then the pair is added to the current assignment and the cost is incurred for this pair. The cost of the assignment is the sum of the costs of all the pairs contained in it. The goal of an online algorithm is to minimize the cost of the final assignment.
We use the following notation on .
-
(1)
denotes with servers.
-
(2)
denotes where requests arrive at the position of some server, i.e., . We simply write an instance of as instead of .
-
(3)
denotes with servers.
Two Metrics on Edge-Weighted Trees
Before presenting online metric matching on a power-of-two tree metric, we first introduce the definitions and notations for the two distance functions used for edge-weighted trees. For an edge-weighted tree , we use to denote the path distance on , i.e., for any , where denotes the unique simple path in from to . In this paper, we define another distance on as follows:
We call the max-weight distance on . It is easy to verify that defines a metric on when each edge has a positive weight. By the above definition, we can observe the following relationship between the path distance and the max-weight distance.
Remark 2.
For any edge-weighted tree and any , we have
where denotes the path distance on and denotes the max-weight distance on .
Online Matching on a Power-of-two Tree Metric
Then, we introduce a notion of power-of-two weighted tree and define a special case of called online matching on a power-of-two tree metric (denoted by ).
Definition 3 (Power-of-two Weighted Tree).
Let be a tree and be a weight function of . We say that is a power-of-two weighted tree if for any , there exists a non-negative integer such that .
Definition 4 (Power-of-two Tree Metric).
We say that a metric space is a power-of-two tree metric if there exists a power-of-two weighted tree such that and . In this case, we also say that is induced by .
The online matching on a power-of-two tree metric is a variant of the online metric matching problem where a metric space is induced by a power-of-two weighted tree and a set of servers is . In other words, an instance of is an instance of such that and .
For a power-of-two weighted tree , denotes where the metric space is induced by . We simply write an instance of as instead of for .
Online Transportation Problem
Finally, we define the online transportation problem (denoted by ). In this problem, servers are clustered in specific locations called server sites. The number of servers at a server site is called the capacity of that site. Assume that each site has a capacity of at least 1. An instance of is represented by a quintuple . Here, represents the metric space, represents the set of server sites, represents the capacity of each site, and represents the request sequence444 For , the number of requests is generally set to be at most . As can be seen from [9, Lemma 2.1], however, the assumption that the number of requests is exactly has no effect on the competitive analysis. . is the same as except that an online algorithm can assign up to requests to one server site . In other words, can be viewed as a special case of where and each site has unit capacity. We use to denote with servers and server sites.
2.2 Notation and Terminology
Let be any instance of , be the -th request of and be any online algorithm for . We use to denote the server to which assigns when processing . Let be the total cost incurred when processes , i.e.,
denotes the optimal offline algorithm, i.e., knows the entire in advance and assigns to to minimize the total cost . At any step of the execution of an online algorithm, a server site is called free if the number of requests assigned to it is less than its capacity, and full otherwise. Let be the set of all free server sites just after assigns to a server. We say that is -competitive if for any instance of . The competitive ratio of is defined to be the infimum of such that is -competitive, i.e., . In this paper, we consider only algorithms that, when a request arrives at the position of a free server site, assign to that site555 Algorithms that do not satisfy this condition are known to be not -competitive for any . .
For an instance of , we simply say that a server is free when no request is assigned to it, and full otherwise. In other respects, we use the same notation and terminology as in .
2.3 Technical Lemmas from Prior Work
In this section, we present two prior results that play crucial roles in achieving our objective of designing an -competitive deterministic algorithm for . The following theorem claims that if there exists an -competitive algorithm for , then there also exists an -competitive algorithm for .
Theorem 5 (Meyerson et al. [16]).
If there exists an -competitive algorithm for , then there exists a -competitive algorithm for .
The algorithm is designed as follows: When a request arrives, it is first moved to the nearest server site (not necessarily available), and then assigned to a server according to .
Next, we introduce a class of algorithms for called MPFS (Most Preferred Free Servers) and remark that to design an -competitive algorithm for , it suffices to design an -competitive MPFS algorithm for .
Definition 6 (MPFS Algorithm [9]).
Let be a deterministic online algorithm for . We say that is an MPFS (most preferred free servers) algorithm if it deals with a request sequence as follows:
-
(1)
For each , the priority (with no ties) of all server sites for is determined by only the positions of and all server sites ,
-
(2)
assigns to a server with the highest priority among all free server sites .
Let be the class of MPFS algorithms for . By its definition, given a new request and a set of current free server sites, an MPFS algorithm uniquely determines a server to which is assigned. We use to denote such , i.e., a server to which assigns when is a set of free server sites. For any MPFS algorithm, it is immediate that the following remark holds.
Remark 7.
Let and . If , then .
Moreover, the following strong theorem [9] is known for MPFS algorithms.
Theorem 8 (Harada et al. [9, Corollary 3.10]).
Let and suppose that is -competitive for , where is a non-decreasing function of . Then, for any , is -competitive for .
Proof Sketch.
For simplicity, consider an instance where , i.e., the number of requests and servers is . By Hall’s theorem, we can “partition” the request sequence into request sequences for , such that both and assign requests in to distinct server sites.
By the definition of the MPFS algorithm, when executing the instance for (i.e., when all server sites have unit capacity), each request is assigned to the same server site as in the original execution of . Thus, we have . Similarly, by optimality, we also have . Therefore, is an upper bound on the competitive ratio of . This implies that the competitive ratio of for dominates the competitive ratio for .
3 T-strong competitive ratio for Tree Metrics
In this section, we introduce a new concept of T-strong competitive ratio for to represent the performance of an algorithm and show that T-strong competitiveness for is closely related to standard competitiveness for . The most important result in this section is the following theorem. Thanks to this theorem, our goal of designing an -competitive algorithm for is reduced to designing a T-strongly -competitive MPFS algorithm for with servers.
Theorem 9.
If there exists a T-strongly -competitive MPFS algorithm for with servers, then there exists a -competitive algorithm for , where is a non-decreasing function.
We begin with defining T-strong competitiveness. Hereafter, we use to denote the optimal offline algorithm where the cost of assigning a request to a server is measured by the max-weight distance on .
Definition 10 (T-strong competitive ratio).
Let be any instance of and denote the minimum cost of assigning all requests to servers, where the cost is measured by the max-weight distance on . We say that an algorithm is T-strongly -competitive if, for any instance of , it follows that where the cost is measured by the path distance on . In addition, the T-strong competitive ratio of is defined to be the infimum of such that is T-strongly -competitive.
Remark 11.
In the rest of this paper, the cost of an algorithm is generally measured by the path distance, unless we specifically use the notations or .
Remark 12.
By Remark 2, we have . Therefore, if an algorithm is T-strongly -competitive for , then is also -competitive for .
The following theorem presents a method to convert a T-strongly -competitive algorithm for into a -competitive algorithm for with a general metric.
Theorem 13.
If there exists a T-strongly -competitive algorithm for , then there exists a -competitive algorithm for .
The proof is given in Theorem 13 of the full version. Here, we only describe the definition of . first constructs a power-of-two weighted tree by using and then simulates with input instance . Now we describe how to construct by using . First, we represent the -point metric space as an edge-weighted -vertex complete graph in which each edge has a weight . Let be a minimum spanning tree of the . Next, we obtain a power-of-two weighted tree by adjusting the edge weights of the as follows: for each edge , if , then , i.e., .
4 New Algorithm: Subtree-Decomposition
In this section, we propose a new MPFS algorithm for called Subtree-Decomposition (SD). In the subsequent sections, we use to denote the SD algorithm unless otherwise specified.
4.1 Notation for Trees
To begin with, we describe the notation for trees used in this paper. Let be a power-of-two weighted tree and be the path distance on . Suppose that is rooted at . For and any subtree of , we use the following notation.
-
For , denotes the parent of .
-
denotes the closest vertex in to the root . We simply refer to as the root of .
-
denotes the maximum weight in , i.e., .
-
denotes the set of heaviest edges in , i.e.,
The notations and are sometimes abbreviated to and respectively when context makes it clear.
4.2 Definition of Subtree-Decomposition
Then, we define the SD algorithm denoted by . Before presenting the formal definition, we describe the intuitive behavior of SD.
Intuitive behavior.
Let be a given power-of-two weighted tree rooted at an arbitrary vertex . For each vertex , let be the set of vertices reachable from vertex only through edges with weights at most . When a new request arrives at vertex , for , SD performs a DFS starting from to search for a free server in . SD then assigns the request to the first free server located by a DFS.
Decomposition of a Tree.
Next, to describe the algorithm more precisely and simplify the inductive analysis, we redefine the above algorithm recursively. To this end, we decompose a given power-of-two weighted tree into subtrees (hence the algorithm’s name) as follows:
Let and we define subtrees and as follows: We arbitrarily choose , one of the children of the root , and consider a graph obtained by removing edge from . Note that consists of two subtrees. Let be the subtree that contains and be the other subtree that contains .
Next, let and we define subtrees as follows: Let be the maximal subtree of that contains the root and does not contain any heaviest edge in . We use to denote the vertices such that and . Note that by the definition of . For , let be the subtree of rooted at . By the definition of , is a partition of . Then, for any vertex , there uniquely exists a subtree such that .
Recursive Definition.
Now we are ready to describe the formal and recursive definition of SD. For the base case where , SD assigns each request to the unique server. For , let be the SD algorithm for rooted at and for , let be the SD algorithm for rooted at . has two phases: When all servers in are full, Phase 1 terminates and Phase 2 follows.
Let be a new request and be a set of free servers. assigns by using for and for .
Phase 1: There is at least one free server in .
Assume that for some . If there exists a free server in , then assigns to a server in according to . Otherwise, assigns to a server in according to by regarding as a new request and as a set of free servers.
Phase 2: There is no free server in .
Assume that for some and for some . If there exists a free server in , then assigns to a server in according to . Otherwise, if there exists a free server in , then assigns to a server in according to . Otherwise, assigns to a server in according to by regarding as a new request and as a set of free servers.
We establish that SD is an MPFS algorithm and that the processing time of SD per request is through the following propositions. The proof of Proposition 14 is provided in Proposition 15 of the full version.
Proposition 14.
Subtree-Decomposition is an MPFS algorithm.
Proposition 15.
Subtree-Decomposition processes each request in time.
Proof.
The proof is by induction on . For the base case , each request is obviously processed in time. For the inductive step, suppose that the processing time of per request is for and that of is for . If SD is in Phase 1 and a request is in , then the processing time is by the induction hypothesis. If SD is in Phase 1 and a request is in for some , then the processing time is by the induction hypothesis. Otherwise, i.e., SD is in Phase 2, the processing time is by the induction hypothesis. Thus, the proposition holds.
5 Hybrid Algorithm
In this section, we introduce the notion of hybrid algorithms and their properties. This idea was initiated by Gupta and Lewi [7] and very useful in analyzing the competitive ratio of an MPFS algorithm. Note that all definitions and results in this section are applicable to any (not necessarily SD) MPFS algorithm. To begin with, we define hybrid algorithms.
Definition 16 (Hybrid Algorithm).
Let . For a positive integer and a server , consider an algorithm that assigns requests for as follows:
-
(1)
The first requests are assigned according to ,
-
(2)
if is free just before the -th request is revealed, then the -th request is assigned to and the subsequent requests are assigned according to , and
-
(3)
if is full just before the -th request is revealed, then the -th and subsequent requests are assigned according to .
We call a hybrid algorithm of with decoupling time and decoupling server .
One can observe that and output different assignments when decoupling server is free at decoupling time and assigns the -th request to a server other than , i.e., . The purpose of considering the hybrid algorithm is to reduce the evaluation of the competitive ratio of a certain MPFS algorithm to evaluating the difference in cost between and its hybrid algorithm . Therefore, we are only interested in cases where the original MPFS algorithm and its hybrid algorithm output different assignments. Motivated by this insight, we give the following definition of hybrid instances.
Definition 17 (Hybrid Instance).
Let be any instance of and be a hybrid algorithm of . We say that is valid with respect to if and output different assignments when processing , i.e., and invalid otherwise. We refer to a pair as a hybrid instance of if is a hybrid algorithm of and is valid with respect to .
The following lemma shows that by evaluating the cost difference between an MPFS algorithm and its hybrid algorithm , we can determine the competitive ratio of . The proof of Lemma 18 is given in Lemma 19 of the full version.
Lemma 18.
The following claims hold for any .
-
(1)
Suppose that for any hybrid instance of . Then, is -competitive for .
-
(2)
Furthermore, if for any hybrid instance of , then is T-strongly -competitive for .
Next, we introduce an important concept called cavities [7], which is defined for a hybrid instance of . First, consider the moment when assigns the -th request to and assigns it to . We regard as having an “extra” free server at (i.e., a server that is free for but full for ). Similarly, we consider to have an “extra” free server at . The locations of these extra free servers may move as future requests arrive. Eventually, when both and assign a request to their respective extra free servers, the sets of free servers of and align, and from that point onward, and assign a subsequent request to the same server. These extra free servers are referred to as cavities.
The following lemma [8] shows that for any hybrid instance , the cavity of (i.e., a server that is free for but full for ) and the cavity of (a server that are free for but full for ) are uniquely determined at each time, if they exist. This holds by the property of MPFS algorithms.
Lemma 19 (Harada and Itoh [8, Lemma 3]).
Let be a hybrid instance of , where . Then, there uniquely exist a positive integer and sequences of servers and such that
-
(1)
for each ,
-
(2)
for each and
-
(3)
for each .
We call the coupling time of and refer to (resp. ) as -cavity (resp. -cavity) of at time . -cavities and -cavities are collectively called cavities. In particular, (resp. ) is called the first -cavity (resp. the first -cavity) of .
For simplicity, , and are abbreviated as , and respectively when is clear from the context. We use and to denote the sets of -cavities and -cavities of respectively, i.e., In addition, let . By the definition of cavities, it is easy to see that the first -cavity is the decoupling server of and the first -cavity is .
We summarize the properties of cavities and assignments in the following proposition. Intuitively, this proposition asserts the following:
-
At each time, either the -cavity or the -cavity moves, or neither moves.
-
If at time , either one of the -cavity or the -cavity moves, then we can determine the servers to which and assigned requests at time .
Proposition 20 (Harada and Itoh [8, Proposition 1]).
Let be a hybrid instance of , where . Then, the following properties hold:
-
(1)
or for each ,
-
(2)
If , then is assigned to by and to by for each ,
-
(3)
If , then is assigned to by and to by for each ,
-
(4)
If and , then and assign to the same server and
-
(5)
is assigned to by and to by .
As mentioned before, we aim to upper bound the difference in cost between an MPFS algorithm and its hybrid algorithm . To this end, the hybrid cycle defined in the following definition plays a crucial role since the length of the hybrid cycle provides the upper bound on the difference in cost between and (Lemma 22). For simplicity, we use the following notation for a distance function and :
Definition 21 (Hybrid Cycle).
Let be a hybrid instance of for , where and . We refer to the cycle as the hybrid cycle of and define the length of the hybrid cycle to be
Applying Gupta and Lewi’s method [7] to MPFS algorithms yields the following lemma and its corollary. The corollary implies that we can analyze the competitive ratio of MPFS algorithms by evaluating the length of the hybrid cycle.
Lemma 22.
Let and be any hybrid instance of . Then, the difference in cost between and is at most the length of the hybrid cycle, i.e.,
The proof of Lemma 22 can be found in Lemma 23 of the full version. By Lemmas 18 and 22, we immediately have the following corollary.
Corollary 23.
The following claims hold for any .
-
(1)
If for any hybrid instance of , then is -competitive for .
-
(2)
If for any hybrid instance of , then is T-strongly -competitive for .
By this corollary, we aim to obtain an inequality of the form , and focus on hybrid instances that have a certain first -cavity and -cavity.
6 Competitive analysis of Subtree-Decomposition
In this section, we derive the upper bound on the competitive ratio of the SD algorithm . To this end, the following lemma is important.
Lemma 24.
Let be any hybrid instance for and let be the minimal subtree of that contains all cavities of . Then, we have
Note that Lemma 24 presents a simplified form of Lemma 35 of the full version, and the proof can be found in Appendix J of the full version.
In what follows, we introduce two propositions and show that is T-strongly -competitive for . The proofs can be found in Propositions 36 and 37 of the full version.
Proposition 25.
Consider for . Let be any vertex of such that . For any , if ’s priority of for is higher than that of , then
Proposition 26.
Let be a hybrid instance for . Then,
Theorem 27.
Subtree-Decomposition is T-strongly -competitive for with servers.
Proof.
Let be any hybrid instance for . By Lemma 24 and Proposition 26, we have Since assigns to not but , the ’s priority of for is higher than that of . Therefore, by Proposition 25, we have and then
By (2) of Corollary 23, it follows that is T-strongly -competitive for . By substituting , we can see that is T-strongly -competitive for with servers.
By applying Theorem 9, we obtain an -competitive algorithm for .
Corollary 28.
For , there exists a deterministic -competitive algorithm.
In fact, with a more careful analysis, we can demonstrate that there exists a -competitive algorithm for and an -competitive algorithm for .
Theorem 29.
There exists a deterministic -competitive algorithm for .
Proof.
Fix any instance of and Let be the algorithm obtained by transforming SD using the method in Theorem 13. Recall that first constructs a power-of-two weighted tree by using the given metric space and then simulates SD with an instance . We use the following claim which establishes the relationships between the two types of metrics on and the original metric. The proof is provided in Claim 14 of the full version.
Claim 30.
Let be any instance for and be a power-of-two weighted tree constructed by . Then, for any two different points ,
Let be a hybrid instance of for and be a hybrid instance of for . Then, we have
where the first and fourth inequality is due to Claim 30, the second inequality is due to Lemma 24 and the third inequality is due to Proposition 26 and . By (1) of Corollary 23, this implies that is -competitive. By applying Theorems 5 and 8, we obtain an -competitive algorithm for .
Theorem 31.
There exists a deterministic -competitive algorithm for .
7 Conclusion
In this paper, we addressed the online transportation problem with servers located at server sites.
We first defined the T-strong competitive ratio for a tree metric and demonstrate a generic method for converting an algorithm designed for tree metrics into one for general metric spaces. We believe that this technique can be applied to the open problem of designing an -competitive randomized algorithm for and so on.
We then introduced a new algorithm called Subtree-Decomposition and proved that it is T-strongly -competitive for with servers (in Theorem 27). We also demonstrated the existence of -competitive algorithms for (in Theorem 29) and -competitive algorithms for (in Theorem 31). For any deterministic algorithm of , this upper bound on the competitive ratio is tight up to a constant factor with respect to its dependence on the number of server sites. We conjecture that there exists an MPFS algorithm for that achieves the matching upper bound of .
References
- [1] Abu Reyan Ahmed, Md. Saidur Rahman, and Stephen G. Kobourov. Online facility assignment. Theor. Comput. Sci., 806:455–467, 2020. doi:10.1016/J.TCS.2019.08.011.
- [2] Antonios Antoniadis, Neal Barcelo, Michael Nugent, Kirk Pruhs, and Michele Scquizzato. A -competitive deterministic algorithm for online matching on a line. In Approximation and Online Algorithms - 12th International Workshop, WAOA 2014, Wrocław, Poland, September 11-12, 2014, Revised Selected Papers, volume 8952 of Lecture Notes in Computer Science, pages 11–22. Springer, 2014. doi:10.1007/978-3-319-18263-6_2.
- [3] Antonios Antoniadis, Carsten Fischer, and Andreas Tönnis. A collection of lower bounds for online matching on the line. In LATIN 2018: Theoretical Informatics: 13th Latin American Symposium, Buenos Aires, Argentina, April 16-19, 2018, Proceedings 13, pages 52–65. Springer, 2018. doi:10.1007/978-3-319-77404-6_5.
- [4] Nikhil Bansal, Niv Buchbinder, Anupam Gupta, and Joseph Naor. An -competitive algorithm for metric bipartite matching. In Algorithms - ESA 2007, 15th Annual European Symposium, Eilat, Israel, October 8-10, 2007, Proceedings, volume 4698 of Lecture Notes in Computer Science, pages 522–533. Springer, 2007. doi:10.1007/978-3-540-75520-3_47.
- [5] Christine Chung, Kirk Pruhs, and Patchrawat Uthaisombut. The online transportation problem: On the exponential boost of one extra server. In LATIN 2008: Theoretical Informatics, 8th Latin American Symposium, Búzios, Brazil, April 7-11, 2008, Proceedings, volume 4957 of Lecture Notes in Computer Science, pages 228–239. Springer, 2008. doi:10.1007/978-3-540-78773-0_20.
- [6] Anupam Gupta, Guru Guruganesh, Binghui Peng, and David Wajc. Stochastic online metric matching. In 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, July 9-12, 2019, Patras, Greece, volume 132 of LIPIcs, pages 67:1–67:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPICS.ICALP.2019.67.
- [7] Anupam Gupta and Kevin Lewi. The online metric matching problem for doubling metrics. In Automata, Languages, and Programming - 39th International Colloquium, ICALP 2012, Warwick, UK, July 9-13, 2012, Proceedings, Part I, volume 7391 of Lecture Notes in Computer Science, pages 424–435. Springer, 2012. doi:10.1007/978-3-642-31594-7_36.
- [8] Tsubasa Harada and Toshiya Itoh. Online facility assignment for general layout of servers on a line. In Combinatorial Optimization and Applications - 16th International Conference, COCOA 2023, Hawaii, HI, USA, December 15-17, 2023, Proceedings, Part II, volume 14462 of Lecture Notes in Computer Science, pages 310–322. Springer, 2023. doi:10.1007/978-3-031-49614-1_23.
- [9] Tsubasa Harada, Toshiya Itoh, and Shuichi Miyazaki. Capacity-insensitive algorithms for online facility assignment problems on a line. Discret. Math. Algorithms Appl., 16(5):2350057:1–2350057:39, 2024. doi:10.1142/S179383092350057X.
- [10] Bala Kalyanasundaram and Kirk Pruhs. Online weighted matching. J. Algorithms, 14(3):478–488, 1993. doi:10.1006/JAGM.1993.1026.
- [11] Bala Kalyanasundaram and Kirk Pruhs. On-line network optimization problems. Developments from a June 1996 seminar on Online algorithms: the state of the art, pages 268–280, 1998.
- [12] Bala Kalyanasundaram and Kirk Pruhs. The online transportation problem. SIAM J. Discret. Math., 13(3):370–383, 2000. doi:10.1137/S0895480198342310.
- [13] Bala Kalyanasundaram, Kirk Pruhs, and Clifford Stein. A randomized algorithm for online metric -matching. Oper. Res. Lett., 51(6):591–594, 2023. doi:10.1016/J.ORL.2023.09.002.
- [14] Samir Khuller, Stephen G. Mitchell, and Vijay V. Vazirani. On-line algorithms for weighted bipartite matching and stable marriages. Theor. Comput. Sci., 127(2):255–267, 1994. doi:10.1016/0304-3975(94)90042-6.
- [15] Elias Koutsoupias and Akash Nanavati. The online matching problem on a line. In Approximation and Online Algorithms, First International Workshop, WAOA 2003, Budapest, Hungary, September 16-18, 2003, Revised Papers, volume 2909 of Lecture Notes in Computer Science, pages 179–191. Springer, 2003. doi:10.1007/978-3-540-24592-6_14.
- [16] Adam Meyerson, Akash Nanavati, and Laura J. Poplawski. Randomized online algorithms for minimum metric bipartite matching. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2006, Miami, Florida, USA, January 22-26, 2006, pages 954–959. ACM Press, 2006. URL: http://dl.acm.org/citation.cfm?id=1109557.1109662.
- [17] Krati Nayyar and Sharath Raghvendra. An input sensitive online algorithm for the metric bipartite matching problem. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 505–515. IEEE Computer Society, 2017. doi:10.1109/FOCS.2017.53.
- [18] Enoch Peserico and Michele Scquizzato. Matching on the line admits no o(log n)-competitive algorithm. ACM Trans. Algorithms, 19(3):28:1–28:4, 2023. doi:10.1145/3594873.
- [19] Sharath Raghvendra. A robust and optimal online algorithm for minimum metric bipartite matching. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2016, September 7-9, 2016, Paris, France, volume 60 of LIPIcs, pages 18:1–18:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2016. doi:10.4230/LIPICS.APPROX-RANDOM.2016.18.
- [20] Sharath Raghvendra. Optimal analysis of an online algorithm for the bipartite matching problem on a line. In 34th International Symposium on Computational Geometry, SoCG 2018, June 11-14, 2018, Budapest, Hungary, volume 99 of LIPIcs, pages 67:1–67:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPICS.SOCG.2018.67.