#include <KShortestPaths.h>
|
| KShortestPaths (DirectedGraph input_graph, Vertex source, Vertex sink) |
|
void | Run (size_t max_path_count) |
|
void | GetPaths (std::vector< std::vector< Vertex >> &paths) |
|
Finds the k-shortest paths in a specified graph, from the source vertex to the sink vertex. The algorithm provides a global optimal path, thus reducing the overall sum of all path costs in trade off for higher cost of one single path.
algo::KShortestPaths::KShortestPaths |
( |
DirectedGraph |
input_graph, |
|
|
Vertex |
source, |
|
|
Vertex |
sink |
|
) |
| |
Initializes the algorithm for the specified graph with the specified source and sink vertex to find a path between.
- Parameters
-
input_graph | The graph to work with (will not be altered) |
source | The vertex to start all path searches from |
sink | The vertex to end all path searches at |
void algo::KShortestPaths::GetPaths |
( |
std::vector< std::vector< Vertex >> & |
paths | ) |
|
Gets the last found paths.
- Parameters
-
paths | The vector to store all found paths in |
void algo::KShortestPaths::Run |
( |
size_t |
max_path_count | ) |
|
Runs the algorithm to store the specified number of paths. These paths can later be retrieved by the GetPaths method.
- Parameters
-
max_path_count | The number of paths to find |
The documentation for this class was generated from the following files: