Online Monotone Metric Embeddings
Abstract
Metric embeddings into structured spaces, particularly hierarchically well-separated trees (HSTs), are a fundamental tool in the design of online algorithms. In the classical online embedding setting, points arrive sequentially and must be embedded irrevocably upon arrival, resulting in strong distortion lower bounds of , where is the number of points and their aspect ratio.
We propose a novel relaxation, online monotone metric embeddings, which allows distances between embedded points in the target space to decrease monotonically over time. Such relaxed embeddings remain compatible with many online algorithms. Moreover, this relaxation breaks existing lower bound barriers, enabling embeddings into HSTs with distortion .
We also study a dynamic variant, where points may both arrive and depart, seeking distortion guarantees in terms of the maximum number of simultaneously present points. For traditional embeddings, such bounds are impossible, and this limitation persists even for deterministic monotone embeddings. Surprisingly, probabilistic monotone embeddings allow for distortion, which is nearly optimal given an lower bound.
Keywords and phrases:
Online Algorithms, Metric Embeddings, -TaxiCategory:
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 algorithmsAcknowledgements:
The authors thank Michael Mitzenmacher for insightful comments on earlier versions of this paper, and the anonymous reviewers for their constructive feedback.Editors:
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
Metric embeddings are a powerful tool in many online and approximation algorithms. By embedding a metric space into a structured one with small distortion, one can solve algorithmic problems on the simpler metric and then translate solutions back to the original space with bounded loss. Here we focus on embeddings into hierarchically well-separated trees (HSTs), a widely studied target metric space with numerous algorithmic applications [3, 22].
When applying metric embeddings in the context of online algorithms, the traditional approach embeds the entire underlying metric into an HST offline, subsequently solving the problem there [5, 3, 22]. However, the distortion of these embeddings inherently depends on the size of the metric space (e.g., at least [3]), which can be infinite even for simple metrics like the real line. This motivates the study of online embeddings, which only embed points relevant to the request sequence and thus involve only finitely many points.
Online Embeddings and Their Challenges.
In an online embedding, points arrive sequentially. Upon arrival of each new point , the embedding algorithm must irrevocably place into the target metric without knowledge of future points, and it cannot later move points in this embedding under traditional models [27, 5, 9]. This restriction leads to strong distortion lower bounds: a deterministic lower bound of [33] and a randomized lower bound of [27, 5], where is the length of the sequence and the aspect ratio, i.e., the ratio between the maximum and minimum nonzero distances between points. Since can be unbounded, these bounds are exponentially larger than those in the offline setting, which admits deterministic distortion and randomized distortion .
Monotone Metric Embeddings: A Mild but Powerful Relaxation.
Our starting observation is that requiring a fully fixed embedding at each step is often unnecessarily restrictive. In many algorithmic settings, permitting distances between already-embedded points to decrease over time is a benign change that would not degrade performance. For example, with a non-contractive embedding that never underestimates distances, decreasing distances among existing points only improves the approximation quality. As a consequence, many online metric algorithms remain competitive even when paired with an embedding that occasionally shrinks distances, and we provide a meta-theorem for verifying the compatibility of potential-based algorithms.
This motivates a new model that we call online monotone metric embeddings: upon arrival of a new point, previously embedded points may be repositioned, provided that no pairwise distance between already-embedded points increases. This additional flexibility turns out to evade the lower bounds known for the traditional model. Specifically, we achieve probabilistic online monotone embeddings into HSTs with distortion , eliminating the dependence on and approaching the offline embedding distortion of [22]. We also obtain tight bounds on deterministic online monotone embeddings, improving exponentially over the strict111We refer to the traditional embedding model, where distances in the target metric must be fixed upon arrival, as the strict embedding model. setting.
Dynamic Embeddings with Removals.
Another natural question is whether an online embedding must always maintain an embedding of all points ever introduced. In practice, only a small set of alive points may matter at any given time. For example, in metrical service systems (i.e., set chasing problems) [13, 34, 19], only the points in the current and previous request sets matter. In -server or -taxi problems, points requested long ago intuitively lose relevance over time. Motivated by such scenarios, we examine a dynamic embedding model where points may arrive and depart, such that at most points are alive (arrived and have not departed) at any time. The algorithm needs only to maintain an embedding of the alive set.
Previous literature on the -server problem has attempted to employ such an approach, with partial success: [14] achieved a -competitive algorithm for the -server problem using an evolving HST embedding. Building upon this, [30] aimed to further reduce the competitive ratio to by refining the dynamic embedding, and while this work contained several promising ideas, it was later withdrawn due to a bug in the proof. Despite this interest, a systematic exploration of dynamic embedding models remains limited. We investigate what distortion as a function of , if any, is achievable in the dynamic embedding setting.
In the strict setting, known results on embedding graphs of pathwidth [31] imply an offline embedding with distortion into trees. For strict online embeddings into HSTs, even such exponential distortion is unachievable: for , the distortion is an unbounded function of . For online monotone embeddings, the same impossibility still holds in the case of deterministic embeddings. Surprisingly, we show that the combination of monotonicity and randomization removes these barriers, enabling a distortion of . We further establish an almost matching lower bound of for probabilistic embeddings, which holds even offline. This lower bound may be of independent interest, particularly for future research seeking to narrow the gap in the randomized competitive ratio of the -server problem. It could inspire new lower bound constructions, or at least constrain possible approaches when aiming for a -competitive algorithm.
In summary, monotone metric embeddings offer a natural relaxation of the online embedding model that enables overcoming known lower bounds, often exponentially. To the best of our knowledge, this notion of “monotone recourse” is new and may have broader applicability to other online problems. We view this conceptual idea as our main contribution. Some of our results follow from relatively simple adaptations of existing techniques, illustrating that monotone recourse can be addressed within known algorithmic frameworks.
1.1 Our Results
We will refer to the notion of an update sequence, formally defined in Definition 10, which specifies the arrival and departure of points. We denote by the total number of points in the sequence, and by the width, the maximum number of points simultaneously present at any time.
Our embedding results are presented in two categories: the incremental setting222Although our incremental algorithms can accommodate departures, when focusing on an -dependent bound, having departures only simplifies the task by reducing the number of alive points., in which points only arrive and the distortion is analyzed as a function of , and the fully dynamic setting, in which points arrive and depart and the distortion is analyzed as a function of . Finally, we discuss some applications.
1.1.1 Incremental Setting
We first present improved probabilistic embeddings for the classical incremental model when monotone updates are allowed.
Theorem 1 (Probabilistic Embedding).
For every , there exists a probabilistic online monotone embedding of up to points from any metric space into HSTs with distortion . If the points are from an -dimensional normed space, the distortion improves to .
Although Theorem 1 requires prior knowledge of , we can employ it in our applications (Theorems 7 and 8) even in situations where is unknown by using a standard guess-and-double approach. For the pure embedding question with unknown , a modified algorithm gives distortion . Note that the lower bound for offline embeddings extends to our setting, so our bounds for constant-dimensional normed spaces are tight, whereas a quadratic gap remains for general metrics.
We also analyze deterministic online monotone embeddings, obtaining tight bounds. Recall that the optimal distortion for deterministic strict online embeddings is exponential in .
Theorem 2 (Deterministic Embedding).
For every , there is a deterministic online monotone embedding of up to points from any metric space into HSTs with distortion when is known. Without prior knowledge of , the distortion is .333 hides factors. Both bounds are tight.
1.1.2 Fully Dynamic Setting
In the fully dynamic model, points may both arrive and depart. We first present negative results demonstrating that strict dynamic embeddings and deterministic monotone embeddings cannot achieve bounded distortion purely in terms of the width .
Theorem 3 (Dynamic Impossibility).
Even for update sequences of width , any deterministic strict dynamic embedding into HSTs incurs distortion , and any probabilistic strict embedding incurs distortion . Furthermore, any deterministic monotone embedding into HSTs incurs distortion for update sequences of width .
Despite this deterministic impossibility, randomization surprisingly enables embeddings whose distortion is bounded by the width :
Theorem 4 (Probabilistic Dynamic Embedding).
There exists a probabilistic online monotone embedding from any metric space into HSTs with distortion , where is the width of the sequence. If the points are from an -dimensional normed space, the distortion improves to . These results hold without prior knowledge of .
We complement this result with an almost matching lower bound of . Our lower bound is constructed on the line and holds even offline. The proof is short but non-trivial, and may be of interest for future research aimed at closing the gap in the randomized competitive ratio for the -server problem.
Theorem 5 (Dynamic Lower Bound).
For every , there exists an update sequence of width on the line such that any probabilistic monotone embedding of the sequence into HSTs incurs distortion , even if the entire sequence is known in advance.
1.1.3 Applications
Finally, we demonstrate some applications of our embeddings for online algorithms. To give a systematic meta-theorem, we consider online algorithms whose analysis is based on a potential function. Note that the competitiveness of an online algorithm is equivalent to the existence of a corresponding potential function [6].444However, it can be difficult to find an explicit expression for the potential. Intuitively, the potential value quantifies the amount of disadvantage of the online algorithm’s configuration. A natural property of potential functions, which is typically satisfied (cf. Section 6.2), is to be non-decreasing in distances of the metric space. The following theorem, stated more formally in Theorem 30, shows that this condition suffices in order for an online algorithm to be compatible with our monotone embeddings.
Theorem 6 (Application, Informal).
Consider an online problem on a metric . If there exists an online monotone embedding from into a family of metrics with distortion , and a -competitive algorithm for on every metric using a potential function that is monotone non-decreasing in distances, then there is a -competitive algorithm for on .
As examples, we recover a result for -server in [5], and give new applications to the -taxi problem.
Theorem 7 (-Server).
There is an -competitive algorithm for the -server problem on general metrics and an -competitive algorithm on -dimensional normed spaces, where is the number of requested locations.
The bound matches the guarantee in [5], where it was obtained by combining an -competitive HST algorithm with an online embedding of distortion paired with algorithm combination techniques (applicable to problems that admit a so-called min-operator) and an additional “baseline” algorithm, which allows to replace by in the overall competitiveness. Our algorithm offers an alternative perspective on this result, where the factor in the competitiveness comes directly from the embedding, without requiring a min-operator or a baseline algorithm.
Similarly, our embedding yields an alternative, more direct method to recover an -competitive algorithm (Corollary 31) for the subadditive constrained forest problem [25, 5].
For the -taxi problem, we obtain the following new result.
Theorem 8 (-Taxi).
There is an -competitive algorithm for the -taxi problem on general metrics, and an -competitive algorithm for -dimensional normed spaces, where is the number of requested locations.
We note that in previous guarantees for the -taxi problem [17, 11, 15, 26], refers instead to the total number of points in the underlying metric space (including those that are never requested), which is infinite even for simple metrics like the line; see Section 1.2 for details on previous results.
Our dynamic embedding with distortion also suggests a potential avenue for addressing the long-standing open question of whether there exists an algorithm for the -taxi problem whose competitive ratio depends only on . In particular, Theorem 32 demonstrates that it suffices to maintain online a set of points such that the optimal offline algorithm restricted to these points achieves an -approximation.
1.2 Related Work
Embeddings into HSTs.
Offline, any metric of points can be embedded into an HST with distortion [22]. For the online model, [27] adapted the offline algorithm of [3] to achieve distortion, and [5] provides an almost matching lower bound of on probabilistic embeddings into HSTs. For a distortion allowed to depend on only, it becomes [27]. For metrics with doubling dimension ddim, [9] achieves -distortion online embeddings into HSTs.
Online Problems and Algorithms.
The -server problem is one of the most prominent problems in the field of online algorithms. Deterministically, the competitive ratio is [32, 29]. The paper [14] achieved a randomized competitive ratio of on HSTs, which implies an -competitive algorithm on any -point metric. The reader is referred to [28] for a survey on the -server problem, and [12] for more recent results. The latter [12] also shows that the approach via HST embeddings is in fact optimal for the related metrical task systems problems on general metrics, despite the distortion loss.
The -taxi problem is a generalization of the -server problem [23]. Each request in the -taxi problem is a pair of points , requesting a taxi to first come to and then to . In the hard version of the problem, the cost is the total distance taxis travel without a customer. This hard version has an lower bound on the competitive ratio for randomized algorithms against adaptive adversaries [17] and a few (incomparable) upper bounds: , , , and [17, 11, 15, 26], all of which use for the number of points in the entire metric space. On general metrics (with infinitely many points), competitive algorithms are known only for [18].
When applying online embeddings with online algorithms, [5] explains a framework to bypass the dependency on the aspect ratio at the expense of another factor for problems that admit min operators and belong to a class they call abstract network design problem. Our results apply to a class of metrical request-answer games that includes abstract network design and other metrical request-answer games.
Online Algorithms with Recourse.
The idea of allowing some changes to previous actions is related to the notion of recourse in online and dynamic algorithms, with the focus on bounding the number or cost of changes that an algorithm makes [8, 7, 35, 9]. Unlike typical models with recourse, where allowing changes introduces a tradeoff or cost, our monotone updates only decrease distances and hence can be viewed as benign flexibility rather than true recourse. We therefore view this as a free monotone relaxation rather than a standard recourse model.
Dynamic Algorithms.
The field of dynamic algorithms also studies problems whose input is a sequence of arrivals and departures (e.g., of nodes or edges in a graph) while a solution to the current instance has to be maintained [8, 7, 35, 21, 24]. The goal in these problems is typically to minimize update time when computing new solutions, without restrictions on the type of changes allowed when updating the solution. In contrast, we allow only monotone changes but do not impose any restrictions on the running time, as is common in the field of online algorithms.
1.3 Organization
Section 2 defines the notions and the models and provides some useful lemmas. Section 3 explains the main technical ideas and a general framework for our algorithms. Section 4 and 5 prove the main results for the incremental setting and the fully dynamic setting, respectively. Section 6 introduces the metrical request-answer game and proves applications for our embedding. Section 7 contains concluding remarks and highlights future directions. In this version, we focus on probabilistic embeddings from general metrics; embeddings from normed spaces and deterministic monotone embeddings are presented in the full version.
2 Preliminaries
For a set , let be the set of probability distributions over . We use to denote probabilities and for expectations. For a sequence , the notation denotes the subsequence .
Definition 9 (HSTs).
For , a -hierarchically well-separated tree (HST) is a metric space whose points are the leaves of a rooted tree . Each node555The original definition in [3] assigns weights to edges instead of nodes; both formulations are equivalent up to a constant factor (see, e.g., [4, 5]). of has a weight , with if and only if is a leaf, and if is a child of , then . The distance between two leaves and is given by , where denotes the least common ancestor of and .
Throughout the paper, we refer to an original metric space and consider embeddings of finite subsets into HSTs. Our probabilistic embedding will fix . Unless specified otherwise, (without a subscript) refers to the distance in . We write for the diameter of , and for the smallest nonzero distance in . The aspect ratio of is . We may omit the argument and write when it is clear from context. For two metric spaces and , we say dominates if for all , .
We now define an update sequence, which captures both arrivals and departures of points:
Definition 10 (Update Sequence).
An update sequence on a metric is a sequence of pairs . We say the point arrives at time if , and it leaves at time if . Let be the set of alive points at time : We set , and then for each :
We let denote the length of the sequence and denote its width, i.e., . We write for the set of all points introduced up to time .
Traditional metric embeddings map to a single fixed target metric. In our framework, we allow the target metric to change over time, provided distances between previously embedded points never increase. Thus, rather than mapping to one fixed metric, we map to a family of metrics (in our case, HSTs) in an online manner. Similar to [5], we focus on non-contractive embeddings, so we omit the term “non-contractive” here, and just call them embeddings.
Definition 11 (Online Monotone Embedding).
Let be a metric space and let be a family of metric spaces. A (deterministic) online monotone embedding from into takes inputs from an update sequence of length one by one, and upon receiving , outputs a metric satisfying the following conditions:
-
1.
;
-
2.
dominates on : for all , ;
-
3.
is dominated by on : for all , .
A probabilistic online monotone embedding is a probability distribution over deterministic ones. Such an embedding has distortion if, for every update sequence , every , and , , where the expectation is taken over the internal randomness of the embedding. We consider the oblivious adversary model, i.e., the update sequence does not depend on the outcome of random choices made by the algorithm.
From Partitions to HST Embeddings
Instead of constructing an HST directly, we follow the established approach in [3, 5] of building it implicitly via partitions.
Definition 12 (Partition).
A partition of a set of points is a collection of disjoint subsets (called clusters) whose union equals . For a point , we denote by the cluster containing . A partition of a metric space is -bounded if each cluster has a diameter at most . A probabilistic -bounded partition is a distribution over -bounded partitions.
Definition 13 (Smoothness Parameters).
A probabilistic -bounded partition of is said to be -smooth if, for all ,
| (1) | ||||
| (2) |
Condition (1) resembles the padding parameter used in prior literature [1, 5] but is slightly more relaxed. Condition (2) generalizes the notion of -enforcing from [3], which required no splitting at all when (i.e. ). In the online setting, we cannot strictly enforce this; however, we will ensure a small so that the distortion remains unaffected up to constant factors. We write -smooth as an abbreviation of -smooth, in which case we only make use of property (1).
Definition 14 (Online Monotone Partitions).
An online monotone partition on takes an update sequence of length and, for each , generates a partition over such that:
-
1.
does not depend on .
-
2.
For any , if , then .
This ensures that clusters cannot be split over time: points in the cluster at time remain in the same cluster at time . (Note that two clusters may merge, and new arrivals can join existing clusters, but splitting a previously formed cluster is disallowed.)
The following lemma relates the distortion of the embedding to the smoothness of the partitions. A similar lemma that does not allow updates and was proved in [3] (see also [5]), and we defer the complete proof to the full version. Roughly speaking, each cluster at a scale corresponds to a node of the HST at the same scale. Because no cluster can split over time, the lowest common ancestor of two points will not move to high scales, and thus the distances do not increase. With this lemma, our main focus will be on building online probabilistic partitions with desired smoothness parameters.
Lemma 15 (HST Construction).
Suppose that for every integer , there is a probabilistic online -bounded monotone partition on for an update sequence of length and that for each time , the probabilistic partition is -smooth. Then there is an online monotone embedding from into HSTs that, on the same input, achieves a distortion of
Finally, we introduce the notion of relevant scales. We say that a scale (or level) is relevant at time if the partition is not -smooth at scale . We will use this to provide an upper bound of . We note a technical lemma for bounding the number of relevant scales, whose proof is also in the full version.
Lemma 16.
Let be a set of points in a metric space . Fix and define . Then .
3 Technical Overview
Starting Observations.
Equipped with Lemma 15, our goal is to maintain probabilistic online -bounded smooth partitions at a given scale . We begin by recalling some techniques used in offline embedding for -smooth partitions that we make use of, and explaining the challenges in the online setting. Obtaining a reasonable -value does not require updates; for instance, the algorithms in [3, 5] guarantee and can be simulated online. With relevant scales, this gives a distortion of .
Offline, one can eliminate the dependency on by constructing -smooth partitions [3, 1]. The idea is to first contract all pairs of points at distance into single points666Any chain of points where each adjacent pair is at distance is contracted to a single point. before partitioning, and expand them back after the partition. This inflates each cluster’s diameter by at most , which contributes an acceptable constant multiplicative factor with .
However, in the online setting, the algorithm may discover only later that two points should have been contracted, yet they were placed in separate clusters at an earlier step. Existing online embeddings thus end up with a distortion either dependent on the aspect ratio or polynomial in . The aim here is to leverage monotonicity to overcome these limitations.
Incremental Setting.
Monotone embeddings permit us to correct earlier mistakes by merging clusters containing points at a close distance that should have been initially contracted. However, repeatedly merging clusters is problematic, as it can increase cluster diameters and violate the -boundedness property. Therefore, we ultimately might still split some close pairs, contributing to the positive in the smoothness.
We will use the partitioning algorithm from [5, 3] as the base partition, which we detail in Section 3.1, and specify some merging strategy to ensure a small . The algorithm [5, 3] proceeds by constructing balls of random radii around points, which we call components. Each point belongs to the first component that includes it. A carefully chosen distribution of the radii ensures and . Recall from Lemma 15 that our final distortion is
Therefore, if we could achieve using , the distortion would be bounded by .
Naturally, we attempt to merge two components whenever they contain points forming a pair with distance at most . Crucially, while the multiple merge attempts by a single component are not independent events, the events that distinct components simultaneously split close pairs remain independent. Thus, the following surprisingly simple strategy is sufficient, illustrated in Figure 1:
Attempt to merge any pair of components containing points within distance . Allow the first component that splits a close pair to merge freely with any adjacent component, and reject all other merge attempts not involving this component.
We call the first component that splits a close pair and is allowed to merge the designated merging component. Thus, two close points with remain eventually separated only if
-
1.
The boundary of a component splits and . The probability that a fixed component splits pair is bounded by ; and
-
2.
A distinct component is appointed the designated merging component. A component is the designated merging component only if its boundary splits a close pair with , which for each pair happens with probability . Thus, the overall probability is at most .
Importantly, these two events are independent after fixing the two components since they only rely on independently sampled radii. A union bound over all pairs then gives . Taking for a sufficiently large constant (e.g., suffices) ensures , as desired.
The embedding algorithm above requires prior knowledge of to select the parameter . For unknown , we use phases with guesses and threshold . Instead of one designated merging component overall, we allow one per phase. Since there are only phases, the partition retains the same smoothness properties but becomes -bounded, thus incurring an extra factor in contraction. A detailed description of this algorithm appears in the full version.
Fully Dynamic Setting.
In the fully dynamic scenario (where points arrive and depart), the monotone updates play a distinct yet crucial role: they allow us to bound the number of relevant scales in terms of the width . In this setting, we do not make use of a small (our ). Instead, we only want to bound by controlling the number of relevant scales in which our partitions are not -smooth. For strict embeddings, the number of such scales could be as large as : previously arrived (but now departed) points may have caused undesirable separations.
We address this problem via merges. The single-merge strategy for the incremental setting fails here because we no longer have a sufficiently small probability bound (as a function of ) on any particular merge attempt. Thus, we employ the following simple merging strategy:
Attempt to merge any pair of components containing points within distance . Allow a merge attempt if the merge cannot potentially create a cluster of diameter larger than .
Consequently, when alive points in are either within or further than apart, close pairs attempt merges, and these attempts succeed because distant points cannot interfere with such merges. This approach ensures that at most scales with non-zero smoothness exist at any time, resulting in an overall distortion of .
3.1 Algorithm Outline
For each scale , we maintain an online monotone partition of the set of alive points at time . We construct in two steps: we maintain a set of components and a partition over the set . Each point is assigned to a component , and the final partition is given by: if and only if .
For every component , we ensure that the set of points (potentially not alive) that may belong to has diameter at most . It is helpful to think of as a collection of (incomplete) balls and as the ball containing . To establish -smoothness, we show:
-
1.
If , then .
-
2.
If , then .
Intuitively, the set forms our primary partition, and tracks merges among components. We maintain so that . Initially, every component forms a singleton set in , and merges are executed when necessary. Formally, merging two components and means replacing and in with their union . Our algorithms for the incremental and dynamic cases will share the following construction of , but have different merging strategies.
Smooth Probabilistic Partition .
We construct our components by adapting the probabilistic partitions of [3, 5] to accommodate deletions.
Each component in is represented by a triple , where is the center, is the radius, and is the birth time of the component. We maintain pairwise distinct birth times for components, ensuring uniqueness. A point belongs to the component identified by if and is minimal among all components in containing within their radius. Note that it is possible for the center not to belong to the component. We sometimes refer to a component simply by its center: for , component refers to the component with center , and we denote its radius by .
Initially, . When a new point arrives at time , we first set and then add a new component to . The radius is independently sampled from the probability distribution defined as follows. Letting denote the number of components after insertion and setting , we have:
When a point departs, we remove from any component that contains no alive points.
The following claim establishes that the smoothness parameter satisfies . Its proof follows [3, 5], incorporating minor adjustments to account for deletions, and is hence deferred to the full version. The technical choice ensures that and , resulting in the claimed smoothness.
Claim 17.
If , then at any time ,
4 Incremental Setting
We now formalise the description in Section 3 and prove an embedding with distortion in the incremental setting, assuming knowledge of .
Theorem 18.
For every , , and , given knowledge of , there is a probabilistic online -bounded monotone partition of up to points from any metric that is -smooth at every time . Moreover, if no pair of points in has distance in the interval , the partition is -smooth at all times.
Proof.
Our initial component partition is constructed as described in Section 3.1, yielding by Claim 17. We first prove the -smooth property.
Claim 19.
If no pair of points in has distance in , the partition is -smooth at all times .
Proof.
In this scenario, points form natural clusters, each with diameter at most , and distinct clusters are separated by distances exceeding . Hence, the first component created in each group deterministically includes all points in the group, ensuring that the partition is always -smooth.
We now specify the merging strategy. We permit at most one component – termed the designated merging component – to merge freely with other components whenever they split a pair of points at a distance at most . All other merge attempts are rejected.
Formally, we maintain (the center of) the designated component . Initially set to . We say a component with center cuts a pair if exactly one of lies inside the (complete) ball defined by its radius:
Note that cut is defined purely about the geometry, and some component cutting a pair is a necessary but insufficient condition for them to belong to different components, since a component created earlier might include both points.
Whenever two points at distance satisfy , let and denote the centers of and , respectively. We proceed as follows:
-
1.
If , we assign the designated merging component to be the component among and that cuts . If both components cut , we choose arbitrarily. We then merge and by inserting into and removing and .
-
2.
If is already set, we merge and only if ; otherwise, we reject the merge and do nothing.
Since each component has a diameter at most and any merged component contains a point that is at most from the designated merging component, the final clusters will have a diameter at most , satisfying -boundedness.
Claim 20.
For any time and points , if , then
Proof.
We bound the probability that simultaneously and the designated merging component is assigned elsewhere. For each , define the radius set potentially causing to cut a close pair and be the designated merging component:
By a direct integration of the distribution , we obtain for all :
The event can occur only if (i) some component cuts , and simultaneously, (ii) another distinct component is appointed to be the designated merging component , which happens only when . Since radii are independently sampled, after fixing and , these events are independent. Thus, by a union bound:
Theorem 18 then follows from Claim 17, 19, and 20.
Proof of Theorem 1 (general metric).
For each integer , we apply Theorem 18 with scale and parameter . This produces an online -bounded partition that is -smooth at every time . By Lemma 16, there are at most scales for which there exist points satisfying . Theorem 18 guarantees for these scales and for all other scales. Hence, we have
Applying Lemma 15, the total distortion is bounded by
5 Fully Dynamic Setting
When the width of the update sequence is bounded, it is natural to expect distortion to depend only on , independently of the sequence length . However, this is impossible with traditional strict embeddings: there exist update sequences with width that incur deterministic lower bounds of and randomized lower bounds of . In fact, the distortion remains unbounded even for deterministic monotone embeddings. The constructions are relatively simple and are deferred to the full version. Despite the negative results, we will show that combined with randomness, monotone embeddings achieve distortion bounded solely by the width .
5.1 Upper Bound
Theorem 21.
For every and , there is a probabilistic online -bounded monotone partition for update sequences of width that is -smooth at every time . Moreover, if no pair of points satisfies , the partition at time is -smooth. These results hold without prior knowledge of .
Proof.
We follow the framework outlined in Section 3.1, constructing as previously described with , and now specify the merge procedure for constructing explicitly.
In contrast to the incremental case, where a single merging component sufficed, we allow multiple merges to maintain a bounded number of relevant scales. At each time , initialize as a copy of . When a new point arrives, we first update according to Section 3.1. If there exists some point with but , we attempt to merge the components containing and . The merge succeeds if and only if for every and , . This condition ensures the -boundedness of the partition persists despite potential future arrivals. When a point departs, we remove empty components from , potentially allowing previously rejected merges to now succeed; we thus re-check merge conditions after each departure.
It remains to verify that if no pair of points in has distance in , then is -smooth at time . Indeed, suppose no alive points have distance in . Points in naturally form clusters of diameter at most , with distances between clusters strictly exceeding . For any pair within distance at most belonging initially to different components and , the merging condition is satisfied since no distant clusters can obstruct the merge. Thus, all pairs of points within each cluster eventually merge, ensuring is -smooth at time .
5.2 Lower Bound
It might seem tempting to apply similar techniques as in the incremental setting to achieve a distortion of . Unfortunately, this is not possible. To illustrate why, consider the following scenario (see Figure 2): Suppose two points and on the line lie in separate components, and two additional close points move through from left to right. At some stage, these two moving points will cause a merge of the intervals containing and . Due to the monotonicity constraint, this merge cannot be undone, even after the moving points leave, thus preventing future merges that may be necessary when other close points arrive.
In fact, we show that a linear dependency on is unavoidable. Notably, this lower bound holds even in an offline setting, as it uses a fixed sequence.
Theorem 5 (Dynamic Lower Bound). [Restated, see original statement.]
For every , there exists an update sequence of width on the line such that any probabilistic monotone embedding of the sequence into HSTs incurs distortion , even if the entire sequence is known in advance.
Proof.
We construct the sequence on the real line, identifying each point with its coordinate. Let . Define the following notion: for each integer , the set of encompassing points is given by
Intuitively, includes endpoints obtained by recursively halving the segment containing exactly times (see Figure 3).
Our update sequence models the following process, depicted in Figure 4: two moving points travel from to , arriving and leaving iteratively: initially, points and arrive, then point leaves and point arrives, and so forth. When the moving points are at coordinates , we ensure the points in are present and remove any points no longer belonging to (see Figure 4). Clearly, at any given time, the number of alive points is .
Since the sequence is fixed, we may assume the embedding is non-contractive. By Yao’s minimax principle, it suffices to give a distribution over triples such that every deterministic monotone embedding has expected distortion . Let be the first time appears as an iterating point, and choose uniformly among triples . Since all original distances are , we write for the expected embedded distance and aim to prove by induction. The base case is trivial.
We now perform the induction as follows. Fix and and assume for all . Since the embedding is non-contractive, we have . Let be the largest integer such that ; thus, we must have . As an HST is an ultrametric and , it follows directly that . The pair yields a distortion of and is selected with probability , contributing at least to the expected distortion.
Now, we consider the intervals and . Note that we could not invoke the inductive hypothesis immediately, because our instance requires endpoints to exist when the points are iterating. Nevertheless, we can partition the intervals into smaller intervals of length powers of two, in which the encompassing points will be persistent endpoints.
Let have binary representation for distinct integers and for . Then the pairs will persist as encompassing pairs when , and the instance forms a smaller replica of size . Similarly, we decompose the interval . See Figure 5 for an example of the decomposition.
We can now safely invoke our inductive hypothesis. For any split point , the binary representations of and together contain each of exactly once, since the binary representation of is and thus and would not have on the same bit. For the interval of size , the tuple falls in that interval with probability ; conditioned on the pair belonging to the interval, the expected distortion is . Recall we also have a probability of to pick the pair whose distance is . We have
6 Applications
6.1 Metrical Request-Answer Games
Throughout this section, we use bold notation such as for finite sequences. For a sequence of length and any , we denote by the th entry and by the prefix of length of .
We define a general class of online problems in metric spaces that we call metrical request-answer games. It generalizes the notion of request-answer games defined in [6] by introducing dependence on a metric space. The request-answer games in [6] correspond to the special case of our definition where .
Definition 22 (Metrical Request-Answer Game).
A metrical request-answer game is defined by a request set , an answer set , a metric space , and for each a cost function of the form777In fact, as long as is non-negative, concave, and non-decreasing in , our theorem holds.
for some functions and .
Intuitively, indicates the number of times an algorithm pays the distance from to at step if it serves the request sequence with answers , and is some metric-independent cost. In particular, allows to specify infeasible answers.
Definition 23 (Online Algorithm).
A deterministic online algorithm Alg for a metrical request-answer game is a sequence of functions . Given a request sequence , we write for the sequence of answers selected by Alg, where is the answer after the -th request. The cost of Alg on is . The optimal cost for the same sequence is .
A randomized online algorithm Alg is a distribution over deterministic online algorithms . For any request sequence , the answer sequence and hence become random variables. Algorithm Alg is -competitive if there exists such that for every , . We sometimes use to refer to .
Countless online problems involving metric spaces can be modelled as metrical request-answer games. We give the examples of the -server and -taxi problems. More examples, such as the Metrical Task Systems (MTS) [10], Abstract Network Design [5], and Metric Problems with Delay (e.g. [2, 20]), are detailed in the full version.
Example 24 (-Server [32] and -Taxi [23]).
In the -taxi problem, there are taxis located at points of a metric space . At each time , a request appears, specified by a pair representing a passenger that wants to travel from to . In response, an algorithm must move a taxi to and then to before seeing future requests. The cost is the total distance traveled without a passenger on board (i.e., the distance from to is excluded). The -server problem is the special case where for each request.
To model -taxi as a metrical request-answer game, we choose , (assigning numbers to taxis in some fixed way), , and or depending on if a taxi moves from to without a passenger in the corresponding step.
For a request sequence , let denote the set of relevant points induced by the first requests, i.e., points whose distance to some point might contribute to the cost:
For example, in the -taxi problem, is the set of points appearing in the initial configuration and requests of .
6.2 Monotone Potential Functions
We have alluded to the fact that potential functions are usually monotone in distances as a central motivation for online monotone embeddings. In this section, we provide more discussion. We first define the notion of a potential function, which generalizes the definition in [6] to include online algorithms against oblivious adversaries. Recall that denotes the set of probability distributions over a set .
Definition 25 (Potential Function).
For a metrical request-answer game, a family
is called a potential function for -competitiveness if the following is true for each :
For every and , there exists such that the marginal distribution of over the first answers is and for every we have
| (3) |
Potential functions are a common method of proving the competitiveness of online algorithms. Given a potential function, a corresponding online algorithm can be defined by extending its distribution of answers in each step from to some satisfying inequality (3). Taking to be the answer sequence chosen by some optimal offline algorithm and summing inequality (3) over all time steps shows that the algorithm is -competitive.
Intuitively, the potential function measures the disadvantage of the online algorithm in a given configuration. Typically, this involves a distance between the online and offline configurations (e.g., matching or relative entropy), and sometimes dispersion of the online configuration, as this causes future uncertainty or mistakes (e.g., pairwise distances among servers of the Double Coverage algorithm [16] for -server), both of which are monotone. We give a few examples to illustrate the idea.
Example 26 (Potential for -Server on Trees).
For the -server problem on trees, [16] gave a -competitive algorithm, using a potential where denotes the value of a minimum matching between the locations of the online and offline servers and denotes the sum of pairwise distances between the online servers.
Example 27 (Potential for -Server on HSTs).
For the -server problem on HSTs, [14] gave an -competitive randomized algorithm, using a monotone potential. The full description and proof of monotonicity can be found in the full version.
Example 28 (Potential for -Taxi on HSTs).
For the -taxi problem on HSTs, [17] gave a -competitive randomized algorithm, using a potential equal to times the value of a minimum matching between the locations of the online taxis and the locations of the offline taxis. In our notation, we can express this as follows:
For two multisets and of locations in an HST , let denote the value of a minimum matching between and . For a sequence of requests and answers , let denote the resulting set of locations of the taxis. Then .
6.3 The Application Framework
We are now ready to state our reduction theorem, which is the formal version of Theorem 6: our evolving embeddings are applicable whenever there is a potential function in the family of target spaces that is non-decreasing in distances.
Theorem 30.
Consider a request set , answer set , and functions and as in Definition 22 for some fixed ground set . All metric spaces below have subsets of as their sets of points. For a metric space , denote by the associated request-answer game (restricted to request sequences with ) and by its cost function (as induced by and ). Let be some set of request sequences such that for all . Let be a family of target metrics. Suppose the following holds:
-
1.
There is an online monotone embedding from to with distortion for sequences of points.
-
2.
For each , there exists a potential function for -competitiveness on . Further, the family is non-decreasing in distances: if dominates (i.e., for all ), then for all .
Then there is a -competitive algorithm for for request sequences in .
Proof Sketch.
Let be the request sequence that is revealed online. Note that the sets of relevant points for the first requests are increasing in . Applying the online monotone embedding, we obtain a metric for each , where is the length of .
For fixed , we denote by the game with cost function at step . We first define an algorithm for inductively. If is the distribution of answers before the th request arrives, then the next answer is chosen to extend the distribution to satisfying inequality (3) for the cost function and potential . The overall algorithm Alg for is obtained by taking randomness over .
Bounding the competitive ratio has three steps. First, we show that the total cost of in is bounded by times the offline cost in . This step uses the monotonicity of the potential function and the embedding. Then, we bound the expected offline cost in by the offline cost on times the distortion of . Finally, since the embedding is non-contractive, we bound the cost of Alg for the original game by its cost on . Combining the three arguments gives the competitive ratio .
The full proof formalizes the above reasoning and appears in the full version. Together with the monotonicity of Example 29, Theorem 30 immediately implies a competitive algorithm for the subadditive constrained forest problem, recovering a result from [5, 9] where this was proved using a strict online embedding and a min operator to combine with a baseline algorithm to avoid dependence on .
Corollary 31 (Constrained Forest [5, 9]).
There is an -competitive algorithm for the subadditive constrained forest problem on general metrics and an -competitive algorithm on -dimensional normed spaces.
Theorem 8 for the -taxi problem is almost implied by the monotonicity of Example 28 (the -taxi potential), Theorem 30 and Theorem 1. The only remaining issue is that our embedding algorithms require prior knowledge of . We now provide a sketch on how to use a “guess-and-double” technique to handle the unknown- case. Details and the proof for Theorem 7 (-server) can be found in the full version.
Theorem 8 (-Taxi). [Restated, see original statement.]
There is an -competitive algorithm for the -taxi problem on general metrics, and an -competitive algorithm for -dimensional normed spaces, where is the number of requested locations.
Proof Sketch.
Let be the sequence revealed online. Recall is the set of points among the initial configuration and the first requests, and let . Let denote the optimal cost of serving the first requests and .
The execution is divided into phases. In phase , the algorithm maintains guesses and , where is intended to be within a constant factor of , and is an upper bound on the number of points. Initially, we use the smallest possible guesses. If, at some time , we find that , we end the current phase, double , and update the size guess to . One can verify that this ensures for every in phase , and hence .
Within each phase, we run the -competitive algorithm in [17] with the HST embedding of using the current value of . By Theorem 30, the cost incurred by the simulated algorithm on the prefix ending at the th phase boundary is , which is at most a constant multiple of . The cost of a phase transition is also bounded by the sum of the costs of the old and new simulations on the prefix so far. Thus, the total cost over all phases is . Since the guesses double from phase to phase, this sum is dominated by the final guess, which is at most .
6.4 Application for Dynamic Embedding
The application of dynamic embeddings can require problem-specific considerations, since the set of “relevant” points may vary for different problems. As an example, we revisit the -taxi problem.
Theorem 32.
The following two statements are equivalent:
-
1.
There is an -competitive online algorithm for the -taxi problem, for some function .
-
2.
It is possible to maintain online an evolving set of at most “relevant” points, such that the best offline algorithm that must have taxis only at relevant points is an -approximation of the unrestricted optimal solution, for some functions and .
Proof.
Let denote the set of relevant points and denote the set of online taxis at time . For , setting gives and .
For , when a new request arrives, embed at step the set into an HST using Theorem 4 and simulate the algorithm of [17] on this HST. To see competitiveness, consider the optimal offline solution that restricts its taxis to locations in at every time . Since , the embedding distortion at each step is at most . Recall from [17] that the potential function is monotone. Thus, a similar analysis to that in Theorem 30 shows that the algorithm is -competitive against the restricted offline solution , which implies the overall competitive ratio of .
7 Conclusion and Discussion
We present a new framework, online monotone metric embeddings, which allows the embedding to evolve over time, provided that distances between points do not increase. For embeddings into HSTs, we establish distortion from general metrics and tight distortion from -dimensional normed spaces. We also discuss dynamic monotone embeddings and present an upper bound and a lower bound for the distortion. Finally, we discuss the conditions under which an algorithm can be combined with our embedding, and illustrate some applications.
While we use monotone potential functions in Theorem 30 as a systematic way to certify compatibility with particular online algorithms, our embedding framework may be applicable more broadly. It suffices to inspect an algorithm’s proof and verify that the argument remains valid under monotone distance updates. In this way, future work may be able to directly plug our embeddings into their analyses. We highlight some additional future directions below.
-
1.
What is the tight bound for the distortion of online monotone embeddings into HSTs? Deterministically, our algorithm is optimal. For probabilistic embeddings, the only known lower bound is the offline lower bound. Our algorithms match this on constant-dimensional normed spaces, but leave a quadratic gap in the general case.
-
2.
Are there interesting results for online monotone embedding into metrics other than trees? We mainly focus on HSTs since many online problems have competitive algorithms on HSTs. However, embedding into other metrics is also of interest.
-
3.
Dynamic embedding with limitations on the type of recourse is a field with major potential for many online problems, of which we have only scratched the surface. Dynamic embeddings have been a main candidate for getting a -competitive algorithm for the randomized -server problem. Our lower bound imposes limitations on certain approaches. As another example, our Theorem 32 directly suggests pathways for the -taxi problem.
-
4.
Are there similar characterizations for other online problems with monotone recourse? For example, can improved results be obtained for online matching with monotone recourse, where agents are only willing to change their partner if they prefer the new partner?
References
- [1] Ittai Abraham, Yair Bartal, and Ofer Neimany. Advances in metric embedding theory. In Proceedings of the thirty-eighth annual ACM symposium on Theory of computing, pages 271–286, 2006. doi:10.1145/1132516.1132557.
- [2] Yossi Azar, Arun Ganesh, Rong Ge, and Debmalya Panigrahi. Online service with delay. ACM Trans. Algorithms, 17(3), 2021. doi:10.1145/3459925.
- [3] Yair Bartal. Probabilistic approximations of metric spaces and its algorithmic applications. In 37th Annual Symposium on Foundations of Computer Science, FOCS, 1996.
- [4] Yair Bartal. Advances in metric Ramsey theory and its applications. CoRR, abs/2104.03484, 2021. arXiv:2104.03484.
- [5] Yair Bartal, Nova Fandina, and Seeun William Umboh. Online probabilistic metric embedding: A general framework for bypassing inherent bounds. In Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA, 2020.
- [6] 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), 1994. doi:10.1007/BF01294260.
- [7] Aaron Bernstein, Aditi Dudeja, and Zachary Langley. A framework for dynamic matching in weighted graphs. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, STOC, 2021.
- [8] Sayan Bhattacharya, Monika Henzinger, and Danupon Nanongkai. New deterministic approximation algorithms for fully dynamic matching. In Proceedings of the Forty-Eighth Annual ACM Symposium on Theory of Computing, STOC, 2016.
- [9] Sujoy Bhore, Arnold Filtser, and Csaba D. Tóth. Online duet between metric embeddings and minimum-weight perfect matchings. In Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA, 2024.
- [10] Allan Borodin, Nathan Linial, and Michael E. Saks. An optimal on-line algorithm for metrical task system. J. ACM, 39(4), 1992. doi:10.1145/146585.146588.
- [11] Sébastien Bubeck, Niv Buchbinder, Christian Coester, and Mark Sellke. Metrical service systems with transformations. In 12th Innovations in Theoretical Computer Science Conference, ITCS, 2021.
- [12] 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, 2023.
- [13] Sébastien Bubeck, Christian Coester, and Yuval Rabani. Shortest paths without a map, but with an entropic regularizer. SIAM J. Comput., 54(5):S22–265, 2025. doi:10.1137/22M1539149.
- [14] Sébastien Bubeck, Michael B. Cohen, Yin Tat Lee, James R. Lee, and Aleksander Madry. k-server via multiscale entropic regularization. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC, 2018.
- [15] Niv Buchbinder, Christian Coester, and Joseph Naor. Online k-taxi via double coverage and time-reverse primal-dual. Math. Program., 197(2):499–527, 2023. doi:10.1007/S10107-022-01815-6.
- [16] Marek Chrobak, Howard Karloof, T. Payne, and Sundar Vishwnathan. New results on server problems. SIAM Journal on Discrete Mathematics, 4(2), 1991. doi:10.1137/0404017.
- [17] Christian Coester and Elias Koutsoupias. The online k-taxi problem. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, STOC, 2019.
- [18] 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, 2026. doi:10.1137/1.9781611978971.238.
- [19] Christian Coester and Alexa Tudose. Chasing small sets optimally against adaptive adversaries. In 53rd International Colloquium on Automata, Languages, and Programming, ICALP, 2026.
- [20] Yuval Emek, Shay Kutten, and Roger Wattenhofer. Online matching: haste makes waste! In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC, 2016.
- [21] David Eppstein, Zvi Galil, Giuseppe F. Italiano, and Amnon Nissenzweig. Sparsification—a technique for speeding up dynamic graph algorithms. J. ACM, 44(5):669–696, 1997. doi:10.1145/265910.265914.
- [22] Jittat Fakcharoenphol, Satish Rao, and Kunal Talwar. A tight bound on approximating arbitrary metrics by tree metrics. In Proceedings of the 35th Annual ACM Symposium on Theory of Computing, STOC, 2003.
- [23] Amos Fiat, Yuval Rabani, and Yiftach Ravid. Competitive k-server algorithms. In 31st Annual Symposium on Foundations of Computer Science, FOCS, 1990.
- [24] G.N. Frederickson. Ambivalent data structures for dynamic 2-edge-connectivity and k smallest spanning trees. In [1991] Proceedings 32nd Annual Symposium of Foundations of Computer Science, pages 632–641, 1991. doi:10.1109/SFCS.1991.185429.
- [25] Michel X. Goemans and David P. Williamson. A general approximation technique for constrained forest problems. SIAM Journal on Computing, 24(2):296–317, 1995. doi:10.1137/S0097539793242618.
- [26] Anupam Gupta, Amit Kumar, and Debmalya Panigrahi. Poly-logarithmic competitiveness for the k-taxi problem. In Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA, 2024.
- [27] Piotr Indyk, Avner Magen, Anastasios Sidiropoulos, and Anastasios Zouzias. Online embeddings. In Proceedings of the 13th International Conference on Approximation, and 14th International Conference on Randomization, and Combinatorial Optimization: Algorithms and Techniques, APPROX/RANDOM, 2010.
- [28] Elias Koutsoupias. The k-server problem. Computer Science Review, 3(2), 2009. doi:10.1016/J.COSREV.2009.04.002.
- [29] Elias Koutsoupias and Christos H. Papadimitriou. On the k-server conjecture. J. ACM, 42(5), 1995. doi:10.1145/210118.210128.
- [30] James R. Lee. Fusible HSTs and the randomized k-server conjecture. 2018 IEEE 59th Annual Symposium on Foundations of Computer Science, FOCS, 2018.
- [31] James R. Lee and Anastasios Sidiropoulos. Pathwidth, trees, and random embeddings. Combinatorica, 33:349–374, 2009. URL: https://api.semanticscholar.org/CorpusID:11371999.
- [32] Mark Manasse, Lyle McGeoch, and Daniel Sleator. Competitive algorithms for online problems. In Proceedings of the Twentieth Annual ACM Symposium on Theory of Computing, STOC, 1988.
- [33] Ilan Newman and Yuri Rabinovich. Online embedding of metrics. In 17th Scandinavian Symposium and Workshops on Algorithm Theory, SWAT, 2020.
- [34] 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.
- [35] Christian Wulff-Nilsen. Fully-dynamic minimum spanning forest with improved worst-case update time. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC, 2017.
