|
GraphLibrary
0.0.1
A simple library that implements various graph algorithms.
|
Class that provides Graph traversal using the BFS scheme. More...
#include <BFS.hpp>
Public Member Functions | |
| BFS (const Graph &, const idx_t) | |
| Computation constructor. More... | |
| BFS () | |
| Default constructor. More... | |
| BFS (const BFS &)=default | |
| Copy constructor. More... | |
| BFS (BFS &&) noexcept=default | |
| Move constructor. More... | |
| BFS & | operator= (const BFS &)=default |
| Copy assignment. More... | |
| BFS & | operator= (BFS &&)=default |
| Move assignment. More... | |
| ~BFS ()=default | |
| Default destructor. More... | |
| void | compute (const Graph &graph, const idx_t src) |
| Computation. This is where the BFS algorithm is performed. More... | |
| ordered_list_t | getTraversalOrder () const |
| Computes the BFS node traversal order from the source. More... | |
| ordered_list_t | getTraversalOrderMaxDistance (const idx_t &distance) const |
| Computes the BFS node traversal order from the source. More... | |
| idx_list_t | getNodesExactDistance (const idx_t &distance) const |
| Computes all nodes that are at the exact distance given from the source. More... | |
| idx_t | getNodeDistance (const idx_t &dest) const |
| Returns the number of edges between 'src' and 'dest'. More... | |
| idx_list_t | getNodesMaxDistance (const idx_t &distance) const |
| Computes all nodes that are at within a maximum distance given from the source. More... | |
| ordered_list_t | getPath (const idx_t &dest) const |
| Computes the BFS shortest path from 'src' to 'dest'. More... | |
Private Types | |
| using | idx_t = typename Graph::idx_t |
| Type of indices. More... | |
| using | ordered_list_t = typename Graph::ordered_list_t |
| Ordered node ID list. More... | |
| using | visit_list_t = typename Graph::visit_list_t |
| Boolean list that stored previously visited nodes. More... | |
| using | BFS_queue_t = std::deque< idx_t > |
| Data structure for BFS searches. More... | |
| using | distance_list_t = std::vector< idx_t > |
| Stores BFS distances of each node. More... | |
| using | idx_list_t = typename Graph::idx_list_t |
| Unordered node ID list. More... | |
Private Attributes | |
| bool | isInitialized_ = false |
| Boolean storing initialization status. More... | |
| idx_t | src_ |
| Source node. More... | |
| idx_list_t | parents_ |
| Parents on shortest path tree. More... | |
| ordered_list_t | final_ |
| BFS Traversal order. More... | |
| distance_list_t | distances_ |
| List containing distances from source. More... | |
|
private |
Type of indices.
|
private |
Ordered node ID list.
|
private |
Boolean list that stored previously visited nodes.
|
private |
Data structure for BFS searches.
|
private |
Stores BFS distances of each node.
|
private |
Unordered node ID list.
|
explicit |
| gl::algorithm::BFS< Graph >::BFS | ( | ) |
Default constructor.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Default destructor.
|
default |
Copy assignment.
|
default |
Move assignment.
| void gl::algorithm::BFS< Graph >::compute | ( | const Graph & | graph, |
| const idx_t | src | ||
| ) |
| Graph::ordered_list_t gl::algorithm::BFS< Graph >::getTraversalOrder | ( | ) | const |
| Graph::ordered_list_t gl::algorithm::BFS< Graph >::getTraversalOrderMaxDistance | ( | const idx_t & | distance | ) | const |
| Graph::idx_list_t gl::algorithm::BFS< Graph >::getNodesExactDistance | ( | const idx_t & | distance | ) | const |
Computes all nodes that are at the exact distance given from the source.
| [in] | distance | Exact distance to source of the nodes that are to be found. |
| Graph::idx_t gl::algorithm::BFS< Graph >::getNodeDistance | ( | const idx_t & | dest | ) | const |
| Graph::idx_list_t gl::algorithm::BFS< Graph >::getNodesMaxDistance | ( | const idx_t & | distance | ) | const |
Computes all nodes that are at within a maximum distance given from the source.
| [in] | distance | Maximum distance to source of the nodes that are to be found. |
| Graph::ordered_list_t gl::algorithm::BFS< Graph >::getPath | ( | const idx_t & | dest | ) | const |
|
private |
Boolean storing initialization status.
|
private |
Source node.
|
private |
Parents on shortest path tree.
|
private |
BFS Traversal order.
|
private |
List containing distances from source.