How to Find the “Routes” of All-Pairs Shortest Paths With the Floyd-Warshall Algorithm in C#
SMRTR summary
The Floyd-Warshall algorithm for finding shortest paths between all vertex pairs in a graph has been extended to capture actual routes, not just distances. This involves storing intermediate vertices in a separate matrix during calculations. Route reconstruction uses this data to backtrack from destination to source. While adding route tracking slightly increases memory usage and computation time for large graphs, it generally has minimal impact. C# implementations of both original and vectorized algorithms with route tracking are provided, along with methods to rebuild full paths between vertices.
SMRTR provides this summary for quick context. The original article belongs to HackerNoon.
Read the original article