arXiv:2608.24380cs.DSAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.24380

Instance-Optimality of Bidirectional Dijkstra on Simple Graphs

Christian Bertram, Mads Vestergaard Jensen, Mikkel Thorup, Hanzhi Wang, Shuyi Yan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We study the shortest-path problem on graphs with positive real-valued edge weights. Given a source vertex s and a target vertex t, the goal is to calculate the length of the shortest path from s to t. We are particularly interested in instances that can be solved in sublinear time.

Recently, Haeupler, Hladík, Rozhoň, Tarjan, and Tětek [HHR +^{+}25] proved that (a version of) the bidirectional Dijkstra's algorithm is instance-optimal on positively weighted multigraphs, both directed and undirected, considering the number of vertices and edges queried by the algorithm. Here, being instance-optimal means best within a constant factor on every possible instance, but this is only compared against algorithms that are correct on every valid instance.

However, multigraphs are not the canonical setting for the shortest-path problem. The problem is typically formulated on simple graphs without loops and parallel edges. [HHR+25][HHR^{+}25] therefore left as an open problem whether bidirectional Dijkstra remains instance-optimal on simple weighted graphs.

We answer this question, but for simple graphs, the answer is more complex, depending on the setting. We show that bidirectional Dijkstra is still instance-optimal on simple undirected weighted graphs under the order-oblivious model, where incident edges are given in a random order. In contrast, under the order-dependent model, where incident edges have a given order, we show that bidirectional Dijkstra is not instance-optimal: it is off by a factor of Θ(min⁡{⌈m/n⌉,n1/3})\Theta(\min\{\lceil m/n\rceil, n^{1/3}\}), where mm and nn denote the number of edges and vertices, respectively. Nonetheless, we show that this is the best possible in the sense that no algorithm can have an instance-optimality ratio of o(min⁡{⌈m/n⌉,n1/3})o(\min\{\lceil m/n\rceil, n^{1/3}\}).

For simple directed weighted graphs, we show that bidirectional Dijkstra is not instance-optimal under either the order-oblivious or the order-dependent model, being off by a factor of Θ(⌈m/n⌉)\Theta(\lceil m/n \rceil) in both cases. We further show that no algorithm can have instance-optimality ratio o(⌈m/n⌉)o(\lceil m/n \rceil) under the order-dependent model, or under the order-oblivious model when m=O(nn)m = O(n\sqrt{n}). On the positive side, the above results imply that bidirectional Dijkstra is instance-optimal up to logarithmic factors on all sparse directed and undirected graphs satisfying m/n=log⁡O(1)nm/n = \log^{O(1)} n.

Besides the above main bounds, we also study the instance-optimality if we have an upper bound Δ\Delta on the maximal degree of the graph, and for instances that can be solved in o(n)o(n) time.

Finally we show that most of the instance-non-optimality is due to degree-queries: if there are no degree-queries then bidirectional Dijkstra is order-dependent instance-optimal on undirected graphs and order-oblivious instance-optimal on directed graphs.

∗^{*}This work was supported by the VILLUM Foundation grant 54451.

Contents

1 Introduction 3
1.1 Model 6
1.2 Additional results 8
1.3 Paper Organization 10

2 Revisiting the Bidirectional Dijkstra's Algorithm 10
2.1 Dijkstra's Algorithm 10
2.2 Bidirectional Dijkstra 11
2.3 Fixed Minor Error From [HHR +^{+}25] 12
2.4 Correctness of Bidirectional Dijkstra 13
2.5 Properties of Bidirectional Dijkstra 14

3 Setting Up the Analysis Framework 15
3.1 Lower Bounds 16
3.2 Upper Bounds 16

4 Order-Oblivious Instance-Optimality for Undirected Graphs 18

5 Order-Dependent Instance-Non-Optimality for Directed Graphs 19

6 Order-Oblivious Instance-Non-Optimality for Directed Graphs 20

7 Order-Dependent Instance-Non-Optimality for Undirected Graphs 23

8 More Instance-Optimality 25
8.1 Directed Graphs 25
8.2 Undirected Graphs 28
8.3 Few high-degree vertices 30

9 No degree queries 31
9.1 Order-Oblivious Instance-Optimality for Directed Graphs 31
9.2 Order-Dependent Instance-Non-Optimality for Directed Graphs 32
9.3 Order-Dependent Instance-Optimality for Undirected Graphs 33

10 Zero-Weight Graphs and Unit-Weight Graphs 34

References (25)