betaFeedback

WorksComputer Science

Sublogarithmic Online Graph Exploration

Abstract

We study the online graph exploration problem, in which an agent must visit every vertex of an initially unknown weighted graph on nn vertices and return to its starting vertex. In this model, a vertex's incident edges and their weights are revealed when it is first visited. Despite extensive research, the best known competitive guarantee for general graphs had remained O(log⁡n)\mathcal{O}(\log n), a bound already established in 1977 for the greedy TSP heuristic Nearest Neighbor. Subsequent approaches, including hierarchical depth-first search (hDFS) and Blocking, achieve better guarantees on restricted graph classes but have logarithmic or worse competitive ratios on general graphs. This raises the question of whether the logarithmic barrier is inherent and Nearest Neighbor is asymptotically optimal. We answer this question in the negative by giving an O(log⁡n/log⁡log⁡n)\mathcal{O}(\log n/\log \log n)-competitive algorithm. Our algorithm is a slight modification of hDFS, and we establish its competitive guarantee with a surprisingly short proof.

Introduction

Online graph exploration models various real-world tasks that involve navigating and exploring unknown environments. Examples include a robot mapping unfamiliar terrain, a rescue worker searching an unfamiliar area, or a web crawler discovering webpages for indexing. In such settings, the environment is revealed only as exploration proceeds, so navigation decisions must be made using incomplete information. More generally, finding efficient routes is of fundamental theoretical and practical importance and has motivated decades of extensive research on approximation algorithms for the traveling salesperson problem (TSP) [1, 7, 9, 23, 26, 28, 32, 34, 36, 37]. In online graph exploration, we study approximation algorithms for TSP with limited information.

Formally, in the online graph exploration problem, introduced by Kalyanasundaram and Pruhs in 1994 [29], a single agent needs to explore a connected, undirected graph G=(V,E,w)G = (V, E, w) with non-negative edge weights w:E→R≥0w: E \to\mathbb{R}_{\ge0}. The agent is initially located at a starting position s∈Vs \in V. The graph is initially unknown: upon visiting a vertex, the agent learns the unique identifiers of its neighbors and the weights of the corresponding edges. At any time during exploration, we call a previously visited vertex explored and an unvisited vertex adjacent to an explored vertex a boundary vertex (i.e., it is already revealed but not yet visited). A boundary path is a path (v1,…,vk)(v_1, \ldots, v_k) such that v1,…,vk−1v_1, \ldots, v_{k-1} are explored and vkv_k is a boundary vertex. At each step, the agent chooses a boundary vertex and traverses a boundary path from its current position to that vertex, incurring a cost equal to the path’s length. After visiting all vertices, the agent must return to ss. The objective is to minimize the total traversal cost.

For a deterministic online graph exploration algorithm Alg⁡\operatorname{Alg}, let Alg⁡(G,s)\operatorname{Alg}(G,s) denote its total traversal cost on graph GG with starting vertex s∈V(G)s \in V(G). We denote by Opt⁡(G)\operatorname{Opt}(G) the offline optimal cost, that is, the length of a shortest TSP tour. Note that this value is independent of the starting position. We say that Alg⁡\operatorname{Alg} is ρ\rho-competitive if Alg⁡(G,s)≤ρOpt⁡(G)\operatorname{Alg}(G,s) \le\rho\operatorname{Opt}(G) for every graph GG and starting position s∈V(G)s \in V(G).2 The competitive ratio of Alg⁡\operatorname{Alg} is the infimum over all ρ\rho for which Alg⁡\operatorname{Alg} is ρ\rho-competitive.

The central question in online graph exploration is the following.

