|
GraphLibrary
0.0.1
A simple library that implements various graph algorithms.
|
Class that computes Dijkstra's Shortest Paths algorithm. More...
#include <Dijkstra.hpp>
Public Member Functions | |
| Dijkstra (const Graph graph) | |
| Initialized Constructor. More... | |
| Dijkstra () | |
| Default constructor. More... | |
| Dijkstra (const Dijkstra &)=default | |
| Copy constructor. More... | |
| Dijkstra (Dijkstra &&) noexcept=default | |
| Move constructor. More... | |
| Dijkstra & | operator= (const Dijkstra &)=default |
| Copy assignment. More... | |
| Dijkstra & | operator= (Dijkstra &&) noexcept=default |
| Move assignment. More... | |
| ~Dijkstra ()=default | |
| Default destructor. More... | |
| Distance< val_t > | pathLength (const idx_t src, const idx_t dest) |
| std::pair< bool, typename Graph::idx_list_t > | getPath (const idx_t src, const idx_t dest) |
| Computes the node sequence that represents the shortest path from src to dest. More... | |
| Graph | getSPT (const idx_t src) |
| Returns a graph that only contains the edges of the SPT (Shortest Path Tree) More... | |
| void | initialize (const Graph graph) |
| Initializes the algorithm with a new Graph. More... | |
Private Types | |
| using | idx_t = typename Graph::idx_t |
| using | val_t = typename Graph::val_t |
| using | pair_t = std::pair< Distance< val_t >, idx_t > |
| using | result_t = std::vector< pair_t > |
Private Member Functions | |
| void | compute (const idx_t src) |
| Computation. This is where the shortest distances and the predecessors of each node on the shortest path tree get computed. More... | |
Private Attributes | |
| bool | isInitializedWithGraph_ |
| Boolean indicating whether the class has been initialized with a Graph. More... | |
| std::vector< bool > | isInitializedWithSource_ |
| Boolean vector indicating whether the node whose ID corresponds to an element in the vector had its shortest path tree computed. More... | |
| Graph | graph_ |
| Source Graph. More... | |
| std::vector< Graph > | result_ |
| SPT graph. More... | |
| std::vector< result_t > | final_ |
| Shortest Path lengths & predecessors. More... | |
Class that computes Dijkstra's Shortest Paths algorithm.
|
private |
|
private |
|
private |
|
private |
|
explicit |
| gl::algorithm::Dijkstra< Graph >::Dijkstra | ( | ) |
Default constructor.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Default destructor.
|
default |
Copy assignment.
|
defaultnoexcept |
Move assignment.
| gl::Distance< typename Graph::val_t > gl::algorithm::Dijkstra< Graph >::pathLength | ( | const idx_t | src, |
| const idx_t | dest | ||
| ) |
| std::pair< bool, typename Graph::idx_list_t > gl::algorithm::Dijkstra< Graph >::getPath | ( | const idx_t | src, |
| const idx_t | dest | ||
| ) |
Computes the node sequence that represents the shortest path from src to dest.
| [in] | src | Start of shortest path |
| [in] | dest | End of shortest path |
| Graph gl::algorithm::Dijkstra< Graph >::getSPT | ( | const idx_t | src | ) |
| void gl::algorithm::Dijkstra< Graph >::initialize | ( | const Graph | graph | ) |
|
private |
Computation. This is where the shortest distances and the predecessors of each node on the shortest path tree get computed.
| [in] | src | Source node. All shortest paths will be computed from here. |
|
private |
Boolean indicating whether the class has been initialized with a Graph.
|
private |
Boolean vector indicating whether the node whose ID corresponds to an element in the vector had its shortest path tree computed.
|
private |
Source Graph.
|
private |
SPT graph.
|
private |
Shortest Path lengths & predecessors.