|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Johnson's algorithm for all-pairs shortest paths. More...
#include <Johnson.H>
Classes | |
| struct | Kept_Source |
| struct | Shown_Arc |
Public Types | |
| using | Node = typename GT::Node |
| using | Arc = typename GT::Arc |
| using | Distance_Type = typename Distance::Distance_Type |
Public Member Functions | |
| Johnson (const GT &g, Distance d=Distance(), SA __sa=SA()) | |
| Construct a Johnson's all-pairs shortest paths executor. | |
| Johnson ()=default | |
| Default constructor (uninitialized state) | |
| Johnson (const Johnson &)=delete | |
| Johnson is not copyable: a copy would point to the nodes of the copy of the graph that this one keeps. | |
| Johnson & | operator= (const Johnson &)=delete |
| Johnson is not copyable: a copy would point to the nodes of the copy of the graph that this one keeps. | |
| Johnson (Johnson &&)=default | |
| Move constructor: the tree that is kept moves too. | |
| Johnson & | operator= (Johnson &&)=default |
| Move assignment: the tree that is kept moves too. | |
| bool | is_initialized () const noexcept |
| Check if the algorithm has been initialized. | |
| Distance_Type | get_distance (Node *src, Node *tgt) |
| Get the shortest distance from source to target. | |
| Path< GT > | find_path (Node *src, Node *tgt) |
| Find the shortest path from source to target. | |
| DynMapTree< std::pair< Node *, Node * >, Distance_Type > | compute_all_pairs_distances () |
| Compute the shortest distance for all pairs. | |
| Distance_Type | get_potential (Node *node) const |
| Get the node potential (h value) for a node. | |
| GT & | get_reweighted_graph () noexcept |
| Get access to the internal reweighted graph. | |
| const GT & | get_reweighted_graph () const noexcept |
| Get const access to the internal reweighted graph. | |
| Node * | get_copy_node (Node *orig) const |
| Get the copy of a node in the reweighted graph. | |
Private Types | |
| enum | Mode : unsigned char { No_Graph = 0 , Narrow_Potentials , Wide_Potentials } |
| enum | : unsigned char { Unreached = 0 , Labeled , Settled , Too_Far , Settled_Wide } |
| using | Weight = typename std::conditional_t< Integer, std::make_unsigned< std::remove_cv_t< Distance_Type > >, std::type_identity< Distance_Type > >::type |
| using | Wide = johnson_detail::Wide |
| using | Potential_Graph = List_Digraph< Graph_Node< size_t >, Graph_Arc< Distance_Type > > |
Private Member Functions | |
| template<bool W> | |
| auto & | weights_of () noexcept |
| template<bool W> | |
| auto & | reach_of () noexcept |
| template<bool W> | |
| auto & | heap_of () noexcept |
| size_t | number_of (Node *p) const |
| Distance_Type | distance_to (size_t s, size_t t) const |
| Distance_Type | distance_apart (size_t s, size_t t) const |
| template<bool W> | |
| void | spread_too_far () |
| template<bool W> | |
| void | paint (size_t s) |
| void | paint_wide (size_t s) |
| void | paint_from (size_t s) |
| void | narrow_potentials (Potential_Graph &pg, const std::vector< typename Potential_Graph::Node * > &pnodes) |
| void | wide_potentials (const std::vector< Shown_Arc > &shown) |
| void | wide_arcs (const std::vector< Shown_Arc > &shown) |
Static Private Member Functions | |
| static Weight | reweight (const Distance_Type &w, const Distance_Type &hu, const Distance_Type &hv) |
| static bool | add (const Weight &a, const Weight &b, Weight &sum) |
| static bool | add (const Wide &a, const Wide &b, Wide &sum) |
| static void | write_info (Arc *copy, const Weight &w) |
| static void | write_info (Arc *copy, const Wide &w) |
| static constexpr Distance_Type | unreachable () noexcept |
| static Distance_Type | unweighted (const Weight &d_prime, const Distance_Type &hs, const Distance_Type &ht) |
| static Distance_Type | wide_unweighted (const Wide &d_prime, const Wide &hs, const Wide &ht) |
Private Attributes | |
| const GT * | orig_graph = nullptr |
| GT | reweighted |
| Copy of the graph. | |
| DynMapTree< Node *, size_t > | number |
| Of each node of the graph, from 0. | |
| std::vector< Node * > | nodes |
| The node of each number. | |
| std::vector< Node * > | copies |
| Its copy in the reweighted graph. | |
| std::vector< Distance_Type > | h |
| Its potential, from Bellman-Ford. | |
| std::vector< size_t > | out_first |
| std::vector< size_t > | out_target |
| std::vector< Weight > | out_weight |
| std::vector< Arc * > | out_arc |
| Mode | mode = No_Graph |
| std::vector< unsigned char > | state |
| std::vector< Weight > | reach |
| std::vector< size_t > | parent |
| std::vector< size_t > | via |
| std::vector< std::pair< Weight, size_t > > | heap |
| std::vector< Wide > | wide_h |
| std::vector< Wide > | wide_weight |
| std::vector< Wide > | wide_reach |
| std::vector< std::pair< Wide, size_t > > | wide_heap |
| struct Aleph::Johnson::Kept_Source | kept |
Static Private Attributes | |
| static constexpr bool | Integer |
| static constexpr bool | Signed_Integer |
| static constexpr size_t | None = std::numeric_limits<size_t>::max() |
Johnson's algorithm for all-pairs shortest paths.
This class implements Johnson's algorithm for computing shortest paths between all pairs of vertices in a weighted directed graph. It handles graphs with negative edge weights (but not negative cycles).
The algorithm is efficient for sparse graphs, with complexity O(V E log V), compared to Floyd-Warshall's O(V³).
The constructor reads the graph once. It copies it, which get_reweighted_graph() gives, and calls the filter on each of its arcs and the distance on each arc that the filter shows: always on the arcs of the graph, never on their copies. The graph is not changed: neither its nodes nor its arcs, nor their infos, control bits, counters or cookies. The queries are answered from a list of the arcs that the filter shows, with their new weights, on which a query runs Dijkstra from its source, unless that source is the one of the last query that ran it: the tree of the shortest paths from that one is kept.
| GT | Graph type (typically List_Digraph). |
| Distance | Arc weight accessor class. Must provide:
|
| Ait | Arc iterator template with which Bellman-Ford traverses the arcs that the filter shows, on a digraph of the solver. |
| NAit | Node arc iterator template with which Bellman-Ford takes, on that digraph, the arcs out of a node. |
| SA | Arc filter: the arcs that it hides do not count. |
Usage example:
| using Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Distance_Type = typename Distance::Distance_Type |
|
private |
|
private |
|
private |
|
private |
|
inlineexplicit |
Construct a Johnson's all-pairs shortest paths executor.
The constructor:
With an integer type, a potential below lowest() throws nothing: the potentials, the new weights and the sums of Dijkstra are kept in an integer of 128 bits, so that only the queries whose distances do not fit throw.
| [in] | g | The graph to operate on. It is not changed. |
| [in] | d | Arc-weight accessor (default constructed). |
| [in] | __sa | Arc filter (default constructed). |
| std::bad_alloc | if there is not enough memory. |
| std::domain_error | if a negative cycle is detected, or, with a floating type, a weight is -inf or NaN, as Bellman-Ford throws. |
| anything | that the filter or the distance throws. |
Definition at line 659 of file Johnson.H.
References Aleph::and, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::copies, Aleph::copy(), Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), GraphCommon< GT, Node, Arc >::get_num_nodes(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::h, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::heap, Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), GraphCommon< GT, Node, Arc >::is_digraph(), m, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Narrow_Potentials, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::narrow_potentials(), Aleph::next(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::nodes, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_arc, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_first, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_target, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_weight, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::parent, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reach, OhashCommon< HashTbl, Key >::resize(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reweight(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reweighted, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Signed_Integer, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Unreached, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::via, w, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_potentials(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::write_info().
|
default |
Default constructor (uninitialized state)
|
delete |
Johnson is not copyable: a copy would point to the nodes of the copy of the graph that this one keeps.
|
default |
Move constructor: the tree that is kept moves too.
|
inlinestaticprivate |
Definition at line 398 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Integer, and Aleph::sum().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint().
|
inlinestaticprivate |
Definition at line 409 of file Johnson.H.
References Aleph::sum().
|
inline |
Compute the shortest distance for all pairs.
| std::domain_error | if not initialized. |
| std::overflow_error | as get_distance(), if a distance does not fit in the type. |
Definition at line 958 of file Johnson.H.
References ah_domain_error_if, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::No_Graph, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::nodes, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_from().
Referenced by TEST(), TEST(), TEST(), TEST_F(), and TYPED_TEST().
|
inlineprivate |
Definition at line 506 of file Johnson.H.
References ah_overflow_error, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Settled_Wide, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Signed_Integer, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_h, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_reach, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_unweighted().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to().
|
inlineprivate |
Definition at line 493 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_apart(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::h, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reach, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Settled, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::unreachable(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Unreached, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::unweighted().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::compute_all_pairs_distances(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_distance().
|
inline |
Find the shortest path from source to target.
| [in] | src | Source node (from original graph). |
| [in] | tgt | Target node (from original graph). |
| std::domain_error | if not initialized or nodes not found. |
| std::overflow_error | if, with an integer type, the distance from src to tgt does not fit in it, as get_distance() throws. |
Definition at line 913 of file Johnson.H.
References ah_domain_error_if, Aleph::Path< GT >::append(), arcs, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to(), Aleph::Path< GT >::init(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::No_Graph, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number_of(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::orig_graph, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_arc, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_from(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::parent, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Unreached, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::via.
Referenced by TEST(), and TYPED_TEST().
|
inline |
Get the copy of a node in the reweighted graph.
| [in] | orig | Original node. |
| std::domain_error | if the node is not one of the graph. |
Definition at line 1032 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::copies, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number_of().
|
inline |
Get the shortest distance from source to target.
The tree of the shortest paths from the last source is kept, so that the queries from it do not run Dijkstra again.
| [in] | src | Source node (from original graph). |
| [in] | tgt | Target node (from original graph). |
std::numeric_limits<Distance_Type>::infinity(), or max() for a type without infinity, as an integer type. | std::domain_error | if not initialized or nodes not found. |
| std::overflow_error | if, with an integer type, the distance from src to tgt does not fit in it: it is above max(), or below lowest(), which only a graph with a potential below lowest() has. Only that one; the others are given. |
Definition at line 885 of file Johnson.H.
References ah_domain_error_if, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::No_Graph, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number_of(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_from().
Referenced by compare_with_floyd(), example_basic_all_pairs(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Get the node potential (h value) for a node.
The potential h(v) is the distance to v from a virtual source that reaches every node by an arc of weight 0: min(0, the least distance from a node to v), as Bellman_Ford::compute_nodes_weights() computes it.
| [in] | node | Node from the original graph. |
| std::domain_error | if not initialized or node not found. |
| std::overflow_error | if, with an integer type, the potential is below lowest(). |
Definition at line 992 of file Johnson.H.
References ah_domain_error_if, ah_overflow_error_if, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::h, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::No_Graph, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number_of(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Signed_Integer.
Referenced by example_basic_all_pairs(), TEST(), and TYPED_TEST().
|
inlinenoexcept |
Get const access to the internal reweighted graph.
Definition at line 1024 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reweighted.
|
inlinenoexcept |
Get access to the internal reweighted graph.
It is a copy of the graph, with all its nodes and all its arcs, even those that the filter hides, which keep their infos. Each arc that the filter shows has as its info its new weight w(u,v) + h(u) - h(v), converted to the type of the info: max() if, with an integer type, it is above max(); an integer info keeps only the integer part of a floating new weight, which the queries keep whole. If the type of the info cannot take a distance, the infos are those of the graph. The queries do not read it, nor paint it.
Useful for debugging or advanced operations.
Definition at line 1017 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reweighted.
|
inlineprivatenoexcept |
Definition at line 347 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::heap, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_heap.
|
inlinenoexcept |
Check if the algorithm has been initialized.
Definition at line 867 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::No_Graph.
Referenced by TEST_F(), TEST_F(), and TYPED_TEST().
|
inlineprivate |
Definition at line 770 of file Johnson.H.
References Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::compute_nodes_weights(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::h.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson().
|
inlineprivate |
Definition at line 377 of file Johnson.H.
References ah_domain_error_if, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number, and Aleph::DynMapTree< Key, Data, Tree, Compare >::search().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_copy_node(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_distance(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_potential().
|
delete |
Johnson is not copyable: a copy would point to the nodes of the copy of the graph that this one keeps.
|
default |
Move assignment: the tree that is kept moves too.
|
inlineprivate |
Definition at line 549 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::add(), Aleph::and, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::kept, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Labeled, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Kept_Source::node, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::None, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_first, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_target, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::parent, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Settled, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Settled_Wide, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Too_Far, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Unreached, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::via.
|
inlineprivate |
Definition at line 622 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::kept, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Kept_Source::node, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_wide(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Signed_Integer, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Wide_Potentials.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::compute_all_pairs_distances(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_distance().
|
inlineprivate |
Definition at line 618 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_from().
|
inlineprivatenoexcept |
Definition at line 338 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reach, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_reach.
|
inlinestaticprivate |
Definition at line 387 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Integer, and w.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson().
|
inlineprivate |
Definition at line 519 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_first, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_target, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Too_Far, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Unreached.
|
inlinestaticconstexprprivatenoexcept |
Definition at line 446 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to().
|
inlinestaticprivate |
Definition at line 459 of file Johnson.H.
References ah_overflow_error_if, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Integer.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to().
|
inlineprivatenoexcept |
Definition at line 329 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_weight, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_weight.
|
inlineprivate |
Definition at line 809 of file Johnson.H.
References Aleph::Johnson< GT, Distance, Ait, NAit, SA >::h, m, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::mode, Aleph::next(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::nodes, Aleph::johnson_detail::Wide::of(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_arc, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_first, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::out_target, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::parent, OhashCommon< HashTbl, Key >::resize(), Aleph::johnson_detail::Wide::signed_less(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::state, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Unreached, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::via, w, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_h, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_heap, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Wide_Potentials, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_reach, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_weight, and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::write_info().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson().
|
inlineprivate |
Definition at line 785 of file Johnson.H.
References ah_domain_error_if, Aleph::Johnson< GT, Distance, Ait, NAit, SA >::nodes, Aleph::johnson_detail::Wide::of(), Aleph::johnson_detail::Wide::signed_less(), Aleph::sum(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_h.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson().
|
inlinestaticprivate |
Definition at line 480 of file Johnson.H.
References ah_overflow_error_if, Aleph::johnson_detail::Wide::lo, Aleph::johnson_detail::Wide::of(), and Aleph::johnson_detail::Wide::signed_less().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_apart().
|
inlinestaticprivate |
Definition at line 417 of file Johnson.H.
References Aleph::copy(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Integer, max(), value, and w.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
inlinestaticprivate |
|
private |
Its copy in the reweighted graph.
Definition at line 268 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_copy_node().
|
private |
Its potential, from Bellman-Ford.
Definition at line 269 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_potential(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::narrow_potentials(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
private |
Definition at line 314 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::heap_of().
|
staticconstexprprivate |
Definition at line 225 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::add(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reweight(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::unweighted(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::write_info().
|
private |
|
private |
Definition at line 289 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::compute_all_pairs_distances(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_distance(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_potential(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::is_initialized(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_from(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
private |
The node of each number.
Definition at line 267 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::compute_all_pairs_distances(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_potentials().
|
staticconstexprprivate |
Definition at line 244 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint().
|
private |
Of each node of the graph, from 0.
Definition at line 266 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number_of().
|
private |
Definition at line 264 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path().
|
private |
Definition at line 278 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
private |
|
private |
|
private |
Definition at line 277 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::weights_of().
|
private |
|
private |
Definition at line 306 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reach_of().
|
private |
Copy of the graph.
Definition at line 265 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_reweighted_graph(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_reweighted_graph().
|
staticconstexprprivate |
Definition at line 239 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_apart(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::get_potential(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint_from().
|
private |
Definition at line 305 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_apart(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_to(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::spread_too_far(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
private |
|
private |
Definition at line 321 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_apart(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_potentials().
|
private |
Definition at line 324 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::heap_of(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
private |
Definition at line 323 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::distance_apart(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reach_of(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
private |
Definition at line 322 of file Johnson.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::weights_of(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().