Question 1 [29 [KP94]. Is there a constant-competitive algorithm for the online graph exploration problem?

In other words, this asks whether TSP can be approximated within a constant factor when the graph is revealed only during traversal. Despite extensive research [4 BHV26, 2, 3, 6, 5, 15, 18, 20, 24, 25, 29, 27, 31, 30], this question remains open to this day. Prior to our work, the best known upper bound on general graphs was O(log⁡n)O(\log n), where nn denotes the number of vertices. The currently best known lower bound is 4 [2].

The O(log⁡n)O(\log n) bound is achieved by the Nearest Neighbor algorithm, which repeatedly traverses a shortest (boundary) path to a closest boundary vertex. This greedy strategy was already analyzed as a simple TSP heuristic in 1977, way before the online graph exploration problem was introduced, and its competitive ratio is Θ(log⁡n)\Theta(\log n) [35]. The logarithmic lower bound was later strengthened to already hold on unweighted planar graphs [25] and on weighted trees [20]. Alternative strategies include hierarchical depth-first search (hDFS) and Blocking, introduced by Megow, Mehlhorn, and Schweitzer [31], where the latter algorithm is an adaptation of the ShortCut algorithm introduced by Kalyanasundaram and Pruhs [29]. These algorithms perform better than Nearest Neighbor on some restricted graph classes, but not on general graphs: hDFS is constant-competitive on graphs with a bounded number of distinct edge weights [31]. Blocking achieves a constant competitive ratio on bounded-genus graphs [31], and was later shown to be constant-competitive on every graph class excluding a fixed minor [4]. Further work establishes optimal competitive ratios for cycles and unweighted graphs [30] and for tadpole graphs [5], as well as constant competitive upper bounds for unicyclic graphs [20, 27] and cactus graphs [20]. On general graphs, however, the standard rounded version of hDFS has competitive ratio Θ(log⁡n)\Theta(\log n) [31], while Blocking with a fixed “blocking parameter” δ\delta has a lower bound of Ω(n1/(δ+4))\Omega(n^{1/(\delta+4)}) on its competitive ratio [31]. Allowing the blocking parameter to depend on nn, a lower bound of Ω(log⁡n)\Omega(\log n) was established for a broad range of parameter choices [4].

To summarize, despite decades of research and substantially different algorithmic approaches and progress on restricted graph classes, the logarithmic guarantee of Nearest Neighbor had resisted improvement on general graphs, suggesting that Θ(log⁡n)\Theta(\log n) might be an inherent barrier. The greedy principle underlying Nearest Neighbor is particularly compelling on general graphs: Intuitively, without any additional structural assumptions, it is difficult (and unclear whether it is even possible) to anticipate when a more expensive immediate decision could reduce the overall exploration cost. This raises a more basic question: can a competitive ratio of o(log⁡n)o(\log n) be achieved on general graphs, or is Nearest Neighbor asymptotically optimal?

In this work, we resolve this question by giving an algorithm with a competitive ratio of o(log⁡n)o(\log n). More precisely, we prove the following.

Theorem 2. There exists an algorithm for online graph exploration with a competitive ratio of O(log⁡n/log⁡log⁡n)O(\log n/\log\log n).

This gives the first asymptotic improvement on the general-graph competitive guarantee since 1977 and establishes that Nearest Neighbor is not asymptotically optimal. Our algorithm is a slight modification of hDFS, and the proof of its competitive guarantee is surprisingly short.

Further related work. As briefly mentioned above, research on the online graph exploration problem has mostly focused on competitive guarantees on restricted graph classes. As a result, it is known that the competitive ratio is 2 on unweighted graphs [30], (1+3)/2≈1.366(1+\sqrt{3})/2 \approx1.366 on cycles [30], at most 2.5 on unicyclic graphs [20, 27], at most 5/2+2≈3.9145/2+\sqrt{2} \approx3.914 on cactus graphs [20], at most 2k2k on graphs with kk distinct edge weights [31], at most 16 on planar graphs [29, 31], and constant on any graph class excluding a fixed minor [4] (which includes graph classes of bounded genus or bounded treewidth). A recent work considers randomized algorithms for the problem and establishes an improved upper bound on the expected competitive ratio of ≈1.314\approx1.314 on cycles [BHV26]. The lower bound for online graph exploration was sequentially improved from 5/25/2 [15] to 10/310/3 [3], with the currently best lower bound being 4 [2] up to this day. All of these lower bound constructions already hold on the class of planar graphs.

Another line of work studies how additional information can improve exploration. In the advice model, an oracle with full knowledge of the graph provides information to the algorithm. Dobrev, Královič, and Markou [15] show that O(n)O(n) bits of advice suffice to achieve constant competitiveness, while Böckenhauer, Fuchs, and Unger [6] give an algorithm achieving optimal exploration with O(n+m)O(n+m) bits of advice. Eberle et al. [18] study learning-augmented exploration with predicted tours or spanning trees, obtaining constant competitive guarantees for accurate predictions while retaining an O(log⁡n)O(\log n) guarantee for arbitrary predictions. Gehnen, Klasing, and Naquin [24] consider a model in which the graph topology is known in advance but edge weights are initially available only through estimates, and analyze competitiveness in terms of the uncertainty in these estimates.

There are several related exploration settings studied in the literature. Exploration of directed graphs has been studied both when every edge must be traversed and when the objective is to visit every vertex. For strongly connected directed graphs, Foerster and Wattenhofer [22] establish sharp competitive ratios of n−1n-1 for weighted vertex exploration and n2+12−1n\frac{n}{2}+\frac{1}{2}-\frac{1}{n} for unweighted vertex exploration. In the edge-exploration variant on unweighted graphs, where edge destinations are revealed only upon traversal, the best known upper bound is O(d8)O(d^8) [21] and the best known lower bound is Ω(d)\Omega(d) [17], where the Eulerian deficiency dd is the minimum number of edges that must be added to make the graph Eulerian. In collaborative exploration, a team of kk agents, each moving at unit speed, need to explore the graph, with the objective of minimizing the time until all vertices are visited by some agent. Here, it is already unclear how to optimally explore unweighted trees. After a long line of research [13, 10, 12, 14, 19, 33], Cosson and Massoulié establish in a recent work an algorithm with a competitive ratio of O(log⁡2k)O(\log^2 k) [CM26], while the best known lower bound is Ω(log⁡k/log⁡log⁡k)\Omega(\log k/\log\log k) [16].

The offline counterpart to online graph exploration is metric TSP. The problem is NP-hard, but its importance for applications in logistics and planning, together with immense theoretical interest, has motivated extensive research on approximation algorithms for metric TSP over several decades. Christofides’ classical 3/2-approximation [9], introduced in 1976, remained the best known guarantee for more than four decades. Karlin, Klein, and Oveis Gharan [26] improved this factor to 3/2−ε3/2-\varepsilon for some small constant ε>0\varepsilon> 0, with a subsequent refinement in [23]. Additional structure in the metric permits substantially stronger guarantees: polynomial-time approximation schemes are known for Euclidean metrics [1] and, more generally, for metrics of bounded doubling dimension [7]. Graph structure can likewise be exploited: shortest-path metrics of weighted planar graphs admit a polynomial-time approximation scheme [28], while graphic TSP, defined by shortest-path distances in unweighted graphs, admits better approximation factors than those known for general metrics [32, 34]. Allowing the cost of traversing an edge to depend on the direction yields asymmetric TSP, for which constant-factor approximations are known [36, 37].

Outline. In § 2, we introduce the online graph exploration algorithm Threshold-hDFSb_b, parameterized by a value b∈R>1b \in\mathbb{R}_{>1}, and observe some of its key properties. The algorithm is a slight adaptation of the algorithm hDFS introduced in [31], and, at the end of § 2, we explain the differences between the two algorithms, which allow us to obtain a better competitive ratio than established in previous work. In § 3, we analyze the competitive ratio of Threshold-hDFSb_b, depending on the parameter bb. In that section, we will also see that our analysis is tight and, more importantly, that the choice b=log⁡nb = \sqrt{\log n} yields the desired competitive ratio of O(log⁡n/log⁡log⁡n)O(\log n/\log\log n). The issue, however, is that the agent does not know the number of vertices nn in advance, so it is unclear how to set the parameter bb. In § 4, we show how to circumvent this issue by employing a doubling strategy, so that bb is gradually increased as more vertices are explored. This then completes the proof of Theorem 2.

The algorithm

In this section, we introduce the algorithm Threshold-hDFSb_b. For this, we begin with collecting the notation that we need.

Preliminaries and notation

For a graph G=(V,E)G = (V, E) with edge weights w:E→R≥0w: E \to\mathbb{R}_{\ge0}, define GW:=(V,{e∈E:w(e)≤W})G_W := (V, \{e \in E : w(e) \le W\}) to be the graph restricted to edges of weight at most WW. Define comp⁡G(u,W)\operatorname{comp}_G(u, W) as the connected component of GWG_W that contains uu, which we identify with the set of vertices in it. Let us make two basic but crucial observations. First, at any time during exploration, if the agent is located at position uu, it knows whether comp⁡G(u,W)\operatorname{comp}_G(u, W) is already explored. Indeed, comp⁡G(u,W)\operatorname{comp}_G(u, W) is not yet fully explored if and only if there exists a boundary path from uu such that all of its edges have weight at most WW. Second, for any W′<WW' < W, a connected component CC of GWG_W partitions into connected components of GW′G_{W'} (i.e., every component of GW′G_{W'} is either fully contained in CC or disjoint from CC), resulting in a hierarchical structure. We will sometimes consider the quotient graph of CC induced by the partition of GW′G_{W'}. This is the graph that has a vertex for every connected component of GW′G_{W'} in CC, and two vertices are connected if the corresponding components are connected by an edge of weight at most WW. Note that such an edge has a weight in (W′,W](W', W].

In the algorithm, we will sometimes compute a TSP tour (i.e., a closed walk visiting all vertices) of an already fully explored component C=comp⁡G(u,W)C = \operatorname{comp}_G(u, W). We write a TSP tour of a component Algorithm 1: Threshold-hDFSb(u,W)_b(u, W)

Input: agent’s current position uu; threshold W∈bZ∪{0,∞}W \in b^{\mathbb{Z}} \cup\{0,\infty\}

  1. if W=0W = 0 then

  2. explore comp⁡G(u,0)\operatorname{comp}_G(u,0) by DFS using only zero-weight edges, returning to uu;

  3. return;

  4. W′←min⁡{Y∈bZ∪{0}:comp⁡G(u,Y)W' \leftarrow\min\{Y \in b^{\mathbb{Z}} \cup\{0\} : \operatorname{comp}_G(u,Y) is not fully explored}\}

  5. while W′<WW' < W do

  6. Threshold-hDFSb(u,W′)_b(u,W');

  7. Recompute W′W';

  8. compute a TSP tour T=(x1,…,xk)T = (x_1,\ldots,x_k) of G[comp⁡G(u,W/b)]G[\operatorname{comp}_G(u,W/b)] of weight at most 2w(MST⁡(G[comp⁡G(u,W/b)]))2w(\operatorname{MST}(G[\operatorname{comp}_G(u,W/b)])) with x1=xk=ux_1 = x_k = u

  9. for i=1,…,k−1i = 1,\ldots,k-1 do

  10. while there is a boundary edge e={xi,y}e = \{x_i,y\} with w(e)≤Ww(e) \le W do

  11. traverse ee

  12. Threshold-hDFSb(y,W)_b(y,W)

  13. traverse ee back to xix_i

  14. traverse a shortest path in G[comp⁡G(u,W/b)]G[\operatorname{comp}_G(u,W/b)] from xix_i to xi+1x_{i+1}

on k−1k-1 vertices as a permutation of the vertices with the starting vertex appended to the end, i.e., (x1,…,xk)(x_1,\ldots,x_k) with x1=xkx_1 = x_k and {x1,…,xk−1}=C\{x_1,\ldots,x_{k-1}\} = C. In particular, when the component consists of a single vertex vv, we write the TSP tour of the component as (v,v)(v,v). The total length of the tour is then ∑i=1k−1d(xi,xi+1)\sum_{i=1}^{k-1} d(x_i,x_{i+1}).

In our algorithm, a constant-factor approximation to a shortest TSP tour will suffice. Note that, if TT is a minimum spanning tree (MST) of a graph GG, we have

w(T)≤Opt⁡(G)≤2w(T),w(T) \le\operatorname{Opt}(G) \le2w(T),

since doubling the edges of an MST gives a factor-2 approximation to a shortest TSP tour. In the analysis, we therefore bound the exploration cost in terms of w(T)w(T), allowing us to make use of structural properties of an MST.

Last, a boundary edge is an edge with one explored and one unexplored endpoint (i.e., a boundary path consisting of one edge). Moreover, given a set of vertices S⊆V(G)S \subseteq V(G), by G[S]G[S], we denote the induced subgraph of GG on vertex set SS.

Algorithm definition

Now, we have all the preliminaries in place to define the algorithm Threshold-hDFS, which is formally defined in Algorithm 1. The algorithm is a slight modification of hDFS introduced in [31]. We explain the differences at the end of this section.

The algorithm is parameterized by b∈R>1b \in\mathbb{R}_{>1} and the high-level intuition is that we explore comp⁡G(s,W)\operatorname{comp}_G(s,W) for increasing values of WW, where WW ranges over powers of bb, until the entire graph is explored. When comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) is already explored, we expand the explored part to comp⁡G(u,W)\operatorname{comp}_G(u,W) as follows (cf. Figure 1): We follow a TSP tour of comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) and, when we encounter a boundary edge of weight at most WW, we traverse it and then recursively invoke the algorithm with threshold WW.

Hierarchical exploration at threshold $W$

Figure 1. Hierarchical exploration at threshold WW. The gray regions are components of GW/bG_{W/b} within comp⁡G(s,W)\operatorname{comp}_G(s,W). Red curves represent tours within these components (computed in line 8 of Algorithm 1). The gray edges represent edges of GWG_W between components of GW/bG_{W/b}, i.e., they have weight in (W/b,W](W/b,W]. The blue edges represent edges traversed due to line 11 of Algorithm 1. They form a DFS tree of the quotient graph. The black points represent the first vertex visited in each of the components.

A bit more formally, the algorithm Threshold-hDFSb_b takes as input a vertex uu denoting the agent’s current position and a threshold WW. At the end of execution of Threshold-hDFSb(u,W)_b(u,W), the agent will have fully explored comp⁡G(u,W)\operatorname{comp}_G(u,W). Lines 1–3 (cf. Algorithm 1) solve the special case where W=0W=0, where we simply explore the component with depth-first search, incurring zero cost. Lines 4–7 ensure that comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) is fully explored before we expand. For this, we identify the smallest value of the threshold, for which the component is not explored (in line 4), where we employ the convention that min⁡∅=∞\min\varnothing=\infty, and increase the threshold until comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) is fully explored. When reaching line 8, we have therefore fully explored comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) and can compute a TSP tour of it. Here, a constant-factor approximation to the optimum in G[comp⁡G(u,W/b)]G[\operatorname{comp}_G(u,W/b)] (e.g., a depth-first search traversal of an MST) suffices for our purposes. We follow the TSP tour and traverse a boundary edge of weight at most WW when encountering one, which leads us to a new connected component of GW/bG_{W/b}, where we proceed recursively. Once the recursive exploration is complete, we backtrack and resume the TSP tour.

