TADM2E 6.19

From Algorithm Wiki
Jump to: navigation, search

Simple application of Floyd-Warshall algorithm for directed graphs O(n^3).

After running the algorithm we need to search main diagonal for minimum amount, which is additional O(n).