Dijkstra Bellman-Ford Prim's MST Kruskal's MST
Design Graph → Press Next
Define Custom Directed Routing Network:
Bellman-Ford State Tracking Table
Step Iteration Loop Edge Evaluated (u → v) Relaxation Distance Matrix

Bellman-Ford Computation

Unlike Dijkstra's greedy search strategy, the Bellman-Ford algorithm uses a dynamic programming structure. It systematically relaxes all directional pathways across the layout through a total of V - 1 iterations, where V is the total count of active variables inside your custom system.

This comprehensive method enables it to map distances accurately even when path weights are negative numbers.

Negative Cycle Detection

After running V - 1 loops, the code initializes a final check step across the structure. If a value optimization still triggers during this pass, it indicates that a negative loop exists, causing path weights to collapse toward negative infinity.