algorithm Johnson Algorithm to find the shortest paths between all pair of vertices Johnson Algorithm is used to find shortest paths between every pair of vertices in a given weighted directed graph and here weights may be negative. Johnson Algorithm uses both Dijkstra and Bellman-Ford algorithms as subroutines.

graph algorithm Dijkstra's algorithm: Finding shortest path between all nodes Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph. Dijkstra's algorithm is applicable for: Both directed and undirected graphs, All edges must have nonnegative weights, Graph must be connected