---
title: Online Traveling Salesman Problem (OLTSP)
url: https://www.emergentmind.com/topics/online-traveling-salesman-problem-oltsp
type: topic
---

# Online Traveling Salesman Problem (OLTSP)

The Online Traveling Salesman Problem (OLTSP) is an online routing problem in which requests are revealed over time in a metric space, a server starts at a distinguished origin, moves with unit speed, and must serve each request no earlier than its release time while minimizing completion time or makespan. Two canonical variants are standard: in the **closed** variant the server must return to the origin after serving all requests, whereas in the **open** variant it need not return. Across the literature, the term also touches adjacent dynamic models in which the geometry itself changes over time, including time-dependent TSPs with moving or reallocated sites; those models are not OLTSP in the algorithmic sense, but they bear directly on robustness and replanning under nonstationarity [2206.15364] [2210.14722] [2305.02169] [1708.06945].

## 1. Formal models and objective functions

In the standard metric formulation, an input is a sequence of requests \(x=(x_1,\dots,x_n)\) or \(Q=\{q_1,\dots,q_n\}\), with each request written either as \(x_i=(t_i,p_i)\) or \(q_i=(t_i,p_i)\), where \(t_i\) is its arrival or release time and \(p_i\) is its position in a metric space \(M\). The server starts at the origin \(o\) or \(O\) at time \(0\), moves at speed at most \(1\), and may serve a request only after its release time. The objective is to minimize the completion time of the route, denoted \(|T_x|\), \(|ALG|\), or makespan, depending on the paper’s notation [2206.15364] [2210.14722].

Competitive analysis remains the dominant framework. In its basic form, an online algorithm is \(r\)-competitive if \(|ALG| \le r\cdot |OPT|\) for all instances; in the randomized line setting, the expected-cost formulation is used, \(E(\mathsf{ALG})_\sigma \le \alpha\cdot OPT_\sigma + c\), for some constant \(c\) [2210.14722] [1907.00317].

A substantial refinement is **OLTSP with known locations**. In that model, the locations of all requests are known in advance at time \(t=0\), but their release times are unknown and revealed online. This changes the information pattern without changing the requirement that requests be served no earlier than release [2210.14722].

A second refinement is the learning-augmented setting. Here the algorithm receives predictions, such as an entire predicted request sequence, per-request predicted times and positions, only the last arrival time, or predicted locations \(p_i\) for requests whose true locations \(x_i\) and release times \(t_i\) are revealed online. These models support the now-standard notions of **consistency**, **robustness**, and **smoothness** [2206.15364] [2305.02169].

## 2. Classical baselines, lower bounds, and the role of waiting

A central classical baseline for metric OLTSP is **Plan-At-Home (PAH)**. When at the origin, PAH computes an optimal route for all currently released unserved requests and returns home; while on a route, if a new request arrives that is farther from the origin than the server currently is, it abandons the route and goes back home, otherwise it continues. With an offline-optimal TSP subroutine, PAH is **2-competitive**, and with Christofides’ heuristic it is **3-competitive in polynomial time**. The same literature recalls the lower bound that no \(c\)-competitive algorithm exists for \(c<2\) in the metric closed model [2206.15364].

On the real line, the structure is sharper. The online traveling salesman problem on the line (OLTSPL) has been studied for more than two decades, and the best known deterministic competitive ratio is reported as \((9+\sqrt{17})/8\approx 1.64\). The randomized literature distinguishes **zealous** algorithms, which never intentionally wait while unserved requests exist, from **non-zealous** algorithms, which may wait strategically. This distinction is substantive rather than cosmetic: the line results show that waiting can improve competitiveness, and that randomization improves over the best deterministic algorithm [1907.00317].

For OLTSPL, the randomized zealous algorithm **RZ** achieves ratio \(1.625=\frac{13}{8}\) against both fair and general adversaries. The randomized non-zealous algorithm **RNZ** achieves \(1.5\) against the general adversary, matching the corresponding lower bound, and \(\frac{9+\sqrt{177}}{16}\approx 1.39\) against the fair adversary. The lower bounds proved in the same work are \(4/3\) for randomized zealous algorithms against a fair adversary, \((1+\sqrt{17})/4\approx 1.28\) for randomized non-zealous algorithms against a fair adversary, and \(1.5\) for both zealous and non-zealous randomized algorithms against a general adversary [1907.00317].

