|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Floyd-Warshall algorithm with LaTeX output generation. More...
Go to the source code of this file.
Classes | |
| struct | Aleph::Initialize_Dist< AM > |
| Matrix initialization functor for Floyd-Warshall. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Functions | |
| template<class GT , class Compare , class Plus > | |
| void | Aleph::floyd_all_shortest_paths (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path) |
| Compute all-pairs shortest paths using Floyd-Warshall algorithm. | |
| template<class GT > | |
| void | Aleph::floyd_all_shortest_paths (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path) |
| Overload using default comparison (less) and addition (plus). | |
| template<class Mat > | |
| void | Aleph::find_min_path (Mat &p, const long src_index, const long tgt_index, Path< typename Mat::Graph_Type > &path) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Variant that accepts const indices. | |
| template<class Mat > | |
| void | Aleph::find_min_path (Mat &p, typename Mat::Node *src_node, typename Mat::Node *tgt_node, Path< typename Mat::Graph_Type > &path) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Reconstruct shortest path from path matrix using node pointers. | |
| template<class GT , class Compare , class Plus , template< class > class P_i, template< class > class P_ij, template< class > class D_ij> | |
| void | Aleph::floyd_all_shortest_paths_latex (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path, std::ofstream &output) |
| Floyd-Warshall algorithm with LaTeX step-by-step output. | |
| template<class GT , template< class > class P_i, template< class > class P_ij, template< class > class D_ij> | |
| void | Aleph::floyd_all_shortest_paths_latex (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path, std::ofstream &output) |
| Overload using default comparison (less) and addition (plus). | |
Floyd-Warshall algorithm with LaTeX output generation.
This file provides the Floyd-Warshall all-pairs shortest path algorithm with optional LaTeX output that shows the distance and path matrices at each iteration step.
Floyd-Warshall computes shortest paths between all pairs of vertices in O(V³) time and O(V²) space. It works with:
floyd_all_shortest_paths(): Core algorithmfloyd_all_shortest_paths_latex(): Algorithm with LaTeX step-by-step outputfind_min_path(): Path reconstruction from the path matrixThe arc type GT::Arc_Type must provide:
Distance_Type (e.g., int, double)Max_Distance (infinity value)Zero_Distance (identity for addition)get_distance() returning the arc weightDefinition in file latex_floyd.H.