|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Educational examples for path reconstruction from distance matrices. More...
Go to the source code of this file.
Functions | |
| int | main () |
Educational examples for path reconstruction from distance matrices.
After running Floyd-Warshall all-pairs shortest paths algorithm, you get a distance matrix D[i][j] = shortest distance from i to j But how do you get the ACTUAL PATH?
During Floyd-Warshall, maintain P[i][j] = intermediate node on path Then recursively reconstruct the path from P matrix
Distance alone isn't enough - you need the route! GPS needs: "Turn left, then right" not just "10 miles away"
g++ -std=c++20 -I.. -o mat_path_example mat_path_example.cc ./mat_path_example
Definition in file mat_path_example.cc.
| int main | ( | ) |
Definition at line 34 of file mat_path_example.cc.
References Aleph::maps(), and N.