Consider Figure 1 for an illustrative example. Here, comp⁡G(s,W)\operatorname{comp}_G(s,W) consists of four components A,B,C,DA,B,C,D of GW/bG_{W/b}, with s∈As\in A. The agent first explores AA at threshold W/bW/b and then follows its red tour until traversing the blue edge to BB. On reaching BB, it explores this component at threshold W/bW/b before following its red tour and interrupting it by following the blue edge to CC. After repeating this procedure in CC, it backtracks to BB, completes its tour, and returns to AA. It resumes the tour of AA, explores DD in another excursion, and returns to finish the tour at ss. Note that the blue edges form a depth-first search trajectory on the quotient graph, which gives the algorithm its name hierarchical depth-first search.

We note down two properties of the algorithm that are immediate from its definition.

Observation 3. Let b>1b>1, G=(V,E,w)G=(V,E,w) be a graph, and s∈Vs\in V.

a) The algorithm Threshold-hDFSb(s,∞)\text{Threshold-hDFS}_b(s,\infty) is a correct online graph exploration algorithm, i.e., it terminates, visits all vertices, the agent returns to the starting position, and all steps are well-defined (in particular, whenever line 8 is executed, comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) is fully explored).

b) Let W∈bZW\in b^{\mathbb{Z}} and u∈Vu\in V. Consider the first time that uu is visited. Then comp⁡G(u,W/b)\operatorname{comp}_G(u,W/b) will be fully explored before an edge of weight more than W/bW/b is traversed.

