weighed and connected and directed graph G=(V,E) is given and there are pre-calculated shortest path distance\'s matrix S.
G=(V,E)
S(i,j) denotes th
S(i,j)