Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
#include <Dijkstra.hpp>
Static Public Member Functions | |
template<typename TGraph , typename TNode , typename F = std::function<bool(const TNode &, const typename TGraph::edge_type::weight_type &)>> | |
static void | run (const TGraph &graph, const TNode &start, F f_user=[](const TNode &, const typename TGraph::edge_type::weight_type &) -> bool { return false;}) |
template<typename TGraph , typename TNode , typename F = std::function<void(const TNode &, const typename TGraph::edge_type::weight_type &)>> | |
static ext::pair< ext::vector< TNode >, typename TGraph::edge_type::weight_type > | findPath (const TGraph &graph, const TNode &start, const TNode &goal, F f_user=[](const TNode &, const typename TGraph::edge_type::weight_type &) {}) |
template<typename TGraph , typename TNode > | |
static ext::pair< ext::vector< TNode >, typename TGraph::edge_type::weight_type > | findPathRegistration (const TGraph &graph, const TNode &start, const TNode &goal) |
template<typename TGraph , typename TNode , typename F = std::function<void(const TNode &, const typename TGraph::edge_type::weight_type &)>> | |
static ext::pair< ext::vector< TNode >, typename TGraph::edge_type::weight_type > | findPathBidirectional (const TGraph &graph, const TNode &start, const TNode &goal, F f_user=[](const TNode &, const typename TGraph::edge_type::weight_type &) {}) |
template<typename TGraph , typename TNode > | |
static ext::pair< ext::vector< TNode >, typename TGraph::edge_type::weight_type > | findPathBidirectionalRegistration (const TGraph &graph, const TNode &start, const TNode &goal) |
|
static |
Find the shortest path using Dijkstra 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 value of currently shortest path).
graph | to explore. |
start | initial node. |
goal | final node. |
f_user | function which is called for every open node with value of currently shortest path. |
graph
must follow graph::edge::WeightedEdge interface. std::out_of_range | if graph contains an edge with a negative weight. |
|
static |
Find the shortest path using Dijkstra 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 value of currently shortest path).
graph | to explore. |
start | initial node. |
goal | final node. |
f_user | function which is called for every open node with value of currently shortest path. |
graph
must follow graph::edge::WeightedEdge interface. std::out_of_range | if graph contains an edge with a negative weight. |
|
inlinestatic |
|
inlinestatic |
|
static |
Run Dijkstra algorithm from the start
node in the graph
.
Whenever node is opened, f_user
is called with two parameters (the opened node and value of currently shortest path). If return of f_user
is true, then the algorithm is stopped.
graph | to explore. |
start | initial node. |
f_user | function which is called for every opened node with value of currently shortest path. |
graph
must follow graph::edge::WeightedEdge interface. std::out_of_range | if graph contains an edge with a negative weight. |