Comparison to hDFS. Our algorithm Threshold-hDFS differs from hDFS in the following key respect. Whereas our thresholds WW are powers of bb, hDFS uses all edge weights as thresholds. In the rounded version of hDFS analyzed in [31], the edge weights are first rounded up to powers of a fixed constant base. If all edge weights were rounded up to powers of bb, this distinction between the threshold rules would disappear. However, it is crucial for our algorithm to use the original edge weights when computing the TSP tours in line 8. Using rounded weights in this step would introduce an additional factor of bb in the bound on the touring cost. Since we allow bb to depend on nn, we cannot afford this additional factor.

The remaining differences between Threshold-hDFS and hDFS are cosmetic.

Competitive analysis

In this section, we prove the following result.

Theorem 4. The algorithm Threshold-hDFSb_b is O(b+log⁡(n)log⁡(b))O\left(b+\frac{\log(n)}{\log(b)}\right)-competitive on graphs with nn vertices.

Observe that, if the number of vertices nn is known in advance to the agent, the theorem already implies the existence of an O(log⁡n/log⁡log⁡n)O(\log n/\log\log n)-competitive algorithm as desired for Theorem 2. Indeed, if nn is known in advance, we can simply set b=log⁡nb=\sqrt{\log n} (for sufficiently large nn) and obtain a competitive ratio of O(log⁡n+log⁡n/(0.5log⁡log⁡n))=O(log⁡n/log⁡log⁡n)O(\sqrt{\log n}+\log n/(0.5\log\log n))=O(\log n/\log\log n).

In this section, we analyze the algorithm for a fixed parameter bb, which may be chosen as a function of nn. In the next section, we use a simple “doubling strategy” that gradually increases bb as exploration proceeds. This allows us to achieve a competitive ratio of O(log⁡n/log⁡log⁡n)O(\log n/\log\log n) without knowing nn in advance.

For the remainder of this section, let G=(V,E,w)G=(V,E,w) be an arbitrary fixed graph, s∈Vs\in V, and TT be a minimum spanning tree of GG. The goal is to bound the total cost incurred by Threshold-hDFSb(s,∞)_b(s,\infty) on graph GG in terms of w(T)w(T). We assume throughout that w(T)=∑e∈Tw(e)>0w(T)=\sum_{e\in T}w(e)>0 as otherwise, there is nothing to show.

Hierarchical component structure and minimum spanning trees

We begin with noting down the basic graph-theoretic ingredients that we will use in our analysis of the algorithm. The following lemma is a simple consequence of TT being a minimum spanning tree.

Lemma 5. For every vertex u∈V(G)u\in V(G) and every W∈R≥0W\in\mathbb{R}_{\ge0}, we have comp⁡T(u,W)=comp⁡G(u,W)\operatorname{comp}_T(u,W)=\operatorname{comp}_G(u,W). Moreover, T[comp⁡G(u,W)]=TW[comp⁡G(u,W)]T[\operatorname{comp}_G(u,W)]=T_W[\operatorname{comp}_G(u,W)] is a minimum spanning tree of G[comp⁡G(u,W)]G[\operatorname{comp}_G(u,W)].

