Dijkstra vs Bounded Multi-Source Shortest Path

Side-by-side 2D replay of classic global-min extraction and a naive BMSSP implementation based on arXiv:2504.17033. The BMSSP side preserves the paper's pivot-finding, bounded recursion, mini-Dijkstra base case, and batch-prepend flow while using simple maps and sorts for clarity.

Ready
0 / 0

Dijkstra

Extract one globally closest unsettled vertex, then relax outgoing edges.
step 0
source active queue settled scanned edge
phase
event

Naive BMSSP

Find pivots with bounded Bellman-Ford waves, then recurse on distance bands.
step 0
source active BF wave pivot complete
phase
event

Current Step Difference

Step through the replay to see where each algorithm spends its effort.

Performance Crossover

The asymptotic lens will update after the graph is generated.

Dijkstra ≈ m + n log n; BMSSP ≈ m log^(2/3)n

When BMSSP Wins

BMSSP needs large, sparse, directed non-negative-weight graphs and the optimized data structure from the paper.

Proof Burden

A real speed-up proof is not a visual claim. It has to prove BMSSP's completeness invariant, the pivot-shrink lemma, partial-return accounting, and amortized bounds for Insert, Pull, and BatchPrepend.

The difficult part is showing the recursion never secretly pays back Dijkstra's full n log n ordering cost.

What To Compare

Dijkstra spends work maintaining one global distance order. BMSSP avoids fully sorting vertices: it runs FindPivots for k Bellman-Ford-style waves, keeps only source vertices whose local shortest-path trees are large, and recursively pulls bounded batches.

Identical final distances are expected. Both algorithms solve the same single-source shortest-path problem; the claimed gain is in how much distance ordering work is avoided, not in producing a different shortest-path tree.

Efficiency Lens

This demo intentionally uses naive arrays, maps, and local sorting so the replay is readable. That reintroduces sorting costs the paper's optimized partition structure is designed to avoid, and the trace renderer itself adds overhead. Treat toy sort work as a warning label, not the paper's runtime.

The theoretical comparison is Dijkstra's O(m + n log n) ordering cost versus the paper's sparse-graph O(m log^(2/3)n) bound using its real data structure.

Source Mapping

The BMSSP implementation maps to the paper's FindPivots(B,S), BaseCase(B,S), and BMSSP(l,B,S) routines. The related tweet is linked here for context: x.com/BrianRoemmele/status/2053806333846315462.

Toy Divergence

For a small visible divergence, choose Sparse fanout stress or Sparse layered stress, set Extra out-edges to 0, and raise nodes toward 72.

You should see Dijkstra repeatedly make global frontier choices, while BMSSP spends time in pivot waves and bounded batches. The page's crossover panel shows the paper-level projection; the raw JS replay still is not a benchmark.