To assess how “well-connected” two nodes in a directed graphare, one can not only look at the length of the shortest pathbetween them, but can also count the number of shortest paths. Thisturns out to be a problem that can be solved efficiently, subjectto some restrictions on the edge costs. Suppose we are given adirected graph G = (V, E), with costs on the edges; the costs maybe positive or negative, but every cycle in the graph has strictlypositive cost. We are also given two nodes v, w ∈ V . Give anefficient algorithm that computes the number of shortest
OR
OR