|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Floyd-Warshall algorithm with LaTeX output generation. More...
#include <ah-graph-concepts.H>#include <utility>#include <ahFunction.H>#include <tpl_array.H>#include <tpl_matgraph.H>#include <mat_latex.H>#include <mat_path.H>Go to the source code of this file.
Classes | |
| struct | Aleph::Initialize_Dist< AM, Compare > |
| Matrix initialization functor for Floyd-Warshall. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
| namespace | Aleph::latex_floyd_detail |
Functions | |
| template<AlephGraph GT, class Compare > | |
| void | Aleph::latex_floyd_detail::initialize_matrices (Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path) |
| template<AlephGraph 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<AlephGraph 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<AlephGraph 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<AlephGraph 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:
Of the parallel arcs between two nodes, the lightest counts. A loop does not count: the diagonal starts at Zero_Distance. The functions do not detect negative cycles, a negative loop among them: with one, the matrices do not hold distances.
floyd_all_shortest_paths(): Core algorithmfloyd_all_shortest_paths_latex(): Algorithm with LaTeX step-by-step outputfind_min_path(), from mat_path.H, which this header includes: 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.