Bellman-Ford
The Bellman-Ford algorithm is a method used in computer science to find the shortest paths from a single source vertex to all other vertices in a weighted graph. It can handle graphs with negative weight edges, making it more versatile than some other algorithms like Dijkstra's.
The algorithm works by repeatedly relaxing the edges of the graph, which means it updates the shortest path estimates. It performs this relaxation for a number of iterations equal to the number of vertices minus one. If a shorter path is found after this process, it indicates the presence of a negative weight cycle.