Shortest-Walk Problem (SWP) Overview
- SWP is defined as minimizing a sequence of traversals under various constraints, extending classic shortest-path concepts to dynamic and structured settings.
- Different formulations target objectives like reducing edge count, transmission time, or convex cost accumulations, with applications in waypoint routing, circuit walks, and label-constrained databases.
- Algorithmic approaches, from spectral descent to quantum and ant-inspired dynamics, reveal both efficiently solvable cases and NP-hard challenges in SWP variants.
In the cited literature, the Shortest-Walk Problem (SWP) denotes a family of optimization problems whose common core is the minimization of a walk rather than merely an unconstrained static path. Depending on the ambient structure, the walk may lie on the $1$-skeleton of a polytope, in a temporal graph, in a graph of convex sets, or in a graph database subject to regular-language constraints. The objective may be the number of traversed edges, the total transmission time, or the cumulative value of coupled convex programs, and repeated vertices or edges may be either allowed or essential (Cardinal et al., 2023, Morozov et al., 15 Jul 2025, Himmel et al., 2019). In undirected graphs with nonnegative weights, an optimal walk can be taken to be simple, so SWP collapses to the classical shortest-path problem; many of the deepest results therefore arise in models where time dependence, reconfiguration, coverage, or non-additive costs make the walk formulation strictly richer (Wesołowski et al., 2024).
1. Formal definitions and model variants
One general graph-theoretic formalization defines a walk as a finite nonempty alternating sequence with and ; its length is (David et al., 2023). In ordinary undirected graphs with nonnegative edge weights, repeated vertices or edges cannot improve the objective, so shortest walks and shortest simple paths coincide (Wesołowski et al., 2024). Outside that regime, the admissible walk and its cost are model dependent.
| Setting | Feasible object | Objective |
|---|---|---|
| Polytope skeleton | Path on the $1$-skeleton between two vertices | Minimize number of edges (Cardinal et al., 2023) |
| Graph of Convex Sets | Walk with per-visit variables and convex edge couplings | Minimize cumulative convex cost (Morozov et al., 15 Jul 2025) |
| Temporal graph | Strict temporal walk with waiting constraints | Minimize a chosen linear criterion, including (Himmel et al., 2019) |
| RPQ graph database | Walk whose label sequence matches an NFA or regular expression | Enumerate all distinct minimum-length walks (David et al., 2023) |
| Temporal exploration | Strict walk visiting all vertices within lifetime | Minimize traversed edges (Balev et al., 9 Apr 2025) |
Other formulations alter feasibility rather than the ambient space. Waypoint routing asks for a capacitated walk from to that visits a prescribed set of waypoints (Amiri et al., 2017). Circuit-walk variants replace edges of a polyhedron by circuits and optimize either the number of maximal circuit steps or their total 0-norm length (Borgwardt et al., 2024). Two-player span models seek shortest optimal pairs of walks that maintain a prescribed minimum separation while jointly covering a graph (Dravec et al., 2024). In phylogenetics, the relevant walk is a nearest-neighbor-interchange walk that visits an entire subtree-prune-and-regraft neighborhood (Caceres et al., 2011).
2. Polyhedral, circuit, and reconfiguration formulations
A central polyhedral version of SWP asks: given a polytope 1 described by linear inequalities and two vertices 2, find a shortest path from 3 to 4 on the skeleton of 5, where length is the number of traversed edges (Cardinal et al., 2023). The most studied class in this context is that of generalized permutohedra, equivalently polymatroid base polytopes, characterized by the property that every edge is parallel to a vector of the form 6. Equivalently, there exists a submodular function 7 such that
8
This framework captures several classical flip or exchange distances. For matroid bases, vertices correspond to bases and the shortest-path length equals 9. For graphical zonotopes, vertices correspond to acyclic orientations and the distance equals the number of differently oriented edges. For Loday’s associahedron, shortest paths coincide with triangulation flip distance, equivalently binary-search-tree rotation distance. For graph associahedra, shortest paths become flip distances between elimination trees. Hypergraphic polytopes generalize these constructions further, with vertices corresponding to acyclic orientations of a hypergraph and adjacency given by pair-flips (Cardinal et al., 2023).
Circuit-walk formulations replace edge directions by circuits of a polyhedron 0. A circuit is a nonzero vector in 1 whose image under 2 is support-minimal; a circuit walk from 3 to 4 is a sequence of maximal feasible steps along circuits. Here “short” has two distinct meanings: few steps, or small total length 5. Sign-compatible variants require the circuit directions to form a conformal sum of 6 with respect to 7, and “facet-picking” variants ask whether a first step can pick up a correct facet of a target vertex. These notions generalize non-revisiting edge walks and are tied to circuit diameter and augmentation theory (Borgwardt et al., 2024).
Both families connect SWP to reconfiguration. In generalized permutohedra, shortest skeleton paths become flip sequences on combinatorial objects. In circuit geometry, shortest walks become minimal augmentations in a direction space strictly larger than the edge graph. This is one reason SWP sits simultaneously in combinatorial optimization, geometric reconfiguration, and linear-programming theory.
3. Graph, routing, label-constrained, and covering walks
Waypoint routing is a direct graph-theoretic SWP variant. The input is an undirected, connected, capacitated, weighted graph 8, a source 9, a destination 0, and a waypoint set 1. The task is to find a walk from 2 to 3 that visits all waypoints, respects edge capacities, and minimizes total length 4, where 5 is the number of traversals of 6. The problem admits an exact algorithm in time 7 on graphs of treewidth 8, and a randomized polynomial-time algorithm 9 when the number of waypoints is 0. It is NP-hard on maximum-degree-1 families where Hamiltonian Cycle is NP-hard, including grid graphs of maximum degree 2 and 3-regular bipartite planar graphs, and remains NP-hard already for 4 for every fixed 5 (Amiri et al., 2017).
In graph databases, SWP appears as the Distinct Shortest Walks problem for regular path queries. The input consists of a multi-labeled directed graph database 6, vertices 7, and an NFA 8. One seeks to enumerate all distinct walks of minimum length 9 from $1$0 to $1$1 whose label set intersects the language of $1$2. The algorithmic challenge is that one walk may induce exponentially many accepted runs because edges may carry multiple labels. An annotation-and-trim procedure yields preprocessing $1$3 and delay $1$4, and $1$5-transitions or regular expressions can be handled at no additional asymptotic cost (David et al., 2023).
Another non-additive variant is the edge information reuse shortest path problem. Here a DAG $1$6 is equipped with a label map $1$7 satisfying $1$8, and the cost of a simple $1$9-0 path is the sum of weights of distinct labels used along the path, each counted once. Although the underlying graph is acyclic, the non-additive objective makes the problem NP-complete by reduction from 3SAT. This provides an SWP model in which the main difficulty lies not in cycles or time dependence, but in set-valued cost accumulation (Träff, 2015).
There are also covering and inference variants. In phylogenetics, one considers the graph 1 whose vertices are the trees in the one-step SPR neighborhood of an unrooted binary phylogenetic tree 2, with edges given by single NNI moves. The shortest covering walk that visits the entire neighborhood has length 3, where 4; the additive 5 overhead rules out Hamiltonian coverage in general (Caceres et al., 2011). In degree-6 inference problems, the input is a label sequence produced by a walk on an unknown path or cycle graph; repeated contraction of 7 yields the unique 8-normal form, which is exactly the shortest consistent path in the minimum inferred graph. That normal form can be computed online in 9 time using a Manacher-style palindrome mechanism (Narisada et al., 2018). Finally, span-constrained models encode two simultaneous walkers by a product graph and then seek the minimum number of moves required for both projections to cover all vertices while maintaining distance at least the graph’s span; the paper gives polynomial-time span computation followed by exponential search for the shortest optimal walk in the filtered product graph (Dravec et al., 2024).
4. Temporal, exploration, and mixed discrete–continuous walks
Temporal SWP replaces a static graph by a time-indexed edge process. In one general model, a temporal graph is a five-tuple 0, where a time-arc 1 departs at time 2, arrives at 3, and every intermediate waiting time must satisfy
4
The framework supports foremost, reverse-foremost, fastest, shortest, cheapest, minimum hop-count, minimum total waiting time, and any nonnegative linear combination of these criteria. “Shortest” in this setting means minimizing 5. A transformation removes transmission times and minimum waiting constraints by expanding the graph, after which a single-source algorithm based on time-layered modified Dijkstra and reset arcs computes optimal walks in 6 time (Himmel et al., 2019).
A different temporal variant is the Shortest Temporal Exploration Problem (STEXP). Given an undirected temporal graph 7 that is connected at each time step, a start vertex, and the full evolution offline, the task is to find a strict temporal walk that visits all vertices, uses at most one edge per time step, finishes by time 8, and traverses as few edges as possible. Every constantly connected temporal graph with 9 vertices admits an exploration using 0 traversals within 1 time steps. If every snapshot has diameter at most 2, then there exists an exploration using 3 edges and 4 time steps. For temporal cycles with 5, the worst-case number of traversals is exactly 6 when 7, and exactly 8 when 9 (Balev et al., 9 Apr 2025).
Graphs of Convex Sets (GCS) provide a mixed discrete–continuous SWP. A GCS is a directed graph in which each vertex carries a convex program 0 and each edge 1 carries convex coupling constraints 2 and a convex edge cost 3. A walk 4 may revisit vertices, but each visit has its own decision variable, and the cost is
5
The Bellman equation holds for the optimal cost-to-go 6, and lower bounds 7 can be synthesized by solving an infinite-dimensional Bellman-inequality LP approximately with piecewise-quadratic functions and semidefinite programming. These bounds guide an incremental lookahead search with backtracking, post-processing, cycle shortcutting, and an a posteriori suboptimality certificate 8. The problem is NP-hard even on acyclic graphs, but each local subproblem is convex, and the method supports collision-free motion planning, skill chaining, and hybrid-system control (Morozov et al., 15 Jul 2025).
5. Algorithmic paradigms
One influential paradigm is spectral descent. For a fixed target 9 in a finite, simple, connected, undirected graph, one defines
00
equivalently the smallest eigenvector of the Laplacian minor 01. Starting from 02, one repeatedly moves to a neighbor minimizing 03. The walk strictly decreases 04, terminates at 05 in at most 06 steps, is simple, and on trees equals the unique shortest path. On general graphs the method is often exact but not universally so; the paper reports exact recovery of all pairwise shortest paths on several symmetric graphs and near-optimal behavior on random geometric graphs (Steinerberger, 2020).
A related but more metric-oriented line defines walk distances from the resolvent
07
where 08 is the weighted adjacency matrix. After an elementwise logarithm and a centering transform, one obtains a graph-geodetic metric that converges to the shortest-path distance as the parameter approaches the appropriate limit and to the long-walk distance at the opposite end. The long-walk distance equals resistance distance in a transformed graph, and logarithmic forest distances form a subclass of these walk distances on balance-graphs (Chebotarev, 2011). This is not an SWP solver in the algorithmic sense, but it supplies a continuous family interpolating between shortest-path and global connectivity behavior.
Quantum algorithms offer another regime. In the adjacency-list model, and under structural conditions ensuring that the shortest 09-10 path is uniquely optimal in an effective-resistance sense, one approach samples a quantum flow state to sparsify the graph and then runs a classical shortest-path routine, with query complexity 11 and 12 space. A divide-and-conquer alternative uses resistance tests and flow-state sampling to reconstruct the path in 13 steps with 14 space, or in parallel depth 15 with 16 space. In undirected graphs with nonnegative weights, the paper explicitly interprets SWP as equivalent to shortest path, so these bounds apply directly to shortest walks in that setting (Wesołowski et al., 2024).
At the opposite end of the algorithmic spectrum, distributed ant-inspired dynamics solve variants of SWP with only local information. Each edge carries pheromone 17, ants split proportionally to pheromone, and the update is
18
With constant bidirectional flow and vertex leakage, the dynamics converges to a path of minimum leakage and therefore to the path with the minimum number of vertices under uniform leakage. With zero leakage and increasing flow, it converges to the shortest path. The analysis is proved for two parallel paths, while simulations support the same behavior on random and grid-like graphs. The paper also shows that bidirectional flow and the proportional decision rule are necessary for guaranteed convergence to the shortest path (Garg et al., 2020).
6. Complexity landscape, implications, and open directions
Across formulations, SWP is algorithmically easy only in special structures. For ordinary unweighted graphs it is solved exactly by breadth-first search in 19 (Steinerberger, 2020). For RPQ-constrained minimum-length walks, polynomial preprocessing and delay are available (David et al., 2023). For bounded-treewidth waypoint routing there is an exact 20 algorithm, and for linear hypergraphs the flip distance between acyclic orientations is computable exactly in polynomial time because the maximum codegree 21 is 22 (Amiri et al., 2017, Cardinal et al., 2023). In temporal graphs with waiting-time constraints, single-source optimal walks are computable in 23 (Himmel et al., 2019). These positive results are structurally narrow.
The hardness results are correspondingly broad. Shortest paths on generalized permutohedra are strongly NP-hard even when the polytope is the intersection of an axis-aligned box with a single hyperplane, hence described by only 24 inequalities (Cardinal et al., 2023). Hypergraphic flip distance is APX-hard even when every hyperedge has size at most 25 and the hypergraph has bounded maximum degree, and in the oracle model there exists 26 such that no 27-approximation exists unless 28 (Cardinal et al., 2023). On 29-network-flow polytopes, deciding whether the circuit distance is at most 30, whether a shortest sign-compatible decomposition has at most 31 circuits, or whether the minimum total 32-norm length of a circuit walk is below a threshold is NP-complete (Borgwardt et al., 2024). Edge-information reuse is NP-complete even on DAGs with weights in 33 (Träff, 2015). Waypoint routing is NP-hard already on degree-34 graph classes, and GCS shortest walks are NP-hard even on acyclic graphs (Amiri et al., 2017, Morozov et al., 15 Jul 2025).
These barriers have conceptual consequences. The polymatroid hardness results imply that, unless 35, there is no computationally efficient simplex pivoting rule that always reaches an optimum in the minimum number of nondegenerate pivots even when the feasible region is a polymatroid base polytope (Cardinal et al., 2023). Circuit-walk hardness similarly shows that replacing edges by circuits does not remove the essential combinatorial difficulty of constructing globally short augmentations (Borgwardt et al., 2024). Temporal exploration demonstrates that the static intuition “a spanning tree costs 36 edges” fails sharply once time-respecting feasibility is imposed (Balev et al., 9 Apr 2025).
Several open problems remain explicit in the cited work. Rotation distance for convex polygons, hence exact shortest paths on the associahedron, remains open, and the flip distance for rectangulations is also open (Cardinal et al., 2023). For spectral descent, characterizing graph classes beyond trees for which greedy 37-descent is always exact is open, as are average-case bounds and the role of planar structure (Steinerberger, 2020). In the circuit setting, whether computing circuit diameter is NP-hard is open, and for conformal sums the cases 38 remain unresolved (Borgwardt et al., 2024). For ant-inspired dynamics, general-graph convergence proofs remain conjectural (Garg et al., 2020). For temporal exploration, the paper conjectures that constantly connected temporal graphs admit 39-time, 40-move exploration schedules, improving on the current 41-time, 42-move general bound (Balev et al., 9 Apr 2025).
Taken together, these results present SWP not as a single problem with a single canonical definition, but as a recurring optimization pattern across discrete geometry, graph algorithms, temporal networks, database querying, planning, and reconfiguration. What remains invariant is the central question: when feasibility is encoded by a walk rather than a static path, which structural assumptions make the optimum accessible, and which turn it into a source of hardness?