Proof. Since TT is a subgraph of GG, we have comp⁡T(u,W)⊆comp⁡G(u,W)\operatorname{comp}_T(u,W)\subseteq\operatorname{comp}_G(u,W). Assume for a contradiction that comp⁡T(u,W)⊊comp⁡G(u,W)\operatorname{comp}_T(u,W)\subsetneq\operatorname{comp}_G(u,W). Then comp⁡G(u,W)\operatorname{comp}_G(u,W) contains multiple components of TWT_W, and there is an edge of GWG_W connecting comp⁡T(u,W)\operatorname{comp}_T(u,W) to another such component. That is, there exists an edge e={x,y}∈E(G)e=\{x,y\}\in E(G) with w(e)≤Ww(e)\le W, x∈comp⁡T(u,W)x\in\operatorname{comp}_T(u,W), and y∈comp⁡G(u,W)∖comp⁡T(u,W)y\in\operatorname{comp}_G(u,W)\setminus\operatorname{comp}_T(u,W). The unique path in TT between xx and yy contains an edge of weight greater than WW, since the two vertices lie in distinct components of TWT_W. Therefore, T∪{e}T\cup\{e\} contains a cycle in which ee is strictly lighter than the heaviest edge. Replacing that edge by ee yields a spanning tree of strictly smaller weight, contradicting the minimality of TT.

It follows that T[comp⁡G(u,W)]=TW[comp⁡G(u,W)]T[\operatorname{comp}_G(u,W)]=T_W[\operatorname{comp}_G(u,W)] is a spanning tree of G[comp⁡G(u,W)]G[\operatorname{comp}_G(u,W)]. If this tree were not minimum, replacing it with a lighter spanning tree of G[comp⁡G(u,W)]G[\operatorname{comp}_G(u,W)] would yield a spanning tree of GG of strictly smaller weight, again contradicting the minimality of TT. □\square

Extension cost and touring cost

To bound the total cost incurred by the algorithm, we distinguish two types of cost. We call an edge traversed in line 11 and traversed back in line 13 an extension edge (blue edges in Figure 1). The cost of following the TSP tours computed in line 8 and traversed in line 14 is called touring cost (red tours in Figure 1). The next two lemmata bound the total cost of traversing extension edges and the total touring cost, respectively. Note that these traversals account for all non-zero cost incurred by the algorithm.

Lemma 6. The total cost incurred by traversing extension edges is at most 2b⋅w(T)2b \cdot w(T).

Proof. For each W∈bZW \in b^{\mathbb{Z}}, let E(W)E^{(W)} be the set of extension edges with weight in (W/b,W](W/b, W], and let T(W)T^{(W)} be the set of edges of TT in the same weight range. We prove the stronger claim that ∣E(W)∣=∣T(W)∣|E^{(W)}| = |T^{(W)}|. The lemma then follows by summing over all WW, since every edge of E(W)E^{(W)} has weight at most bb times that of any edge of T(W)T^{(W)}. The factor 2 accounts for the two traversals in lines 11 and 13.

To prove the claim, fix a component CC of GWG_W, and let kk be the number of components of GW/bG_{W/b} contained in CC. We show that the edges of E(W)E^{(W)} and T(W)T^{(W)} within CC each form a tree on these kk components, implying that they both have size k−1k - 1. By Lemma 5, TW[C]T_W[C] is a tree and TW/bT_{W/b} has the same kk components in CC as GW/bG_{W/b}, so that TWT_W forms a tree on these components. For E(W)E^{(W)}, recall that every extension edge is a boundary edge when first traversed. By Observation 3 (b), once a component of GW/bG_{W/b} is first visited, it is fully explored before an edge of weight greater than W/bW/b is traversed, i.e., before the agent leaves it again. Thus every edge of E(W)E^{(W)} leads from an already visited component of GW/bG_{W/b} to a previously unvisited one. These edges therefore also form a tree on the kk components (they form a depth-first search tree, cf. Figure 1).

The two edge sets thus contain the same number of edges within CC. Summing over all components CC of GWG_W proves the claim.

:::

Next, we turn to bounding the touring cost.

Lemma 7. For b>1b > 1, the total touring cost is at most 2(log⁡bn+2)w(T)2(\log_b n + 2) w(T).

Proof. First, observe that, for each fixed W∈bZW \in b^{\mathbb{Z}} and each component CC of GW/bG_{W/b}, at most one tour of CC is computed by a call with threshold WW. Indeed, when such a tour is computed at a vertex uu, the component CC is already fully explored by Observation 3. Every call in line 12 starts at a newly visited vertex, so no subsequent such call can start within CC. Moreover, the call at uu fully explores comp⁡G(u,W)\operatorname{comp}_G(u,W), so threshold WW cannot subsequently be selected again in line 4 at uu.

By Lemma 5, T[C]=TW/b[C]T[C] = T_{W/b}[C] is a minimum spanning tree of G[C]G[C], so the tour of CC costs at most 2w(TW/b[C])2w(T_{W/b}[C]). Summing over all components of GW/bG_{W/b}, the touring cost incurred by calls with threshold WW is therefore at most 2w(TW/b)2w(T_{W/b}).

Next, since comp⁡G(u,w(T))=V(G)\operatorname{comp}_G(u,w(T)) = V(G), any finite threshold selected in line 4 is less than b w(T)b\,w(T). Therefore, whenever the algorithm is invoked with a finite call threshold WW, we have W<b w(T)W < b\,w(T). The initial call \textsc{Threshold-HDFS}_b(s,\infty) additionally performs one final tour of the entire graph, costing at most 2w(T)2w(T). We obtain that the total cost of touring is at most

Touring cost≤2w(T)+∑W∈bZ,W<w(T)2w(TW).\text{Touring cost} \le2w(T) + \sum_{\substack{W \in b^{\mathbb{Z}},\, W < w(T)}} 2w(T_W).

Next, we have