These results establish two recurrent themes in OLTSP research. First, the adversarial model matters: fair-adversary restrictions can change both upper and lower bounds. Second, deliberate waiting is often algorithmically valuable, even though earlier formulations sometimes privileged “always moving” policies. In that sense, the line serves as a controlled setting in which the informational value of waiting can be proved rather than merely intuited [1907.00317].

## 3. OLTSP with known locations

The known-locations model, sometimes denoted OLTSP-L, assumes that the points at which requests may appear are known from the start, but their release times are not. In this setting, the server starts at \(O\) at time \(0\), moves at unit speed in a metric space \(M\), and must serve every request \(q_i=(t_i,p_i)\) no earlier than its release time. Both open and closed variants are studied [2210.14722].

The main general result is tight: there is a **\(3/2\)-competitive algorithm for both open and closed OLTSP-L in general metric spaces**, and no algorithm can do better than \(3/2\) for the open variant as well, matching the known lower bound for the closed variant. The algorithm waits at the origin until the first time \(T\) such that there exists an order \(\sigma_{i_0}\) with
\[
T \ge \ell_{i_0}/2,
\qquad
\alpha_{i_0}(T)\ge 1/2,
\]
where \(\ell_i\) is the length of the corresponding tour or path and \(\alpha_i(t)\) is the fraction of that order that is fully released by time \(t\). At time \(T\), it selects an order \(\sigma_{i_1}\) minimizing
\[
(1-\beta_i)\ell_i,
\qquad
\beta_i=\min\{\alpha_i(T),1/2\},
\]
and then follows that order, waiting at request locations if necessary. The key inequalities in the proof are
\[
(1-\beta_{i_1})\ell_{i_1} \le T
\]
and
\[
T + (1-\beta_{i_1})\ell_{i_1} \le |OPT|.
\]
The same paper notes that the algorithm also works for the **online asymmetric TSP with known locations**, again giving ratio \(3/2\) [2210.14722].

The significance of this model is explicit in the literature: **knowing all locations in advance collapses the competitive ratio for general metric spaces to the optimal value \(3/2\)**, and this holds for both open and closed variants. Equally important is the negative comparison: knowing only the **number** of requests does not confer the same benefit in several metric spaces. This sharply separates “where requests may appear” from weaker side information about instance size [2210.14722].

## 4. Learning-augmented models based on predicted requests

A distinct line of work initiates OLTSP with predictions in the broader learning-augmented framework. Three prediction models are studied. In **sequence prediction without identity**, the predictor outputs a whole predicted sequence \(\hat x=(\hat x_1,\dots,\hat x_m)\), possibly of a different size, with no one-to-one correspondence to actual requests. In **sequence prediction with identity**, the number of requests is known and each predicted request corresponds to an actual request; the error is quantified by
\[
time := \max_{i\in[n]} |\hat t_i-t_i|,
\qquad
pos := \sum_{i=1}^n d(\hat p_i,p_i).
\]
In **prediction of the last arrival time**, the algorithm receives only \(\hat t_n\), with error \(last := t_n-\hat t_n\) [2206.15364].

These models produce different algorithmic tradeoffs. For sequence prediction without identity, **LAR-NID** is \((1.5+\lambda)\)-consistent and \((3+2/\lambda)\)-robust, for \(\lambda\in(0,1]\), but it is not smooth. For sequence prediction with identity, the naive trust-based algorithm **LAR-Trust** satisfies
\[
ALG \le OPT + 2\,time + 4\,pos,
\]
hence it is \(1\)-consistent and smooth but not robust. The robust variant **LAR-ID** has competitive ratio
\[
\min\left\{3,\ 1+\frac{2\,time+4\,pos}{OPT}\right\},
\]
so it is \(1\)-consistent, \(3\)-robust, and \((2\,time+4\,pos)\)-smooth. Using Christofides’ heuristic, the paper also gives the polynomial-time guarantee
\[
\min\left\{3.5,\ 2.5 + \frac{3.5\,time + 7\,pos}{OPT}\right\}\text{-competitive}.
\]
For the weakest prediction model, **LAR-Last** achieves
\[
\min\left\{4,\ 2.5 + \frac{|last|}{OPT}\right\}\text{-competitive},
\]
so it is \(2.5\)-consistent, \(4\)-robust, and \(|last|\)-smooth [2206.15364].

The lower bounds are as important as the algorithms. In sequence prediction without identity, any \(1\)-consistent algorithm has robustness at least \(1/\delta\) for any \(\delta\in(0,1)\). In sequence prediction with identity, any \(1\)-consistent algorithm has robustness at least \(2\). And even with perfect prediction of the last arrival time, no \(c\)-competitive algorithm with \(c<2\) exists. These results delimit the informational content of different prediction types: exact request matching is far more useful than knowing only a single scalar summary, but even exact matching does not remove adversarial lower bounds [2206.15364].

