#include <BFS.hpp>
|
| template<typename TGraph , typename TNode , typename F = std::function<void(const TNode &, const size_t &)>> |
| static void | run (const TGraph &graph, const TNode &start, F f_user=[](const TNode &, const size_t &) -> bool { return false;}) |
| |
| template<typename TGraph , typename TNode , typename F = std::function<void(const TNode &, const size_t &)>> |
| static ext::vector< TNode > | findPath (const TGraph &graph, const TNode &start, const TNode &goal, F f_user=[](const TNode &, const size_t &) {}) |
| |
| template<typename TGraph , typename TNode > |
| static ext::vector< TNode > | findPathRegistration (const TGraph &graph, const TNode &start, const TNode &goal) |
| |
| template<typename TGraph , typename TNode , typename F = std::function<void(const TNode &, const size_t &)>> |
| static ext::vector< TNode > | findPathBidirectional (const TGraph &graph, const TNode &start, const TNode &goal, F f_user=[](const TNode &, const size_t &) {}) |
| |
| template<typename TGraph , typename TNode > |
| static ext::vector< TNode > | findPathBidirectionalRegistration (const TGraph &graph, const TNode &start, const TNode &goal) |
| |
◆ findPath()
template<typename TGraph , typename TNode , typename F >
| ext::vector< TNode > graph::traverse::BFS::findPath |
( |
const TGraph & |
graph, |
|
|
const TNode & |
start, |
|
|
const TNode & |
goal, |
|
|
F |
f_user = [](const TNode &, const size_t &) {} |
|
) |
| |
|
static |
Find the shortest path using BFS algorithm from the start node to the goal node in the graph.
Whenever node is opened, f_user is called with two parameters (the opened node and distance to this node).
- Parameters
-
| graph | to explore. |
| start | initial node. |
| goal | final node. |
| f_user | function which is called for every opened node with value of currently shortest path. |
- Returns
- nodes in shortest path, if there is no such path vector is empty.
◆ findPathBidirectional()
template<typename TGraph , typename TNode , typename F >
| ext::vector< TNode > graph::traverse::BFS::findPathBidirectional |
( |
const TGraph & |
graph, |
|
|
const TNode & |
start, |
|
|
const TNode & |
goal, |
|
|
F |
f_user = [](const TNode &, const size_t &) {} |
|
) |
| |
|
static |
Find the shortest path using BFS algorithm from the start node to the goal node in the graph. This algorithm is run in both direction, from start and also from goal.
Whenever node is opened, f_user is called with two parameters (the opened node and distance to this node).
- Parameters
-
| graph | to explore. |
| start | initial node. |
| goal | final node. |
| f_user | function which is called for every opened node with value of currently shortest path. |
- Returns
- nodes in shortest path, if there is no such path vector is empty.
◆ findPathBidirectionalRegistration()
template<typename TGraph , typename TNode >
| static ext::vector< TNode > graph::traverse::BFS::findPathBidirectionalRegistration |
( |
const TGraph & |
graph, |
|
|
const TNode & |
start, |
|
|
const TNode & |
goal |
|
) |
| |
|
inlinestatic |
◆ findPathRegistration()
template<typename TGraph , typename TNode >
| static ext::vector< TNode > graph::traverse::BFS::findPathRegistration |
( |
const TGraph & |
graph, |
|
|
const TNode & |
start, |
|
|
const TNode & |
goal |
|
) |
| |
|
inlinestatic |
◆ run()
template<typename TGraph , typename TNode , typename F >
| void graph::traverse::BFS::run |
( |
const TGraph & |
graph, |
|
|
const TNode & |
start, |
|
|
F |
f_user = [](const TNode &, const size_t &) -> bool { return false; } |
|
) |
| |
|
static |
Run BFS algorithm from the start node in the graph.
Whenever node is opened, f_user is called with two parameters (the opened node and distance to this node). If return of f_user is true, then the algorithm is stopped.
- Parameters
-
| graph | to explore. |
| start | initial node. |
| f_user | function which is called for every opened node with value of currently shortest path. |
The documentation for this class was generated from the following file:
- alib2graph_algo/src/traverse/BFS.hpp