∑W∈bZW<w(T)w(TW)=∑e∈Tw(e)⋅∣{W∈bZ:w(e)≤W<w(T)}∣≤∑e∈Tw(e)>0w(e)(1+log⁡b(w(T)w(e))).\begin{aligned} \sum_{\substack{W\in b^{\mathbb{Z}}\\W<w(T)}} w(T_W) = \sum_{e\in T} w(e)\cdot\lvert\{W\in b^{\mathbb{Z}}:w(e)\le W<w(T)\}\rvert\\ &\le\sum_{\substack{e\in T\\w(e)>0}} w(e)\left(1+\log_b\left(\frac{w(T)}{w(e)}\right)\right). \end{aligned}

To estimate this further, we make use of (a special case of) Jensen’s inequality, which states that, if f:I→Rf:I\to\mathbb{R} is a concave function for some interval I⊆RI\subseteq\mathbb{R}, then for x1,…,xk∈Ix_1,\ldots,x_k\in I, we have ∑i=1kf(xi)≤kf(∑i=1kxi/k)\sum_{i=1}^{k}f(x_i)\le kf\left(\sum_{i=1}^{k}x_i/k\right). Since the function f(x)=xlog⁡(w(T)/x)f(x)=x\log(w(T)/x) is concave and TT contains n−1n-1 edges, we obtain the bound

∑e∈Tw(e)>0w(e)log⁡b(w(T)w(e))≤(n−1)∑e∈Tw(e)n−1log⁡b(w(T)(∑e∈Tw(e))/(n−1))=w(T)log⁡b(n−1)≤w(T)log⁡b(n)\begin{aligned} \sum_{\substack{e\in T\\w(e)>0}}w(e)\log_b\left(\frac{w(T)}{w(e)}\right) \le(n-1)\frac{\sum_{e\in T}w(e)}{n-1}\log_b\left(\frac{w(T)}{\left(\sum_{e\in T}w(e)\right)/(n-1)}\right) \\ &= w(T)\log_b(n-1)\le w(T)\log_b(n) \end{aligned}

Combining these bounds, the total touring cost is at most 2w(T)+2w(T)(1+log⁡bn)2w(T)+2w(T)(1+\log_b n), as claimed. □

Note that Lemmas 6 and 7 together imply Theorem 4, where we used that log⁡b(n)=log⁡(n)/log⁡(b)\log_b(n)=\log(n)/\log(b).

Remark 8. The bound in Theorem 4 is tight. For sufficiently small ε>0\varepsilon>0, on the left-hand graph in Figure 2, Threshold-hDFSb(s,∞)_b(s,\infty) incurs cost at least b2−ε+1≥b2b^{2-\varepsilon+1}\ge b^2, while the offline optimum has cost at most 2(1+b+ε)2(1+b+\varepsilon). This yields a competitive ratio of Ω(b)\Omega(b).

Instances witnessing tightness of the bound

Figure 2. Instances witnessing tightness of the bound O(b+log⁡b(n))O(b+\log_b(n)) in Theorem 4, for b≥2b \ge2 and some sufficiently small ε>0\varepsilon>0. In both graphs, exploration starts at ss. In the left graph, Threshold-hDFSb_b achieves a competitive ratio of Ω(b)\Omega(b), in the right, a competitive ratio of Ω(log⁡b(k))=Ω(log⁡b(n))\Omega(\log_b(k))=\Omega(\log_b(n)).

On the right-hand graph, which corresponds to the lower bound construction given in [31] for hDFS, we have n=Θ(k)n=\Theta(k), and the offline optimum equals twice the total length of the path, which is Θ(k)\Theta(k). During the execution of Threshold-hDFSb(s,∞)_b(s,\infty), the agent traverses the kk-edge unit-weight subpath at least ⌈log⁡bk⌉\lceil\log_b k\rceil times. Consequently, its competitive ratio is Ω(log⁡bk)=Ω(log⁡bn)\Omega(\log_b k)=\Omega(\log_b n).

The two constructions together therefore give a lower bound of Ω(b+log⁡bn)\Omega(b+\log_b n) on the competitive ratio of Threshold-hDFSb_b, matching the bound in Theorem 4.

Doubling strategy for an unknown number of vertices

While the previous section already shows our main theorem if the agent is given the number of vertices nn in advance, we show in this section that a competitive ratio of O(log⁡n/log⁡log⁡n)O(\log n/\log\log n) can also be achieved without this assumption.

To this end, consider Algorithm 2. The algorithm makes a “guess” NN for the total number of vertices in the graph. It then sets b=log⁡Nb=\sqrt{\log N} (if NN is large enough), which is the desired choice for bb if the number of vertices is indeed NN and executes Threshold-hDFSb_b. When more than NN vertices are learned, it interrupts the algorithm and updates its guess to N2N^2. Here, a vertex is called learned when it is either explored or a boundary vertex. After interrupting and updating the parameters, the exploration begins again from scratch, i.e., we let the agent “forget” about the vertices learned in the previous phase.

Algorithm 2: Adaptive-hDFS

  1. N←2N \leftarrow2

  2. while GG is not fully explored do

  3. b←max⁡{2,log⁡N}b \leftarrow\max\{2,\sqrt{\log N}\}

  4. run Threshold-hDFSb(s,∞)_b(s,\infty) and interrupt when more than NN vertices are learned

  5. return to ss via a shortest known path

  6. N←N2N \leftarrow N^2

Explained on an intuitive level, our main result follows because each update of NN increases the phase competitive ratio of log⁡N/log⁡log⁡N\log N/\log\log N by a constant factor (for NN large enough), so the sum of these bounds is dominated by the last one. We work out the details in the following theorem.

Theorem 9. The algorithm Adaptive-hDFS is O(log⁡n/log⁡log⁡n)O(\log n/\log\log n)-competitive.

