How to find the number of different shortest paths between two vertices, in directed graph and with linear-time?
问题 Here is the exercise: Let v and w be two vertices in a directed graph G = (V, E). Design a linear-time algorithm to find the number of different shortest paths (not necessarily vertex disjoint) between v and w. Note: the edges in G are unweighted For this excise, I summarise as follows: It is a directed graph It asks for the number of different shortest paths . First, the paths should be shortest, then there might be more than one such shortest paths whose length are the same. between v and w