65# ifndef K_SHORTEST_PATHS_H
66# define K_SHORTEST_PATHS_H
73# include <type_traits>
94 template <AlephGraph GT,
typename Cost_Type>
102 namespace k_shortest_paths_detail
104 template <AlephGraph GT,
typename Cost_Type>
113 template <AlephGraph GT,
typename Cost_Type>
128 template <AlephGraph GT, ArcDistance<GT> Distance,
163 for (Itor<GT, SA> it(p, sa); it.has_curr(); it.next_ne())
164 if (
Node * q = it.get_tgt_node(); seen.
insert(q) !=
nullptr)
170 template <AlephGraph GT, ArcFilter<GT> SA>
205 template <AlephGraph GT, ArcDistance<GT> Distance>
229 <<
"Reverse_Arc_Distance: reverse arc map is null";
231 <<
"Reverse_Arc_Distance: base distance functor is null";
234 auto * orig_arc =
pair ==
nullptr ? nullptr :
pair->second;
236 <<
"Reverse_Arc_Distance: missing reverse-to-original arc map";
243 template <AlephGraph GT, ArcDistance<GT> Distance, ArcFilter<GT> SA>
244 requires std::is_arithmetic_v<typename Distance::Distance_Type>
254 Arc *arc = it.get_curr_ne();
255 const Cost_Type
w = distance(arc);
257 if constexpr (std::is_floating_point_v<Cost_Type>)
259 <<
"K shortest paths require finite arc weights";
262 <<
"K shortest paths require non-negative arc weights";
267 template <AlephGraph GT,
typename Cost_Type>
275 template <AlephGraph GT,
typename Cost_Type>
281 snapshot.arcs.reserve(path.
arcs.
size());
283 for (
auto it = path.
nodes.
get_it(); it.has_curr(); it.next_ne())
284 snapshot.
nodes.append(it.get_curr_ne());
286 for (
auto it = path.
arcs.
get_it(); it.has_curr(); it.next_ne())
287 snapshot.arcs.append(it.get_curr_ne());
293 template <AlephGraph GT,
typename Cost_Type>
294 Path_State<GT, Cost_Type>
303 if (it.has_current_arc())
311 template <AlephGraph GT,
typename Cost_Type>
322 for (
auto it = state.
arcs.
get_it(); it.has_curr(); it.next_ne())
327 for (
auto it = state.
arcs.
get_it(); it.has_curr(); it.next_ne())
328 path.
append(it.get_curr_ne());
335 template <AlephGraph GT,
typename Cost_Type>
346 while (an.has_curr())
348 if (an.get_curr_ne() != bn.get_curr_ne())
356 while (aa.has_curr())
358 if (aa.get_curr_ne() != ba.get_curr_ne())
368 template <AlephGraph GT,
typename Cost_Type>
371 const size_t spur_index)
378 for (
size_t i = 0; i <= spur_index; ++i)
382 for (
size_t i = 0; i < spur_index; ++i)
390 template <AlephGraph GT,
typename Cost_Type>
394 for (
const auto & p: container)
401 template <AlephGraph GT,
typename Cost_Type>
407 return p ==
nullptr ? nullptr : p->second;
411 template <AlephGraph GT,
typename Cost_Type>
417 return p ==
nullptr ? nullptr : p->second;
421 template <
template <
class,
class>
class Itor,
423 Suffix_Index<GT, typename Distance::Distance_Type>
437 Node * node = it.get_curr_ne();
442 auto & mg =
const_cast<GT &
>(g);
450 for_each_left_out<Itor, GT, SA>(target, sa, [&index] (
Node * p)
457 Node * node = it.get_curr_ne();
466 if (parent ==
nullptr)
469 Arc * selected =
nullptr;
472 Arc * arc = ait.get_current_arc_ne();
480 if (selected ==
nullptr)
484 bool has_best =
false;
485 Cost_Type best_diff{};
488 Arc * arc = ait.get_current_arc_ne();
489 if (ait.get_tgt_node() != parent)
495 const Cost_Type
diff =
496 cand >= dist_node ? cand - dist_node : dist_node - cand;
497 if (not has_best or
diff < best_diff)
513 template <AlephGraph GT, ArcDistance<GT> Distance, ArcFilter<GT> SA>
514 Suffix_Index<GT, typename Distance::Distance_Type>
533 Node * node = it.get_curr_ne();
538 orig_to_rev.
insert(node, rev_node);
539 rev_to_orig.
insert(rev_node, node);
544 Arc * arc = it.get_curr_ne();
549 orig_to_rev.
find(tgt),
550 orig_to_rev.
find(src),
552 rev_arc_to_orig.
insert(rev_arc, arc);
557 Reverse_Distance::map_ptr = &rev_arc_to_orig;
558 Reverse_Distance::base_ptr = &distance;
561 struct Reset_Reverse_Distance
563 ~Reset_Reverse_Distance()
565 Reverse_Distance::map_ptr =
nullptr;
566 Reverse_Distance::base_ptr =
nullptr;
568 } reset_reverse_distance;
575 reverse_dijkstra{Reverse_Distance(), Rev_Show_Arc()};
577 Node * rev_target = orig_to_rev.
find(target);
578 reverse_dijkstra.paint_min_paths_tree(reverse_graph, rev_target);
579 if (reverse_dijkstra.went_beyond_max())
580 for_each_left_out<Node_Arc_Iterator, GT, Rev_Show_Arc>(
581 rev_target, Rev_Show_Arc(), [&index, &rev_to_orig] (
Node * p)
589 if (
Node * rev_node = rit.get_curr_ne();
592 reverse_dijkstra.get_distance(rev_node));
596 Node * rev_node = rit.get_curr_ne();
597 Node * orig_node = rev_to_orig.
find(rev_node);
603 if (rev_parent ==
nullptr)
606 Node * orig_parent = rev_to_orig.
find(rev_parent);
609 Arc * selected =
nullptr;
612 bool has_best =
false;
613 Cost_Type best_diff{};
616 Arc * arc = ait.get_current_arc_ne();
617 if (ait.get_tgt_node() != orig_parent)
620 if (selected ==
nullptr)
623 if (Cost_Type cand{};
626 const Cost_Type
diff =
627 cand >= dist_u ? cand - dist_u : dist_u - cand;
628 if (not has_best or
diff < best_diff)
644 template <AlephGraph GT, ArcDistance<GT> Distance, ArcFilter<GT> SA>
645 Suffix_Index<GT, typename Distance::Distance_Type>
652 return build_suffix_index_digraph<GT, Distance, SA>(
653 g, target, distance, sa);
655 return build_suffix_index_with_itor<Node_Arc_Iterator, GT, Distance, SA>(
656 g, target, distance, sa);
660 template <AlephGraph GT,
typename Cost_Type>
678 while (curr != target)
680 if (++guard > max_steps)
685 if (
next ==
nullptr or arc ==
nullptr)
700 template <AlephGraph GT, ArcDistance<GT> Distance, ArcFilter<GT> SA>
714 if (forbidden_nodes !=
nullptr and
718 if (source == target)
721 out.total_cost = Cost_Type{0};
722 out.nodes.append(source);
727 const_cast<GT &
>(g).reset_nodes();
728 const_cast<GT &
>(g).reset_arcs();
730 Filter
filter{&g, sa, forbidden_nodes, forbidden_arcs};
737 dist = dijkstra(g, source, target, shortest);
749 out = path_to_state<GT, Cost_Type>(shortest, dist);
755 template <AlephGraph GT, ArcDistance<GT> Distance>
761 for (
auto it =
arcs.get_it(); it.has_curr(); it.next_ne())
768 template <AlephGraph GT,
typename Cost_Type>
769 Path_State<GT, Cost_Type>
771 const size_t spur_index,
776 for (
size_t i = 0; i <= spur_index; ++i)
779 for (
size_t i = 0; i < spur_index; ++i)
782 bool first_spur_node =
true;
783 for (
auto it = spur_state.
nodes.
get_it(); it.has_curr(); it.next_ne())
787 first_spur_node =
false;
794 for (
auto it = spur_state.
arcs.
get_it(); it.has_curr(); it.next_ne())
801 template <AlephGraph GT,
typename Cost_Type>
802 Path_State<GT, Cost_Type>
804 const size_t spur_index,
805 typename GT::Arc * deviation_arc,
806 typename GT::Node * deviation_next_node,
811 for (
size_t i = 0; i <= spur_index; ++i)
814 for (
size_t i = 0; i < spur_index; ++i)
820 bool first_suffix_node =
true;
821 for (
auto it = suffix_state.
nodes.
get_it(); it.has_curr(); it.next_ne())
823 if (first_suffix_node)
825 first_suffix_node =
false;
832 for (
auto it = suffix_state.
arcs.
get_it(); it.has_curr(); it.next_ne())
842 template <AlephGraph GT, ArcDistance<GT> Distance, ArcFilter<GT> SA,
typename Cost_Type>
861 make_path_snapshot<GT, Cost_Type>(base_path);
863 Cost_Type prefix_cost = Cost_Type{0};
864 const size_t arc_count = base_snapshot.
arcs.
size();
868 for (
size_t spur_index = 0; spur_index <= arc_count; ++spur_index)
870 Node * spur_node = base_snapshot.
nodes[spur_index];
871 Arc * base_arc = spur_index < arc_count ? base_snapshot.
arcs[spur_index] :
nullptr;
875 Arc * deviation_arc = it.get_current_arc_ne();
876 if (deviation_arc == base_arc)
879 Node * deviation_next_node = it.get_tgt_node();
881 if (dist_of_next ==
nullptr)
888 const Cost_Type suffix_dist = dist_of_next->second;
898 Cost_Type through{}, total{};
900 prefix_cost, distance(deviation_arc), through)
908 compose_general_candidate<GT, Cost_Type>(
919 candidates.append(candidate);
922 if (base_arc !=
nullptr)
968 template <AlephGraph
GT,
971 requires std::is_arithmetic_v<typename Distance::Distance_Type>
995 if (source == target)
998 item.total_cost = Cost_Type{0};
1011 bool beyond =
false;
1013 if (not k_shortest_paths_detail::shortest_path_filtered<GT, Distance, SA>(
1014 g, source, target, distance, sa,
nullptr,
nullptr, first, beyond))
1017 <<
"yen_k_shortest_paths(): the cost of the path 1 does not fit in its type";
1023 for (
size_t kth = 1; kth <
k; ++kth)
1025 const State & previous = accepted.
get_last();
1026 const auto previous_snapshot =
1027 k_shortest_paths_detail::make_path_snapshot<GT, Cost_Type>(previous);
1028 if (previous_snapshot.nodes.size() < 2)
1034 for (
const State & p: accepted)
1035 accepted_snapshots.
append(
1036 k_shortest_paths_detail::make_path_snapshot<GT, Cost_Type>(p));
1038 for (
size_t spur_index = 0; spur_index + 1 < previous_snapshot.nodes.size();
1041 Node *spur_node = previous_snapshot.nodes[spur_index];
1046 for (
size_t i = 0; i < spur_index; ++i)
1047 forbidden_nodes.
insert(previous_snapshot.nodes[i]);
1049 for (
size_t p_idx = 0; p_idx < accepted_snapshots.
size(); ++p_idx)
1051 const auto & p_snapshot = accepted_snapshots[p_idx];
1053 p_snapshot, previous_snapshot, spur_index))
1054 forbidden_arcs.
insert(p_snapshot.arcs[spur_index]);
1058 if (not k_shortest_paths_detail::shortest_path_filtered<GT, Distance, SA>(
1072 previous_snapshot, spur_index, spur_state);
1073 if (not k_shortest_paths_detail::cost_of_arcs_if_fits<GT, Distance>(
1074 candidate.arcs, distance, candidate.total_cost))
1082 candidates.
append(candidate);
1088 size_t best_idx = 0;
1089 for (
size_t i = 1; i < candidates.
size(); ++i)
1090 if (candidates[i].total_cost < candidates[best_idx].total_cost)
1093 State best = candidates[best_idx];
1094 if (best_idx + 1 < candidates.
size())
1095 candidates[best_idx] = candidates.
get_last();
1096 const auto removed_candidate = candidates.
remove_last();
1097 (void) removed_candidate;
1104 <<
"yen_k_shortest_paths(): the cost of the path " << accepted.
size() + 1
1105 <<
" does not fit in its type";
1107 for (
const State & state: accepted)
1110 item.total_cost = state.total_cost;
1167 template <AlephGraph
GT,
1170 requires std::is_arithmetic_v<typename Distance::Distance_Type>
1187 ah_domain_error_if(source ==
nullptr) <<
"eppstein_k_shortest_paths(): source is null";
1188 ah_domain_error_if(target ==
nullptr) <<
"eppstein_k_shortest_paths(): target is null";
1192 if (source == target)
1195 item.total_cost = Cost_Type{0};
1206 const auto suffix_index =
1207 k_shortest_paths_detail::build_suffix_index<GT, Distance, SA>(
1208 g, target, distance, sa);
1211 if (not k_shortest_paths_detail::build_suffix_state<GT, Cost_Type>(
1212 g, suffix_index, source, target, first))
1216 <<
"eppstein_k_shortest_paths(): the cost of the walk 1 does not fit in its type";
1223 bool beyond =
false;
1225 if (accepted.
size() <
k)
1226 k_shortest_paths_detail::generate_general_deviation_candidates<GT, Distance, SA, Cost_Type>(
1227 g, first, target, suffix_index, distance, sa, accepted, candidates, beyond);
1231 size_t best_idx = 0;
1232 for (
size_t i = 1; i < candidates.
size(); ++i)
1233 if (candidates[i].total_cost < candidates[best_idx].total_cost)
1236 State best = candidates[best_idx];
1237 if (best_idx + 1 < candidates.
size())
1238 candidates[best_idx] = candidates.
get_last();
1239 const auto removed_candidate = candidates.
remove_last();
1240 (void) removed_candidate;
1246 if (accepted.
size() <
k)
1247 k_shortest_paths_detail::generate_general_deviation_candidates<GT, Distance, SA, Cost_Type>(
1248 g, best, target, suffix_index, distance, sa, accepted, candidates, beyond);
1253 <<
"eppstein_k_shortest_paths(): the cost of the walk " << accepted.
size() + 1
1254 <<
" does not fit in its type";
1256 for (
const State & state: accepted)
1259 item.total_cost = state.total_cost;
1281 template <AlephGraph
GT,
1329 const size_t k)
const
1330 requires std::is_arithmetic_v<typename Distance::Distance_Type>
1332 return yen_k_shortest_paths<GT, Distance, SA>(
1342 template <AlephGraph
GT,
1383 const size_t k)
const
1384 requires std::is_arithmetic_v<typename Distance::Distance_Type>
1386 return eppstein_k_shortest_paths<GT, Distance, SA>(
Dijkstra's shortest path algorithm.
Exception handling system with formatted messages for Aleph-w.
#define ah_overflow_error_if(C)
Throws std::overflow_error if condition holds.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
#define ah_runtime_error_if(C)
Throws std::runtime_error if condition holds.
C++20 concepts for the protocol shared by graph algorithms.
WeightedDigraph::Node Node
List_Graph< Graph_Node< Node_Info >, Graph_Arc< Arc_Info > > GT
size_t size_t int32_t * out
Simple dynamic array with automatic resizing and functional operations.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
constexpr bool is_empty() const noexcept
Checks if the container is empty.
T & get_last()
Return a modifiable reference to the last element.
T & append(const T &data)
Append a copy of data
void reserve(size_t cap)
Reserves cap cells into the array.
RAII guard that saves and restores graph cookies.
Default distance accessor for arc weights.
Spanning tree calculation of all shortest paths from a given node according to Dijkstra's algorithm.
void paint_min_paths_tree(const GT &g, typename GT::Node *start)
Paints on graph g the spanning tree of all shortest paths starting from start.
Distance::Distance_Type get_distance(typename GT::Node *node)
Gets the accumulated distance to a node after painting.
Dynamic queue of elements of generic type T based on single linked list.
T & put(const T &data)
The type of element.
T get()
Remove the oldest item of the queue.
bool is_empty() const noexcept
Return true if this is empty.
Doubly-linked list (defined in tpl_dynList.H).
T & get_first()
Return the first item of the list.
T & append(const T &item)
size_t size() const noexcept
Return the number of items of the list, in constant time.
Generic key-value map implemented on top of a binary search tree.
Pair * search(const Key &key) noexcept(nothrow_search)
Collect all keys.
Pair * insert(const Key &key, const Data &data)
Insert a key-value pair.
Data & find(const Key &key)
Find the value associated with key.
Dynamic set backed by balanced binary search trees with automatic memory management.
Key * insert(const Key &key)
Inserts a key into the dynamic set.
bool contains(const Key &key) const
Checks if a key exists in the set.
bool is_empty() const
returns true if the set is empty
Functor wrapper for Eppstein-style k-shortest paths API.
DynList< K_Shortest_Path_Item< GT, typename Distance::Distance_Type > > operator()(const GT &g, typename GT::Node *source, typename GT::Node *target, const size_t k) const
Compute k shortest general (loopy) paths.
Eppstein_K_Shortest_Paths(Distance distance=Distance(), SA sa=SA())
void next_ne() noexcept(shows_ne)
Advances the iterator to the next filtered element, as next() does.
constexpr bool is_empty() const noexcept
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Graph_Node< Node_Info > Node
The graph type.
Graph_Arc< Arc_Info > Arc
The node class type.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
Filtered iterator on the nodes of a graph.
Iterator on nodes and arcs of a path.
bool has_current_node() const noexcept
Return true if the iterator has a current node.
bool is_empty() const noexcept
Return true if the path is empty.
void set_graph(const GT &__g, Node *start_node=nullptr)
Set the graph of the path.
void append(Arc *arc)
Append an arc to the path.
void append_directed(Node *p)
Append a node to a directed path.
Distance distance
Arc weights.
bool leave_out_beyond_max
Whether a painting leaves out without throwing the nodes whose distance does not fit.
bool beyond_max
A sum of the painting went beyond max()
Functor wrapper for Yen's k-shortest loopless paths algorithm.
DynList< K_Shortest_Path_Item< GT, typename Distance::Distance_Type > > operator()(const GT &g, typename GT::Node *source, typename GT::Node *target, const size_t k) const
Compute k shortest loopless paths.
Yen_K_Shortest_Paths(Distance distance=Distance(), SA sa=SA())
A painting of Dijkstra that leaves out the nodes whose distances do not fit, as nodes that the start ...
bool went_beyond_max() const noexcept
Whether a sum of the last painting went beyond max(), so that it may have left out some node.
Painting_Within_Max(Distance distance, SA sa)
A painting with the distance and the filter sa.
void reset_arcs() const
Reset all the arcs of graph (the control bits, the state, the counter and the cookie)
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
Node * get_src_node(Arc *arc) const noexcept
Return the source node of arc (only for directed graphs)
bool is_digraph() const noexcept
Return true if the graph this is directed.
void reset_nodes() const
Reset all the nodes of graph (the control bits, the state, the counter and the cookie)
Node * get_tgt_node(Arc *arc) const noexcept
Return the target node of arc (only for directed graphs)
auto get_it()
Return a properly initialized iterator positioned at the first item on the container.
A graph usable by the graph algorithms.
An arc distance (Distance) for graph GT.
An arc filter (SA) for graph GT.
RAII guards for graph node/arc cookies.
DynArray< Graph::Arc * > arcs
DynList< K_Shortest_Path_Item< GT, typename Distance::Distance_Type > > yen_k_shortest_paths(const GT &g, typename GT::Node *source, typename GT::Node *target, const size_t k, Distance distance=Distance(), SA sa=SA())
Compute k shortest loopless paths using Yen's algorithm.
#define IS_NODE_VISITED(p, bit)
Determine whether the control bit is set or not to one.
DynList< K_Shortest_Path_Item< GT, typename Distance::Distance_Type > > eppstein_k_shortest_paths(const GT &g, typename GT::Node *source, typename GT::Node *target, const size_t k, Distance distance=Distance(), SA sa=SA())
Compute k shortest general (loopy) paths.
#define NODE_COOKIE(p)
Return the node cookie
#define IS_ARC_VISITED(p, bit)
Determine whether the bit field is or not set to one.
Singly linked list implementations with head-tail access.
Knapsack_Item< int, int > Item
Path< GT > state_to_path(const GT &g, const Path_State< GT, Cost_Type > &state)
GT::Node * get_tree_next(const Suffix_Index< GT, Cost_Type > &index, typename GT::Node *node)
Suffix_Index< GT, typename Distance::Distance_Type > build_suffix_index(const GT &g, typename GT::Node *target, Distance distance, SA sa)
Path_State< GT, Cost_Type > compose_general_candidate(const Path_Snapshot< GT, Cost_Type > &base_path, const size_t spur_index, typename GT::Arc *deviation_arc, typename GT::Node *deviation_next_node, const Path_State< GT, Cost_Type > &suffix_state)
bool contains_path(const Array< Path_State< GT, Cost_Type > > &container, const Path_State< GT, Cost_Type > &candidate)
bool shortest_path_filtered(const GT &g, typename GT::Node *source, typename GT::Node *target, Distance distance, SA sa, const DynSetTree< typename GT::Node * > *forbidden_nodes, const DynSetTree< typename GT::Arc * > *forbidden_arcs, Path_State< GT, typename Distance::Distance_Type > &out, bool &beyond)
bool same_path_sequence(const Path_State< GT, Cost_Type > &a, const Path_State< GT, Cost_Type > &b)
Path_State< GT, Cost_Type > compose_candidate(const Path_Snapshot< GT, Cost_Type > &base_path, const size_t spur_index, const Path_State< GT, Cost_Type > &spur_state)
void generate_general_deviation_candidates(const GT &g, const Path_State< GT, Cost_Type > &base_path, typename GT::Node *target, const Suffix_Index< GT, Cost_Type > &suffix_index, Distance distance, SA sa, const Array< Path_State< GT, Cost_Type > > &accepted, Array< Path_State< GT, Cost_Type > > &candidates, bool &beyond)
bool build_suffix_state(const GT &g, const Suffix_Index< GT, Cost_Type > &index, typename GT::Node *start, typename GT::Node *target, Path_State< GT, Cost_Type > &out_suffix)
bool cost_of_arcs_if_fits(const DynList< typename GT::Arc * > &arcs, Distance distance, typename Distance::Distance_Type &total)
Suffix_Index< GT, typename Distance::Distance_Type > build_suffix_index_with_itor(const GT &g, typename GT::Node *target, Distance distance, SA sa)
Path_State< GT, Cost_Type > path_to_state(const Path< GT > &path, const Cost_Type total_cost)
Suffix_Index< GT, typename Distance::Distance_Type > build_suffix_index_digraph(const GT &g, typename GT::Node *target, Distance distance, SA sa)
void validate_non_negative_weights(const GT &g, Distance distance, SA sa)
Path_Snapshot< GT, Cost_Type > make_path_snapshot(const Path_State< GT, Cost_Type > &path)
void for_each_left_out(typename GT::Node *start, SA sa, Op op)
Calls op on each node that start reaches through the arcs that sa shows, but that a painting from sta...
bool same_prefix_nodes(const Path_Snapshot< GT, Cost_Type > &a, const Path_Snapshot< GT, Cost_Type > &b, const size_t spur_index)
GT::Arc * get_tree_arc(const Suffix_Index< GT, Cost_Type > &index, typename GT::Node *node)
bool add_if_fits(const T &a, const T &b, T &out)
Adds two distance values when the sum fits.
T checked_add(const T &a, const T &b)
Safely add two distance values with overflow checking.
Main namespace for Aleph-w library functions.
Container2< typename Container1::Item_Type > filter(Container1 &container, Operation &operation)
Filter elements that satisfy operation.
and
Check uniqueness with explicit hash + equality functors.
bool diff(const C1 &c1, const C2 &c2, Eq e=Eq())
Check if two containers differ.
std::pair< First, Second > pair
Alias to std::pair kept for backwards compatibility.
void next()
Advance all underlying iterators (bounds-checked).
Common utilities and base class for shortest path algorithms.
Filtered iterator on all the arcs of a graph.
Default filter for filtered iterators on arcs.
A shortest-path item returned by k-shortest algorithms.
Cost_Type total_cost
Total path cost.
Path< GT > path
Path from source to target.
Filtered iterator of adjacent arcs of a node.
const DynSetTree< Arc * > * forbidden_arcs
bool operator()(Arc *arc) const
const DynSetTree< Node * > * forbidden_nodes
Array< typename GT::Arc * > arcs
Array< typename GT::Node * > nodes
DynList< typename GT::Arc * > arcs
DynList< typename GT::Node * > nodes
static thread_local const Distance * base_ptr
typename Distance::Distance_Type Distance_Type
static thread_local const DynMapTree< Arc *, Arc * > * map_ptr
Context for reverse-graph Dijkstra in build_suffix_index_digraph().
Distance_Type operator()(Arc *rev_arc) const
DynSetTree< Node * > beyond_max
DynMapTree< Node *, Arc * > tree_arc
DynMapTree< Node *, Node * > tree_next
DynMapTree< Node *, Cost_Type > dist_to_target
The std::overflow_error of a painting that leaves out a node whose distance does not fit.
Aleph::Array< Display_Node > nodes
Root at index zero.
Dynamic array container with automatic resizing.
Dynamic queue implementation based on linked lists.
Dynamic key-value map based on balanced binary search trees.
Dynamic set implementations based on balanced binary search trees.