## 5. Location predictions, SWAG, and domination oracles

A more specialized learning-augmented framework studies OLTSP when the predictions correspond only to request locations. In this model, for each request \(q_i\) the algorithm is given a predicted location \(p_i\); the release times \(t_i\) and true locations \(x_i\) are revealed online; and the algorithm knows \(n\) in advance. Prediction error is measured by
\[
\eta = \frac{\sum_{i=1}^{n} d(x_i,p_i)}{F},
\]
where \(F\) is the length of an optimal offline TSP path or tour for the request locations alone, depending on whether the variant is open or closed [2305.02169].

The central framework is **Strategically Wait And Go (SWAG)** and its learning-augmented version **LA-SWAG**. For an order \(\sigma\), \(\ell_\sigma\) denotes the total route length and \(\alpha_\sigma(t)\) the fraction of the route that is fully released by time \(t\). A permutation \(\sigma'\) **dominates** \(\sigma\) at time \(t\) if
\[
\ell_{\sigma'} \le \ell_\sigma
\quad\text{and}\quad
(1-\alpha_{\sigma'}(t))\ell_{\sigma'} \le (1-\alpha_{\sigma}(t))\ell_\sigma.
\]
An oracle is valid if it outputs a nested set \(S(t)\) such that, for every time \(t\), some \(\sigma'\in S(t)\) dominates the optimal offline permutation. SWAG waits until some time \(T\), chooses from \(S(T)\) the permutation minimizing
\[
(1-\beta_\sigma)\ell_\sigma,
\qquad
\beta_\sigma = \min\{\alpha_\sigma(T),1/2\},
\]
and then follows that route, waiting at unreleased requests if necessary [2305.02169].

The framework yields a structural guarantee: if the oracle is a domination oracle, then SWAG is \(3/2\)-competitive when predictions are perfect. LA-SWAG extends this to imperfect predictions and proves
\[
\text{competitive ratio} \le \frac{3}{2} + 5\eta
\]
for both closed and open LA-OLTSP. The same work gives robustness guarantees of \(2.75\) for the closed variant and \(17/6\) for the open variant in general metrics, with improved guarantees for some special metrics: \(2.5\)-robust for the closed variant in trees and Euclidean spaces, and \(8/3\)-robust for the open variant in trees. It also proves that linear dependence on prediction error is necessary in the open case, via the lower bound that no algorithm can beat
\[
\frac{3}{2} + \frac{\eta}{2}
\quad\text{for}\quad
\eta\in[0,1/3].
\]
A further tradeoff lower bound states that if an algorithm is \((2-\lambda)\)-consistent, then it cannot be \((2+\lambda-\epsilon)\)-robust for any \(\epsilon>0\) in the open variant [2305.02169].

The main conceptual contribution is the reduction from online routing to the design of compact **domination oracles**. This shifts the technical burden away from reasoning over all \(n!\) permutations and toward identifying metric-specific structural dominators. The result is a framework in which improved consistency, graceful degradation, and nontrivial worst-case robustness are obtained simultaneously [2305.02169].

## 6. Structured metrics and tractability

Several metric spaces admit stronger or more explicit results than the general metric case. In the known-locations model, the **ring** is a circle of circumference \(1\). For open OLTSP-L on the ring, there is no \((3/2-\epsilon)\)-competitive algorithm for any \(\epsilon>0\); the lower-bound instance uses two requests placed so that each is at distance \(1/3\) from the origin and from each other, with releases at \(t=1/3\) and \(t=2/3\). For the closed variant on the ring, there is a polynomial-time algorithm with competitive ratio \(5/3\) [2210.14722].

For the **star**, the known-locations results are asymmetric. If only the number of requests is known but not their locations, there is no \((2-\epsilon)\)-competitive algorithm for both closed and open OLTSP on the star, even if the number of requests is known. For closed OLTSP-L on the star, the paper gives a \(7/4\)-competitive algorithm, and by using a knapsack-FPTAS for the relevant ray-selection subproblem, obtains a polynomial-time \((7/4+\epsilon)\)-competitive algorithm for any constant \(\epsilon>0\) [2210.14722].

For the **semi-line**, the contrast is even sharper. If locations are unknown, there is no \((4/3-\epsilon)\)-competitive algorithm for the closed variant and no \((3/2-\epsilon)\)-competitive algorithm for the open variant, even if the number of requests is known. With known locations, open OLTSP-L has lower bound \(4/3\) and admits a polynomial-time \(13/9\)-competitive algorithm, while closed OLTSP-L has competitive ratio \(1\): the optimal strategy is to go to the furthest request, wait until it is released, serve it, and return to the origin while serving all remaining requests [2210.14722].

The line remains the most intensively analyzed one-dimensional case for randomization and waiting. As noted earlier, RZ achieves \(1.625\), and RNZ achieves \(1.5\) against the general adversary, with stronger fair-adversary performance for RNZ. These results show that the one-dimensional geometry supports exact adversarial constructions and tight waiting-based analysis that are not yet available in comparable generality for arbitrary metrics [1907.00317].

In the learning-augmented location-prediction setting, tractability depends strongly on the metric. For arbitrary metrics, the domination-oracle construction yields a single-exponential \(O(n^2 2^n)\) algorithm. For **trees**, the resulting algorithms run in \(O(2^l n^3)\) for the closed variant and \(O(2^l n^4)\) for the open variant, making the problem fixed-parameter tractable in the number of leaves \(l\). For **rings**, polynomial-time domination oracles give \(O(n^3)\) time in the closed case and \(O(n^5)\) time in the open case. For **flowers**, the algorithms are fixed-parameter tractable in the number of petals \(p\), with \(O(6^p n^3)\) time for the closed variant and \(O(6^p n^5)\) for the open variant [2305.02169].

Taken together, these results show that geometry affects OLTSP at three levels: hardness thresholds, available structural decompositions, and the feasibility of efficient domination oracles or exact online policies.

## 7. Time-dependent TSP and trajectory stability

A separate but directly relevant direction studies TSP instances in which the sites themselves change over time. Two such generalizations are introduced. In **bTSP**, sites move continuously inside a unit square with constant velocity, bouncing elastically at the boundary; the salesman solves a static TSP at each observation time. In **rTSP**, one or more sites are reallocated discontinuously to random new positions at each time step. These models capture two different kinds of online change: **smooth drift** and **abrupt reconfiguration** [1708.06945].

For a static TSP with \(N\) sites, a trajectory is a closed Hamiltonian tour, and the number of distinct trajectories is
\[
\frac{(N-1)!}{2}.
\]
The time-dependent study ranks these trajectories by length at each time, with shortest rank \(k=1\) and longest rank
\[
k_{\max}=\frac{(N-1)!}{2}.
\]
It then studies the rank distribution
\[
f(k)\sim \frac{1}{\text{trajectory length at rank }k}
\]
and, more importantly, **rank diversity** \(d(k)\), defined as the number of different elements that have rank \(k\) within a given period of time \(T\). The observation window satisfies \(T=m\,\delta t\) [1708.06945].

The empirical findings are consistent across both moving-site models. For static random configurations, the rank distribution is not Zipf-like and instead has a shape that “resembles a beta distribution.” In the time evolution of ranks, the shortest and longest trajectories are noticeably more persistent than intermediate ones. The paper also gives a bound on diversity,
\[
d_{\max}=\min\left\{1,\frac{(N-1)!}{2m}\right\},
\]
and reports that increasing observation resolution in bTSP can lower diversity because sites do not move much between observations, whereas over sufficiently long horizons diversity becomes close to maximal for most ranks [1708.06945].

The geometric explanation is given through **stability areas** \(A\) for rTSP with \(n=1\): the set of positions to which the moved site can go without changing a given trajectory’s rank. The paper computes distributions \(\rho_k\) of these areas and their mean \(\langle A\rangle_{\rho_k}\), finding that \(\rho_1 \approx \rho_{k_{\max}}\), that intermediate ranks have much smaller stability regions, and that the difference between extremal and intermediate ranks grows with \(N\). The core conclusion is that **trajectory stability is highly non-uniform across ranks**: the shortest and longest trajectories are more stable, more robust under perturbations, and more predictable than intermediate ones [1708.06945].

This does not solve OLTSP in the algorithmic sense. It does, however, provide a statistical and geometric understanding of how TSP solutions behave when the instance changes over time. A plausible implication is that in online or dynamic route-planning settings, optimal or near-optimal tours may remain structurally privileged under modest perturbations, whereas middling tours are substantially more volatile.

Source: https://www.emergentmind.com/topics/online-traveling-salesman-problem-oltsp