Given a weighted, directed graph with **n** vertices (edge weights may be **negative**) and a source vertex, return the shortest distances from the source to every vertex using the **Bellman-Ford algorithm**. If the graph contains a **negative-weight cycle** reachable from the source, return `null`.
Interactive graph explorer available!
Switch to the Visualize tab to build a custom graph and animate BFS traversal to test your intuition.