Proof. Consider exploration of a graph GG and let TT be a minimum spanning tree of GG. In the following, we call one iteration of the while-loop a phase. Consider an interrupted phase of positive cost with guess NN and parameter b=max⁡{2,log⁡N}b=\max\{2,\sqrt{\log N}\}, and let vv be the vertex whose visit causes more than NN vertices to be learned. We construct a graph GNG_N as follows (cf. Figure 3): it consists of all vertices and edges learned immediately before visiting vv (in particular, vv was a boundary vertex at that time), and we add edges of weight 00 from vv to all other boundary vertices. Then GNG_N has at most NN vertices and, crucially, Threshold-hDFSb_b has the same exploration trajectory on GNG_N up to the arrival at vv as on GG. Therefore, by Theorem 4, the cost before interruption is at most O(b+log⁡N/log⁡b)Opt⁡(GN)O(b+\log N/\log b)\operatorname{Opt}(G_N). Returning to ss at most doubles this cost. The learned edges of TT, together with the added zero-weight edges, form a connected spanning subgraph of GNG_N of weight at most w(T)w(T). Indeed, every learned vertex is connected to vv by following its unique path in TT to the first boundary vertex and then using a zero-weight edge to vv. Thus, Opt⁡(GN)≤2w(T)\operatorname{Opt}(G_N) \le2w(T) and the total cost incurred in a phase with parameters NN and bb is at most O(b+log⁡N/log⁡b)w(T)O(b+\log N/\log b)w(T).

Construction of the auxiliary graph $G_N$ from the state immediately before visiting $v$

Figure 3. Construction of the auxiliary graph GNG_N from the state immediately before visiting vv. The left panel shows the exploration state immediately before visiting vv, whose visit causes the number of learned vertices to exceed NN. Here, filled vertices are explored, hollow vertices are boundary vertices, gray vertices and dotted edges are unrevealed. On the right, GNG_N is depicted. The blue edges are edges not (necessarily) present in GG.

We can thus bound all cost incurred in the first two phases by a constant times Opt⁡(G)\operatorname{Opt}(G), which we hide in the OO-notation for the desired competitive ratio. From the third phase on, we have N≥16N \ge16 so that b=log⁡Nb=\sqrt{\log N}, and the cost of such a phase is bounded by O(log⁡N/log⁡log⁡N)w(T)O(\log N/\log\log N)w(T).

The guess in phase ii is N=22iN=2^{2^i} and log⁡N/log⁡log⁡N=2i/i\log N/\log\log N=2^i/i. The algorithm terminates once the guess is at least nn, i.e., in phase ii for i=⌈log⁡log⁡n⌉i=\lceil\log\log n\rceil. Absorbing the first two phases into the constant term hidden in the OO-notation, we obtain the bound

Adaptive-hDFS(G,s)≤O(1+∑i=2⌈log⁡log⁡n⌉2ii)w(T)=O(log⁡nlog⁡log⁡n)w(T).\mathop{\mathrm{Adaptive\text{-}hDFS}}(G,s) \le O\left(1+\sum_{i=2}^{\lceil\log\log n\rceil}\frac{2^i}{i}\right)w(T)=O\left(\frac{\log n}{\log\log n}\right)w(T).

Here, the sum is bounded by a constant multiple of its last term. Since w(T)≤Opt⁡(G)w(T)\le\operatorname{Opt}(G), this proves the claimed competitive ratio. □\square

AI disclosure. The result presented in this paper was developed with the assistance of Chat-GPT 6 Astra through discussions of ideas for improved algorithms for online graph exploration. Following these discussions, the author independently verified the mathematical arguments, simplified the proof, and prepared the exposition. The author assumes full responsibility for the mathematical correctness of all presented arguments and the quality of the exposition.

