⚡ SPFA — Queue-Optimized Bellman-Ford Full Demo
Shortest Path O(E) avg Step 0/12
📊 Graph (supports Neg Edges, starting from node 0)
🗂 Data Structures
Queue (regular queue)
dist[] Shortest Distance
inQueue[] State
Average: O(E)
Worst: O(VE)
💻 Code
HintClick Next Step ▶ to start and observe how SPFA uses a regular queue instead of a priority queue, re-enqueuing nodes when their distance is updated.
0/12

Keyboard: Next   Prev   R Reset