Chasing Small Sets Optimally Against Adaptive Adversaries
Abstract
We study deterministic online algorithms for the problem of chasing sets of cardinality at most in a metric space, also known as metrical service systems and equivalent to width- layered graph traversal. We resolve the 30-year-old gap of on the competitive ratio of this problem by giving an -competitive deterministic algorithm. This bound is optimal even among randomized algorithms against adaptive adversaries. We also (slightly) improve the deterministic lower bound to , defined recursively by and , which we conjecture to be exactly tight. For , we provide a matching upper bound of . Our results imply slightly improved upper and lower bounds for distributed asynchronous collective tree exploration and for the -taxi problem, respectively.
Our algorithm generalizes the classical doubling strategy, previously known to be optimal for . The previous best bound for general was achieved by the generalized work function algorithm (WFA), and was known to be tight for WFA. Our improved bound therefore implies that WFA is sub-optimal for chasing small sets.
Keywords and phrases:
online algorithms, competitive analysis, chasing small sets, layered graph traversal, metrical service systemsCategory:
Track A: Algorithms, Complexity and GamesFunding:
Christian Coester: Funded by the European Union (ERC, CCOO, 101165139). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Online algorithmsEditors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Problem definition
Small set chasing, also known as metrical service systems, was introduced by Chrobak and Larmore in 1991 [14]. In this problem, a player must move in a metric space in order to serve a sequence of requests. The player is initially located at . At time , a set with is revealed, and the player has to relocate to a point , paying cost . The number of requests and the parameter are not known to the player in advance. The goal of the player is to minimize the total incurred cost. The player is said to be -competitive if its cost is at most
Related work on deterministic algorithms
When introducing the problem, Chrobak and Larmore gave an optimal -competitive deterministic algorithm for uniform metric spaces, and a -competitive deterministic algorithm for in arbitrary metric spaces [14]. The first competitive deterministic algorithm for general metric spaces and arbitrary is due to [19] and achieves a competitive ratio of . In the same paper, they also show a lower bound of for deterministic algorithms. By designing better algorithms, the initial exponential gap of between upper and lower bounds was narrowed to polynomial by Ramesh [23], and further to linear by Burley [13], at which the problem had been stuck for 30 years. We close the gap to a constant factor, with a different algorithm than previous works.
The algorithm proposed by Burley is the generalized work function algorithm (WFA), a general purpose algorithm applicable to many online problems, and the leading candidate algorithm for resolving the famous -server conjecture: For the -server problem, WFA is known to achieve the optimal competitive ratio up to a factor of at most [21], and it is conjectured to be exactly optimal. By contrast, our results imply that WFA is not optimal for chasing small sets, since Burley showed that his analysis is tight for WFA [13].
Context and motivation
The central role of chasing small sets is emphasized by its connection to numerous other problems. Its alternative name, metrical service systems, showcases the connection to metrical task systems, a more general problem in which each request comes with a function that specifies the cost to serve the request in each point of the metric space [9]. Note that metrical service systems is a particular case where the service costs are in . Another related problem is convex body chasing [20, 12, 24, 4], where requested sets are not subject to cardinality constraints, but are required to be convex.
Furthermore, small set chasing is equivalent to the layered graph traversal problem, introduced by Papadimitriou and Yannakakis in [22]. In fact, some of the earlier mentioned results on small set chasing were obtained by working on layered graph traversal. In this problem, a searcher needs to traverse a connected undirected graph with non-negative edge weights. The vertices of are partitioned into layers , so that edges exist only between vertices in consecutive layers. The searcher is initially located in a starting vertex in and needs to reach a target vertex . Initially, the searcher knows only , the vertices in , and the weighted edges connecting to these vertices. All other vertices and edges are hidden. When the searcher reaches a vertex in for the first time, the vertices in are revealed, together with the weighted edges between and . Then, the searcher needs to move from its current position to a vertex in , using any edges which have been revealed so far.111This may require back-tracking through previous layers. When the searcher reaches the penultimate layer, the last layer containing only the target vertex is revealed, together with the corresponding edges. If the graph contains at most vertices in each layer, we say that has width . Note that the searcher does not know or the number of layers in advance. The goal of the searcher is to minimize the total distance traveled. The searcher is said to be -competitive if its total traveled distance is at most , where is the distance between and in .
Computing the offline optimum in layered graph traversal simultaneously captures the shortest path problem and the dynamic programming paradigm, and therefore gives a natural motivation for the problem. The special case in which the graph is unweighted has been studied in [6], but we focus on the general, weighted version of the problem. In the equivalence between small set chasing and layered graph traversal, requests correspond to layers, and the width of the layered graph corresponds to the maximum cardinality of a set in a request. A proof of this equivalence can be found in [19].
For width , layered graph traversal is equivalent to the linear search problem (also known as the cow path problem), studied since at least 1970 [7] and later popularized in the online algorithms literature following [5]. In this problem, a searcher located on a line tries to find an unknown target. The optimal deterministic competitive ratio of 9 is achieved by a simple doubling strategy: the searcher explores the two directions alternately up to a threshold that increases in powers of 2. Similar doubling strategies are ubiquitous in online algorithms (e.g., [1]). Our algorithm for general can be seen as a recursive generalization of this simple idea.
Layered graph traversal can be reduced to the -taxi problem, where one has to move a set of servers (i.e., taxis) in a metric space in order to serve passenger requests consisting of a starting point and a destination [15]. Moreover, the problem of distributed asynchronous collective tree exploration, where a tree is explored by a team of agents, reduces to layered graph traversal [18]. Additionally, small set chasing also has applications in designing learning-augmented algorithms: [3] combine multiple online algorithms by essentially reducing this task to layered graph traversal on disjoint paths, and [2] show how to obtain a hybrid algorithm that is competitive against the best dynamic combination of the available predictors by reducing222The general problem considered in [2] is in fact equivalent to layered graph traversal; the straightforward reduction in the reverse direction constructs predictors whose suggested positions at any time step cover the entire current layer. the problem to layered graph traversal. More generally, set chasing may be viewed as a meta problem of online decision making, where the currently requested set corresponds to the legal configurations that an algorithm may choose at that step.
Randomized algorithms and different adversarial models
In the setting of randomized algorithms, an algorithm’s cost is defined by taking the expectation over its randomness. Most work on randomized online algorithms focuses on the oblivious adversary model, as this is the only model where randomization can yield exponential improvements [8]. An oblivious adversary is one that fixes an instance upfront, before any random choices by the algorithm are made. For this setting, Chrobak and Larmore [14] gave an optimal -competitive randomized algorithm for chasing small sets on uniform metric spaces and a -competitive randomized algorithm for on general metric spaces. For arbitrary and general metric spaces, the first polynomial competitive ratio of is due to Ramesh [23], who also gave a lower bound of for arbitrary . Recently, these bounds were tightened to by Bubeck, Coester and Rabani [10, 11]. Interestingly, [11] note that lower bounds for layered graph traversal inspired their construction used to refute the randomized -server conjecture.
By contrast, in adaptive adversary models, requests are allowed to depend on past decisions made by the algorithm. It is well known that randomization offers only limited benefit against such adversaries.333In general, a -competitive randomized algorithm against adaptive online adversaries implies a -competitive deterministic algorithm [8]. For small set chasing under adaptive adversaries, we show that randomization can improve the competitive ratio by at most a constant factor. This model is particularly relevant to chasing small sets, as several close connections to other problems are known to hold only in the adaptive setting. For example, the previously-mentioned reduction from small set chasing to -taxi given in [15] requires adaptive adversaries, as it issues new requests depending on previous algorithmic actions. Similarly, the reduction from distributed asynchronous collective tree exploration to layered graph traversal in [18] requires an adaptive adversary. Here, the request set in small set chasing corresponds roughly to (part of) the boundary of the region explored so far, which itself depends on prior moves of the agents. The best known bounds for both problems are improved as a consequence of our results.
1.1 Our results
Our main result is the following.
Theorem 1.
There exists an -competitive deterministic algorithm for chasing sets of cardinality at most .
Our upper bound matches the asymptotic lower bound of , and thus settles the optimal asymptotic competitive ratio of small set chasing (and, equivalently, layered graph traversal). In fact, we show in the full version of our paper [17, Appendix E] that our algorithm is asymptotically optimal not only among deterministic algorithms, but also among randomized algorithms competing against adaptive adversaries.
Theorem 2.
Every randomized online algorithm for chasing sets of cardinality at most has competitive ratio at least against an adaptive online adversary.
We additionally improve the exact lower bound for deterministic algorithms from [19] to , defined recursively by
| (1) |
Theorem 3.
Every deterministic online algorithm for chasing sets of cardinality at most has a competitive ratio of at least , for as defined in (1).
Note that is known to be the optimal competitive ratio for . We conjecture that is exactly tight for all . We prove in the full version of our paper [17, Appendix A] that this indeed holds for .
Theorem 4.
There exists a -competitive deterministic online algorithm for chasing sets of cardinality at most .
Since distributed asynchronous collective tree exploration reduces to width- layered graph traversal [18], and width- layered graph traversal reduces to -taxi [15], we also obtain improved upper and lower bounds, respectively, for these problems.
Corollary 5.
There exists a distributed asynchronous algorithm that explores any tree of nodes and depth in at most moves.
Corollary 6.
Every deterministic online algorithm for -taxi has a competitive ratio of at least , for as defined in (1).
Since competitive -taxi algorithms for general (infinite) metric spaces are unknown except for [16], the constant-factor improvement is admittedly modest. Still, we hope it may offer insight for future algorithm design, especially since is known to be tight for the -taxi problem [15]. In a similar vein, our algorithm for small set chasing is directly inspired by our lower bound construction.
1.2 Overview of techniques
Layered graph traversal is known to be equivalent to the case where the graph is a tree [19]. To simplify the description and analysis of our algorithms, it is convenient to further reduce the problem to a two-player game on a tree which evolves over time, as already done in [10]. This reduction is very natural: after layer is revealed, the algorithm only needs to remember the Steiner tree which connects the starting vertex to the vertices in (all vertices which are not part of this Steiner tree are “dead-ends”, since they do not have any descendant in ). Moreover, moving to a vertex in is equivalent to moving to a leaf of the Steiner tree. Therefore, we can model layered graph traversal as “chasing” the leaves of the Steiner tree, where the Steiner tree changes when a new layer is revealed. The game formulation helps express the changes of the Steiner tree as a sequence of simple transformations, which we can reason about more easily.
In Section 2, we first provide a sketch of our lower bound of for deterministic algorithms, which will serve to motivate our algorithm. As in the lower bound of [19], we use a recursive construction consisting of two branches, each containing a concatenation of lower bound instances of width . In each step, the branch currently occupied by the algorithm is extended with an additional lower bound instance, while the other branch advances with zero-length edges. Unlike the construction of [19], which could be stopped at any time to yield a ratio of , our improved lower bound is only attained at certain times when the ratio between the branch lengths is maximized over the course of the algorithm, and the bound we obtain depends on this ratio. Since we can stop an instance only at those specific moments, the adversary cannot easily control the absolute cost of an instance, as it depends on the behavior of the algorithm. Establishing a rigorous lower bound therefore requires some care: On the one hand, the cost of a recursive instance should not be too large, as otherwise an online algorithm could avoid it by switching to the other branch. On the other hand, it also should not be too small (e.g., exponentially decaying), as we need to be able to stack many recursive instances to obtain unbounded total cost. In the full version of our paper [17, Appendix D], we show that we can lower and upper bound the cost of an instance, which allows to use them effectively in the recursive construction.
Our lower bound suggests that there is a “sweet spot” for the ratio between the two branch lengths at which point the algorithm should switch to the other branch. Specifically, for instances of width , the algorithm should switch to the other branch if the optimal value in its own branch is a factor larger than the optimal value in the other branch. This immediately suggests a simple online algorithm: switch to the shorter branch when the sweet spot of ratio between branch lengths is reached, and employ an analogous strategy (for smaller ) recursively within each branch. In the full version of our paper [17, Appendix A], we show that this strategy is indeed -competitive for instances of width .
However, generalizing the potential used for width to larger does not seem straightforward [17, Appendix B]. In Section 4, we derive a natural potential function inspired by the lower bound and show that it can almost prove -competitiveness, except for two types of problems triggered by dead-ends in layered graph traversal. We then address these issues in Section 5 by refining the algorithm and potential function through two methods, which we call forgetting and imbalancing. While the presentation of these techniques will be specific to layered graph traversal, the underlying principles may be applicable more broadly. The motivating idea is to transform an instance into a canonical hard form, as witnessed in the lower bound construction. Forgetting corresponds to treating parts of the instance as if they had not yet been revealed, which we execute by truncating terms in the potential function. Imbalancing is a method of rounding an instance towards the highly unbalanced structure of worst-case instances, by distorting some edge lengths. Mathematically, the benefit of such distortions manifests through larger potential function values, and only costs a constant factor in the competitive ratio.
1.3 Evolving tree game
We now describe the evolving tree game, which is essentially the same as the one defined in [10] except that our growth operation is discrete rather than continuous and we define the game directly for binary trees.
We say that a tree is a stemmed binary tree if it satisfies the following conditions: a) it is a rooted tree, and the root has degree ; b) all vertices except the root have either or children.
The evolving tree game is a two-player game involving stemmed binary tree with nonnegative edge weights. We denote by the weight of an edge . For a non-root node , we denote by the edge between and its parent. Initially, the tree consists of two vertices connected by a zero-length edge. The first player, called the adversary, can apply the following operations on :
-
Growth: for a leaf and , increase the length of the edge incident to by .
-
Deletion: for a leaf that is not the unique child of the root, delete together with its incident edge . Since the parent of now has only one child remaining (and hence degree two), smooth the tree at as follows: let and be the edges incident to , and replace them by a single edge of weight .
-
Fork: for a leaf , connect two new vertices to by edges of length .
The other player, referred to as the algorithm, responds to each operation by choosing a leaf of to occupy. If the adversary grows by the leaf where the algorithm is located, after the growth the algorithm is located at some point along the edge incident to , at distance from . Therefore, the algorithm needs to either move back to or choose a different leaf of . If the adversary deletes the leaf where the algorithm is located, the algorithm has to move to another leaf of . The algorithm pays a cost equal to the total distance it moves, and its goal is to minimize the total cost incurred during the game.
The adversary can end the game after any operation. The algorithm is said to be -competitive if it incurs cost at most , where is the length of the shortest root-to-leaf path in the evolving tree at the end of the game. The instance of the game is said to have width if there are at most leaves which exist at the same time in . The algorithm does not have access to in advance.
A proof of the following reduction, which was given similarly in [10], can be found in the full version of our paper [17, Appendix F].
Lemma 7.
If there exists a -competitive algorithm for the width- evolving tree game, then there exists a -competitive algorithm for width- layered graph traversal.
2 Lower bound sketch
In this section, we give an informal sketch of the lower bound proof (Theorem 3). The complete proof can be found in the full version of our paper [17, Appendix D]. The construction of our lower bound will be helpful in motivating our algorithm later. We formulate the hard lower bound instance as an instance of the evolving tree game (rather than as an instance of layered graph traversal, which we will do in the more formal proof).
Constructing the instance
We construct the hard instance inductively on the width of the tree. Starting from a tree which contains a single leaf, we perform a fork to obtain a tree with two branches. While the algorithm is located in one of the branches, we repeatedly start a phase in which we play the hard instance for width in that branch, scaled by a sufficiently small constant. We ensure that at the end of a phase each branch contains a single leaf. When the algorithm moves to the other branch, we play phases there. We call a super-phase a maximal consecutive sequence of phases played in the same branch. The branch where the phases are played during a super-phase is called active, the other one passive. Note that the passive branch is just a single edge from the root to the unique leaf of the branch. Let denote the length of the passive branch during super-phase , and define
We choose such that , and we stop after super-phase is completed. We delete the leaf in the branch which was active in the last super-phase, so that the tree contains a single leaf in the end, connected to the root by an edge of length .
Online cost analysis
Since each sub-instance is scaled by a small enough constant, the cost that the algorithm can save by switching branches in the middle of a phase is negligible. Thus, denoting by and the active, respectively passive, branch in the last super-phase, and by applying the inductive hypothesis, we obtain that the algorithm pays cost at least during the phases in , and at least during the phases in . Moreover, the algorithm pays to switch branches at the end of each super-phase . By the choice of , we have and for all sufficiently large . Therefore, the overall switching cost is
As we can make arbitrarily large, we have
so the overall switching cost is at least roughly . In total, the algorithm pays at least roughly
This expression is minimized for , which yields the lower bound by Lemma 8 below.
To formalize the proof, we must show that it is indeed possible to scale down sub-instances in order to make the cost incurred in an individual sub-instance negligible. To this end, we need to upper bound . Also note that scaling a sub-instance might affect the algorithm’s behavior (and thus the structure of the sub-instance, as it depends on the algorithm’s behavior).
3 Notation
In this section, we define notation which will be useful to describe and analyze our algorithms.
We refer to an edge-weighted stemmed binary tree simply as “tree”. If a tree contains a single leaf, we call it trivial and we represent it by an edge of length . Otherwise, we call it non-trivial and we represent it by an edge of length connected to two subtrees and (see Fig. 1). We say that is the sibling subtree of and vice-versa, and we say that is the parent subtree of and . Additionally, we say that is a subtree of if or is a subtree of or .
Denoting by the tree on which the evolving tree game is played, we define the depth of a node as the number of edges on the path connecting that node and the root of , and define the depth of as the maximum depth of one of its nodes. As in [10], we parametrize the evolving tree game by depth instead of width in sections 4 and 5 concerned with our main algorithm. We say that an instance has depth if the depth of is at most at all times. Since the depth of a binary stemmed tree is smaller than or equal to its width, any instance of width has depth at most .444On the other hand, an instance of depth can have width up to , so our upper bounds hold even for certain instances of much larger width. Since the parameter is not known in advance, throughout the execution of the algorithm we denote by the maximal depth of since the beginning of the game.
We associate to each subtree of a level between and : if the depth of ’s root is , then has level . In particular, the level of is . By abuse of notation, we also associate levels to edges, so that has the same level as . Note that the level of a subtree can increase in two ways: 1) if is incremented (because the depth of reached a new maximum); 2) if the smoothing that follows a deletion causes a decrease in the depth of ’s root. In either case, we say that is “promoted” to a higher level.
For notational convenience we often treat trees like sets of points, and hence use element and set difference notation (“” and “”) accordingly. Additionally, we use and as a shorthand for and , respectively, and we assume that multiplication and addition take precedence over these operators.
We define to be the shortest path from the root of to one of its leaves. So
We refer to our algorithm by ALG, and we denote the cost incurred by the algorithm so far by . To simplify notation, we assume that each tree has a distinguished leaf which describes ALG’s location, so we can encode the full state of the game in a tree.
Finally, we define
| (2) |
and note the following lemma, which we will use repeatedly throughout the rest of the paper.
Proof.
4 An approach that almost works
In this section, we use the lower bound as inspiration to derive an algorithm and a potential function which can almost be used to prove -competitiveness. We parametrize the evolving tree game by depth instead of width, as the depth does not exceed the width.
Note that the lower bound is tight on the constructed instance when the algorithm applies the following strategy: Out of the two subtrees of the root, the algorithm stays in the current subtree as long as its optimum is not more than times larger than the optimum of the other subtree. When this condition ceases to hold, the algorithm moves to an optimal leaf in the other subtree. To move within a subtree, the algorithm applies the recursive strategy for depth .
Let us analyze the performance of this naive algorithm. Given the current state of the tree (which includes the location of ALG), we want to devise a pseudo-cost potential function which we can use to upper bound the cost incurred so far. If we could also show that , this would mean that our algorithm achieves precisely the competitive ratio for the depth- evolving tree game.
4.1 Potential derivation
To derive , we follow the intuition from the lower bound construction. The edge could have been spawned by playing the game with depth and then contracting everything into a single edge; during this time, ALG could have paid up to .
Next, we bound the cost for switching between and . To simplify our reasoning, suppose that the adversary is only allowed to grow the leaf where the algorithm is currently located. Further suppose that this leaf first grows by the maximal amount for which ALG stays at this leaf, and then it grows by a very small (negligible) additional amount which triggers a switch to a different leaf. Therefore, ALG moves from to when ALG is in the optimal leaf in and the adversary grows this leaf so that . The algorithm pays for switching, of which is for backtracking to the shared root of and and for reaching the optimum leaf in . Suppose ALG is currently located in . Then, stayed the same since the last switch, and we can deduce that the last switch cost , the previous switch cost , and so on. The total switching cost can thus be bounded by
Of course, we swap the roles of and if ALG is currently in instead of . It remains to bound the cost paid while playing the game at depth in the two subtrees and . To this end, we apply an inductive argument to bound this cost by and , respectively.
Putting everything together, for a non-trivial subtree of level , we define
| (4) |
where
| (5) |
Note that, if ALG is not in , we defined by following the intuition that the last visited leaf in was the optimal one.
If is trivial, we simply define . We may omit the subscript in if it is clear from the context.
4.2 Analysis sketch without deletion
Bounding the potential.
Assuming that
| (6) |
a property which is indeed maintained by ALG’s response to growth operations, we can prove by a simple inductive argument that for all subtrees at level . In particular, this implies , as desired.
To show that , it suffices to prove that the cost paid on each operation is bounded by the increase in the potential after that operation.
Growth.
Suppose the adversary grows the leaf where ALG is located. By unfolding the recursive formula for , it is easy to see that it contains a term of the form , where is the length of the edge adjacent to . Therefore, if ALG stays in , the term increases by at least the cost paid by ALG. Otherwise, if ALG moves to a different leaf , and if we denote by the smallest subtree containing both and , then one can show that increases enough to pay for the movement cost.
Fork.
Since the new edges created by a fork initially have length , it is easy to see that a fork does not change or .
4.3 Why deletion causes problems
When deleting a leaf together with its incident edge, the edges in the sibling subtree of get “promoted” to a higher level. Although the promotion helps increase the potential, it may not be enough to counteract the edge deletion, so may decrease, as it happens in the example in Fig. 2(a). The decrease of is problematic, as it may break the inequality .
On the other hand, the potential may increase too much after deletion, violating the inequality . Recall that this inequality is satisfied if (6) holds for all subtrees at level . However, if some is promoted from level to , (6) may no longer be satisfied, as . This happens in the example in Fig. 2(b), where (because ).
So what went wrong with our derivation of the potential? Note that we implicitly assumed that deletion always occurs in a leaf whose sibling is also a leaf, so only trivial subtrees get promoted. Indeed, the lower bound instance is restricted to this kind of “easy” deletions, and it can be proved that the potential is well-behaved on “easy” deletions. By contrast, in both examples in Fig. 2 we delete a leaf whose sibling is a non-trivial subtree. Indeed, the core difficulty of the problem lies in handling deletions in the general case.
5 Refining the algorithm
We now provide an algorithm and analysis that achieves competitive ratio , proving Theorem 1. It is based on two refinements, forgetting and imbalancing, that make the analysis better aligned with the structure of hard instances. Conceptually, forgetting corresponds to temporal canonicalization by limiting the effect of information that is not currently relevant, while imbalancing achieves geometric canonicalization by reshaping the instance towards a worst-case form.
Forgetting
Forgetting stabilizes the potential by truncating certain terms, effectively redefining it as if some parts of the tree had not yet been revealed. In the example in Fig. 2(b), we could pretend that the edge in had length instead of , obtaining the tree from Fig. 3, which satisfies . Intuitively, this corresponds to rewinding part of the exploration. One could extend the evolving tree game by introducing a new operation in which the algorithm could choose a subtree and some , and forget everything in at distance more than from the root of . However, this would make the algorithm too powerful, as repeated forgetting could prevent the adversary from growing the tree. Instead, we simulate the same effect analytically by capping certain terms in the potential function, ensuring bounded growth after deletions.
Imbalancing
Imbalancing enforces a structural regularity that serves to better align an instance with typical worst-case scenarios. It is based on the observation that imbalanced trees act as canonical hard instances, since for such trees the potential achieves its maximum value . To move toward this canonical form, we slightly distort some edge lengths to create a controlled imbalance. In the example in Fig. 2(a), distorting the rightmost edge in by a factor of yields the tree from Fig. 3, satisfying . More generally, one can show that if a tree is very imbalanced, then it is an extreme tree (i.e., a tree for which the pseudo-cost attains the upper bound of , reflecting that it is a hard instance).
To achieve a high imbalance, we can perform the following operation: scale the length of an edge by a factor . If is the tree on which the game is played, we maintain a distorted tree which has the same vertices and edges as , but different edge weights. When the adversary performs some operation on , we perform the same operation on . Additionally, we may perform imbalancing operations on . Provided the overall distortion is not too large, this only loses a constant factor.
5.1 Algorithm description
We are now ready to describe our algorithm. Recall that the tree on which the game is played is initialized to a have a single leaf, connected to the root by a zero-length edge. We initialize the distorted tree in the same manner. Since the depth of the instance is not known in advance, we initialize , and we increment when the depth of exceeds the current value of .
We denote by and the edge weights in and , respectively. We denote by a subtree of , and by the subtree corresponding to in .
We will ensure that the following invariant always holds.
Ratio invariant.
Let be the leaf where ALG is located, and let be a non-trivial subtree of of level such that . Then, if we have , and if we have .
Based on the operation performed by the adversary on , we describe our algorithm’s response on .
Growth.
When the adversary grows a leaf and the ratio invariant remains satisfied, ALG stays in its current position. Otherwise, let be the highest-level subtree for which the ratio invariant inequality is violated. Then ALG moves to the optimal leaf in . Observe that the ratio invariant is now satisfied.
Deletion.
When the adversary deletes a leaf , we proceed as follows:
-
1.
Pretend that the length of grows to , moving accordingly.
-
2.
Let be the parent subtree of . If ALG is in , ALG moves to an optimal leaf in .
-
3.
Delete and its incident edge.
-
4.
Transform into an extreme tree (see Section 5.3.3).
Fork.
If ALG is located in the leaf which is forked, ALG moves to any of the new leaves. Additionally, if the depth of the tree becomes larger than , then we increment , ALG moves to the optimal leaf, and we transform into an extreme tree.
5.2 Potential
We now show how to adapt the potential in order to “forget” parts of the tree.
For a non-trivial subtree of of level , define
| (7) |
where
| (8) | ||||
| (9) |
For a trivial subtree , define .
Note that, as long as , by Claim 10 below we have
so we recover the same recursive formula for as in the previous version of the potential in (4). Otherwise, if, say, , the refined potential caps some terms – as if “forgetting” some part of so that gets reduced to .
It is also important to note that the subtrees which contain ALG’s location will not have their potential capped, as shown in the following claim.
Claim 9.
For all subtrees at level such that ALG is in , we have .
Proof.
Let be the parent subtree of and suppose without loss of generality that . By Claim 10 below, we have , and by the ratio invariant we have . Thus, , so .
5.3 Analysis
We will ensure that each edge in the distorted tree is scaled by a factor between and some constant . Thus, . Moreover, when ALG moves from a leaf to another, we will charge the movement cost according to the distances in instead of the distances in , which means that we are overestimating the cost paid.
In the rest of this section we will prove that
which together with the previous observations and the fact that (as shown in Section 5.3.6) yields
We denote by the cost paid in the current operation and by the increase of the potential in the current operation. To ensure that , it suffices to show that holds for all operations.
For two leaves , we denote by the distance between and in subtree . We denote by the optimal leaf in (breaking ties arbitrarily).
5.3.1 Bounding the potential
Claim 10.
For any subtree of level , it holds that .
Proof.
By induction. For a trivial subtree , we have . For the inductive step, suppose without loss of generality that , so . By the inductive hypothesis, . Using this together with (8) and (9), we get
where in the penultimate step we plugged in the formula for .
In the next sections, we show that holds for all possible operations and that the ratio invariant is maintained.
5.3.2 Growth
By the definition of the algorithm, one can see that the ratio invariant is maintained. It remains to show that the potential does not decrease after a growth operation. We first prove this in the following case.
Claim 11.
Suppose that the adversary grows a leaf by , and ALG is located at before the growth operation. Then, .
Proof.
If the algorithm remains at after the growth, since increases by , we have , where is the trivial subtree containing and is its level. By repeatedly applying Claim 9, we obtain
It remains to consider the case when ALG moves from its initial position to another leaf. Let be the highest-level subtree before the growth for which the ratio invariant inequality in the corresponding subtree after growth is violated, and let be the level of and . Suppose without loss of generality that ALG is currently at and moves to an optimal leaf in . Note that this movement can only be triggered when is the (unique) optimum leaf in , and therefore the movement cost is .
Since the ratio invariant is satisfied before the growth but violated after the growth, we have
| (10) | ||||
| (11) |
Therefore, before the growth we have
and after the growth, by (11), we have
Therefore, increases by at least . Notice that no term in decreases after the growth, so by repeatedly applying Claim 9, we have
The following claim provides a stronger bound on the potential, and will be used repeatedly in our analysis.
Claim 12.
Let be the leaf where ALG is located, let be a subtree of level such that , and let be an optimal leaf in . Then,
Proof.
Imagine repeatedly growing the leaf where ALG is located until eventually ALG moves to . By Claim 11, by the time ALG reaches , would have increased by at least the movement cost paid by ALG, which is at least by the triangle inequality. Moreover, the potential at the end of this process would still be bounded by by Claim 10, which concludes the proof.
We next prove the following auxiliary claim, which will be used to show that the potential does not decrease after any growth operation.
Claim 13.
Suppose that in response to a growth operation ALG moves from its initial position to an optimal leaf in . Let be a subtree of such that . Then, the change in potential after the growth and ALG’s movement satisfies
where and denotes the root of .
Proof.
By induction. If is a trivial subtree, then and we are done. Thus, suppose is a non-trivial subtree of level , and let denote the subtree after the growth. We begin by showing that it suffices to prove that . By Claim 12, we have
| (12) |
By the triangle inequality,
Plugging this into (12), we get
| (13) |
Let be the sibling of , and be the subtree after the growth. Since the ratio invariant was satisfied before the growth, we have
and substituting into (9) yields
Combining this with (13), we get
Therefore, it suffices to show that . Suppose without loss of generality that . By the inductive hypothesis,
| (14) |
If is in , then , and we can conclude by substituting this into (14). Therefore, suppose that is in . Then,
| (15) |
The first term is bounded by (14), and we will show that the second term is bounded by . To this end, note that
and
since and by the ratio invariant. Thus,
| (16) |
Combining (16), (15), (14), and (7), and noting that has coefficient , we get
as desired.
We are now ready to prove that potential does not decrease after any growth operation.
Claim 14.
For any growth operation, we have .
Proof.
Suppose that the adversary grows a leaf by , and ALG is located at before the growth operation. The case when is already covered by Claim 11, so it remains to consider the case when .
If the algorithm does not move and stays in the same leaf before and after the growth, we have and we are done. Therefore, suppose ALG moves from its initial position to another leaf. Let be the highest-level subtree before the growth for which the ratio invariant inequality in the corresponding subtree after growth is violated, and let be the level of and . Suppose without loss of generality that ALG is currently in and moves to an optimal leaf in . Note that this movement can only be triggered when the growing leaf is the (unique) optimum leaf in . Let be the distance from to the root of subtree , so that ALG pays for the movement. By the auxiliary Claim 13,
| (17) |
Similarly to the proof of Claim 11, we have that increases by at least . Notice that no term in decreases after the growth, so by repeatedly applying Claim 9, and using (17), we have
Since the ratio invariant was satisfied before the growth, we have , and thus
5.3.3 Deletion
This section is concerned with the analysis for the deletion operation. Let be the leaf deleted by the adversary. Without loss of generality, assume that . If this is not the case, we can pretend that grows by a sufficient amount just before the deletion is announced. Our assumption ensures that ALG cannot be located in , by the ratio invariant.
Let be the parent subtree of , as shown in Fig. 4. Recall that we take the following steps in order to handle the deletion:
-
1.
If ALG is in , ALG moves to an optimal leaf in . We denote the resulting subtree by .
-
2.
Delete together with its incident edge, and increase the levels of all remaining subtrees in . Call the resulting subtree .
-
3.
Apply the extreme-imbalance procedure (described below) on to obtain extreme subtree .
Recall that a subtree of level is said to be extreme if the inequality in Claim 10 is tight, i.e. . The following recursive procedure can be used to make a subtree extreme.
Extreme-imbalance procedure on a subtree .
If is a trivial subtree, leave unchanged. Otherwise, if is a non-trivial subtree of level , and assuming without loss of generality that the optimal leaf of is in , do:
-
1.
Apply the extreme-imbalance procedure to and .
-
2.
If , scale up all edges in by .
Claim 15.
Assuming that ALG is located either in or in the optimal leaf of , the extreme-imbalance procedure transforms into a subtree such that
-
(i.e., is extreme), and
-
(and more precisely, no edge on the optimal path is altered).
Proof.
If is trivial, then is already extreme, so we are done. Therefore, suppose is non-trivial. Since ALG is located either in the optimal leaf of or not in at all, we can apply the procedure recursively to make and extreme. In the end, we have and . Putting everything together and using (7), a simple calculation shows that , as desired.
Let be the tree obtained from by replacing with . Let be the level of , , , and .
Claim 16.
We have
Proof.
Suppose that initially ALG is in a leaf . Then, , since ALG does not move during any step. We have , as the deleted leaf was not optimal in (by our assumption that ). By Claim 15, we obtain
and by Claim 10 we have
Thus, , and so .
Now suppose that initially ALG is in a leaf . Then, ALG pays to move from to the optimal leaf . By Claim 12 we have
and by Claim 15 we have
Thus, . Since ALG is initially in and it remains in , by repeatedly applying Claim 9, we obtain .
Claim 17.
satisfies the ratio invariant.
Proof.
We know that the ratio invariant is satisfied in the beginning for . ALG may move to an optimal leaf in at step 1, but this maintains the invariant. The levels of the subtrees of increase at step 2, so the ’s used for the ratio invariant inequality inside and are different. But the ratio invariant inequality is satisfied trivially inside because if ALG is in , then it is in an optimal leaf in . At step 3, the lengths of the edges on the path from the root to ALG’s location do not change, whereas the lengths of other edges could only increase; thus, the invariant is preserved.
5.3.4 Fork
If the fork increases the depth of from to , we increment . This increases the levels of all subtrees, which could make the ratio invariant become violated. To fix this, ALG moves from its current leaf to an optimal leaf in , and we apply the extreme-imbalance procedure on to obtain a new tree . The movement cost paid by ALG is , and by Claim 12 we know that
By Claim 15, and , so we get that , as desired.
Otherwise, if the fork does not cause an increase of , it is easy to see that and stay the same, and the ratio invariant remains satisfied.
5.3.5 Bounding the distortion factor
In this section we bound the distortion in .
Claim 18.
The distortion factor of a (non-zero length) edge at level satisfies
In particular, an edge at level is not distorted at all (i.e. ).
Proof.
First note that growing cannot increase , since and grow by the same amount.
It remains to bound how much is scaled in the imbalancing operations. Note that edges at level are never scaled: Edges scaled upon a deletion were promoted just before, so their level is greater than ; if a fork step causes scaling, then the only level 1 edges are the two new edges of length , so scaling them has no effect. Thus, assume that . When we apply the extreme-imbalance procedure to a subtree of level which contains , is scaled by at most . Considering all of the recursive calls of the procedure, is scaled by at most
Since we apply the extreme-imbalance procedure only to subtrees whose level has just been increased, the level of was at most when the previous scalings occurred, and we can conclude by an inductive argument.
Claim 19.
Let be the distortion factor of . Then .
Proof.
By Claim 18,
Since and for , we have . Using that for , we get . Thus,
so .
5.3.6 Bounding
Finally, we show that .
Claim 20.
For , it holds that .
Proof.
By induction. The base case holds because . For the inductive step, we plug in the formula for and use the inductive hypothesis to obtain
To complete the proof, it suffices to show that
This is equivalent to
which holds for all .
References
- [1] Keerti Anand, Rong Ge, Amit Kumar, and Debmalya Panigrahi. A regression approach to learning-augmented online algorithms. In Advances in Neural Information Processing Systems, volume 34, pages 30504–30517, 2021. URL: https://proceedings.neurips.cc/paper_files/paper/2021/file/ffeed84c7cb1ae7bf4ec4bd78275bb98-Paper.pdf.
- [2] Antonios Antoniadis, Christian Coester, Marek Eliás, Adam Polak, and Bertrand Simon. Mixing predictions for online metric algorithms. In International Conference on Machine Learning, ICML, volume 202 of Proceedings of Machine Learning Research, pages 969–983, 2023. URL: https://proceedings.mlr.press/v202/antoniadis23b.html.
- [3] Antonios Antoniadis, Christian Coester, Marek Eliáš, Adam Polak, and Bertrand Simon. Online metric algorithms with untrusted predictions. ACM Transactions on Algorithms, 19(2):1–34, 2023. doi:10.1145/3582689.
- [4] C. J. Argue, Anupam Gupta, Ziye Tang, and Guru Guruganesh. Chasing convex bodies with linear competitive ratio. J. ACM, 68(5):32:1–32:10, 2021. doi:10.1145/3450349.
- [5] Ricardo A. Baeza-Yates, Joseph C. Culberson, and Gregory J. E. Rawlins. Searching in the plane. Inf. Comput., 106(2):234–252, 1993. doi:10.1006/INCO.1993.1054.
- [6] Xingjian Bai, Christian Coester, and Romain Cosson. Unweighted layered graph traversal: Passing a crown via entropy maximization. In Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 3884–3900, 2025. doi:10.1137/1.9781611978322.131.
- [7] Anatole Beck and D. J. Newman. Yet more on the linear search problem. Israel Journal of Mathematics, 8(4):419–429, 1970. doi:10.1007/BF02798690.
- [8] Shai Ben-David, Allan Borodin, Richard M. Karp, Gábor Tardos, and Avi Wigderson. On the power of randomization in on-line algorithms. Algorithmica, 11(1):2–14, 1994. doi:10.1007/BF01294260.
- [9] Allan Borodin, Nathan Linial, and Michael E. Saks. An optimal on-line algorithm for metrical task system. J. ACM, 39(4):745–763, 1992. doi:10.1145/146585.146588.
- [10] Sébastien Bubeck, Christian Coester, and Yuval Rabani. Shortest paths without a map, but with an entropic regularizer. In 63rd IEEE Annual Symposium on Foundations of Computer Science, FOCS, pages 1102–1113, 2022. doi:10.1109/FOCS54457.2022.00036.
- [11] Sébastien Bubeck, Christian Coester, and Yuval Rabani. The randomized k-server conjecture is false! In Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC, pages 581–594, 2023. doi:10.1145/3564246.3585132.
- [12] Sébastien Bubeck, Yin Tat Lee, Yuanzhi Li, and Mark Sellke. Competitively chasing convex bodies. SIAM J. Comput., 52(2):STOC19–339–STOC19–353, 2023. doi:10.1137/20M1312332.
- [13] William R. Burley. Traversing layered graphs using the work function algorithm. J. Algorithms, 20(3):479–511, 1996. doi:10.1006/JAGM.1996.0024.
- [14] Marek Chrobak and Lawrence L. Larmore. The server problem and on-line games. In On-Line Algorithms, Proceedings of a DIMACS Workshop, volume 7 of DIMACS Series in Discrete Mathematics and Theoretical Computer Science, pages 11–64, 1991. doi:10.1090/DIMACS/007/02.
- [15] Christian Coester and Elias Koutsoupias. The online -taxi problem. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, STOC 2019, Phoenix, AZ, USA, June 23-26, 2019, pages 1136–1147, 2019. doi:10.1145/3313276.3316370.
- [16] Christian Coester and Tze-Yang Poon. Online 3-taxi on general metrics. In Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 6659–6673, 2026. doi:10.1137/1.9781611978971.238.
- [17] Christian Coester and Alexa Tudose. Chasing small sets optimally against adaptive adversaries. arXiv preprint, 2026. arXiv:2605.10927.
- [18] Romain Cosson and Laurent Massoulié. Asynchronous collective tree exploration: a distributed algorithm, and a new lower bound. arXiv preprint arXiv:2507.15658, 2025. doi:10.48550/arXiv.2507.15658.
- [19] Amos Fiat, Dean P. Foster, Howard J. Karloff, Yuval Rabani, Yiftach Ravid, and Sundar Vishwanathan. Competitive algorithms for layered graph traversal. SIAM J. Comput., 28(2):447–462, 1998. doi:10.1137/S0097539795279943.
- [20] J. Friedman and N. Linial. On convex body chasing. Discrete and computational geometry, 9(3):293–322, 1993. doi:10.1007/BF02189324.
- [21] Elias Koutsoupias and Christos H. Papadimitriou. On the k-server conjecture. J. ACM, 42(5):971–983, 1995. doi:10.1145/210118.210128.
- [22] Christos H. Papadimitriou and Mihalis Yannakakis. Shortest paths without a map. Theoretical Computer Science, 84(1):127–150, 1991. doi:10.1016/0304-3975(91)90263-2.
- [23] H. Ramesh. On traversing layered graphs on-line. J. Algorithms, 18(3):480–512, 1995. doi:10.1006/JAGM.1995.1019.
- [24] Mark Sellke. Chasing convex bodies optimally. In Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 1509–1518, 2020. doi:10.1137/1.9781611975994.92.