References

  1. [1]Sanjeev Arora. Polynomial time approximation schemes for Euclidean traveling salesman and other geometric problems. Journal of the ACM, 45(5):753–782, 1998. doi:10.1145/290179.290180.DOI
  2. [2]Júlia Baligács. A lower bound of 4 for online graph exploration. In Proceedings of the 17th Latin American Theoretical Informatics Symposium (LATIN), 2026.arxiv.org/abs/2607.15113
  3. [3]Alexander Birx, Yann Disser, Alexander V. Hopp, and Christina Karousatou. An improved lower bound for competitive graph exploration. Theoretical Computer Science, 868:65–86, 2021.arxiv.org/abs/2002.10958
  4. [4]Júlia Baligács, Yann Disser, Irene Heinrich, and Pascal Schweitzer. Exploration of graphs with excluded minors. Journal of Computer and System Sciences, 156:103725, 2026.arxiv.org/abs/2308.06823
  5. [5]Sebastian Brandt, Klaus-Tycho Foerster, Jonathan Maurer, and Roger Wattenhofer. Online graph exploration on a restricted graph class: Optimal solutions for tadpole graphs. Theoretical Computer Science, 839:176–185, 2020.arxiv.org/abs/1903.00581
  6. [6]Hans-Joachim Böckenhauer, Janosch Fuchs, and Walter Unger. Exploring sparse graphs with advice. Information and Computation, 289:104950, 2022. doi:10.1016/j.ic.2022.104950.DOI
  7. [7]Yair Bartal, Lee-Ad Gottlieb, and Robert Krauthgamer. The traveling salesman problem: Low-dimensionality implies a polynomial time approximation scheme. In Proceedings of the 44th Annual ACM Symposium on Theory of Computing (STOC), pages 663–672, 2012. doi:10.1145/2213977.2214038.DOI
  8. [9]Nicos Christofides. Worst-case analysis of a new heuristic for the travelling salesman problem. Technical Report 388, Graduate School of Industrial Administration, Carnegie Mellon University, 1976.
  9. [10]Romain Cosson and Laurent Massoulié. Collective tree exploration via potential function method. In Proceedings of the 15th Innovations in Theoretical Computer Science Conference (ITCS), volume 287, pages 35:1–35:22, 2024.
  10. [12]Romain Cosson, Laurent Massoulié, and Laurent Viennot. Efficient collaborative tree exploration with breadth-first depth-next. In Proceedings of the 37th International Symposium on Distributed Computing (DISC), volume 281, pages 14:1–14:21, 2023. doi:10.4230/LIPIcs.DISC.2023.14.DOI
  11. [13]Romain Cosson. Breaking the k / log k barrier in collective tree exploration via tree-mining. In Proceedings of the 35th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4264–4282, 2024.arxiv.org/abs/2309.07011
  12. [14]Dariusz Dereniowski, Yann Disser, Adrian Kosowski, Dominik Pająk, and Przemysław Uznański. Fast collaborative graph exploration. Information and Computation, 243:37–49, 2015.
  13. [15]Stefan Dobrev, Rastislav Královič, and Euripides Markou. Online graph exploration with advice. In Proceedings of the 19th International Colloquium on Structural Information and Communication Complexity (SIROCCO), pages 267–278, 2012.DOI
  14. [16]Yann Disser, Frank Mousset, Andreas Noever, Nemanja Skoric, and Angelika Steger. A general lower bound for collaborative tree exploration. Theoretical Computer Science, 811:70–78, 2020.
  15. [17]Xiaotie Deng and Christos H. Papadimitriou. Exploring an unknown graph. Journal of Graph Theory, 32(3):265–297, 1999. doi:10.1002/(SICI)1097-0118(199911)32:3<265::AID-JGT6>3.0.CO;2-8.doi.org/10.1002/(sici)1097-0118(199911)32:3<265::aid-jgt6>3.0.co;2-8
  16. [18]Franziska Eberle, Alexander Lindermayr, Nicole Megow, Lukas Nölke, and Jens Schlöter. Robustification of online graph exploration methods. In Proceedings of the 36th Conference on Artificial Intelligence (AAAI), pages 9732–9740, 2022.
  17. [19]Pierre Fraigniaud, Leszek Ga̧sieniec, Dariusz R. Kowalski, and Andrzej Pelc. Collective tree exploration. Networks, 48(3):166–177, 2006. doi:10.1002/net.20127.
  18. [20]Robin Fritsch. Online graph exploration on trees, unicyclic graphs and cactus graphs. Information Processing Letters, 168:106096, 2021.DOI
  19. [21]Rudolf Fleischer and Gerhard Trippen. Exploring an unknown graph efficiently. In Proceedings of the 13th Annual European Symposium on Algorithms (ESA), volume 3669, pages 11–22, 2005.DOI
  20. [22]Klaus-Tycho Foerster and Roger Wattenhofer. Lower and upper competitive bounds for online directed graph exploration. Theoretical Computer Science, 655:15–29, 2016.DOI
  21. [23]Leonid Gurvits, Nathan Klein, and Jonathan Leake. From trees to polynomials and back again: New capacity bounds with applications to TSP. In 51st International Colloquium on Automata, Languages, and Programming (ICALP 2024), volume 297, pages 79:1–79:20, 2024. doi:10.4230/LIPIcs.ICALP.2024.79.
  22. [24]Matthias Gehnen, Ralf Klasing, and Émile Naquin. Graph exploration with edge weight estimates. In Proceedings of the 17th Latin American Theoretical Informatics Symposium (LATIN), 2026.arxiv.org/abs/2501.18496
  23. [25]Stefan Hougardy and Mirko Wilde. On the nearest neighbor rule for the metric traveling salesman problem. Discrete Applied Mathematics, 195:101–103, 2015.arxiv.org/abs/1401.2071
  24. [26]Anna R. Karlin, Nathan Klein, and Shayan Oveis Gharan. A (slightly) improved approximation algorithm for metric TSP. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 32–45, 2021. doi:10.1145/3406325.3451009.DOI
  25. [27]Koji M. Kobayashi and Ying Li. An improved upper bound for the online graph exploration problem on unicyclic graphs. Journal of Combinatorial Optimization, 48:4, 2024. doi:10.1007/s10878-024-01192-0.DOI
  26. [28]Philip N. Klein. A linear-time approximation scheme for TSP for planar weighted graphs. In Proceedings of the 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 647–657, 2005.
  27. [29]Bala Kalyanasundaram and Kirk R. Pruhs. Constructing competitive tours from local information. Theoretical Computer Science, 130(1):125–138, 1994.
  28. [30]Shuichi Miyazaki, Naoyuki Morimoto, and Yasuo Okabe. The online graph exploration problem on restricted graphs. IEICE Transactions on Information and Systems, E92-D(9):1620–1627, 2009.DOI
  29. [31]Nicole Megow, Kurt Mehlhorn, and Pascal Schweitzer. Online graph exploration: New results on old and new algorithms. Theoretical Computer Science, 463:62–72, 2012.
  30. [32]Tobias Mömke and Ola Svensson. Approximating graphic TSP by matchings. In Proceedings of the 52nd Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 560–569, 2011. doi:10.1109/FOCS.2011.56.DOI
  31. [33]Christian Ortolf and Christian Schindelhauer. A recursive approach to multi-robot exploration of trees. In Proceedings of the 21st International Colloquium on Structural Information and Communication Complexity (SIROCCO), volume 8576, pages 343–354, 2014. doi:10.1007/978-3-319-09620-9_26.DOI
  32. [34][OSS11] Shayan Oveis Gharan, Amin Saberi, and Mohit Singh. A randomized rounding approach to the traveling salesman problem. In Proceedings of the 52nd Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 550–559, 2011. doi:10.1109/FOCS.2011.80.DOI
  33. [35][RSL77] Daniel J. Rosenkrantz, Richard E. Stearns, and Philip M. Lewis, II. An analysis of several heuristics for the traveling salesman problem. SIAM Journal on Computing, 6(3):563–581, 1977.
  34. [36][STV20] Ola Svensson, Jakub Tarnawski, and László A. Végh. A constant-factor approximation algorithm for the asymmetric traveling salesman problem. Journal of the ACM, 67(6):37:1–37:53, 2020. doi:10.1145/3424306.DOI
  35. [37][TV20] Vera Traub and Jens Vygen. An improved approximation algorithm for ATSP. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 1–13, 2020. doi:10.1145/3357713.3384233.DOI

Paper details

vlnc:W_tpr5rqdz
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents