|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
#include <tpl_graph.H>
Classes | |
| class | Iterator |
| Iterator on nodes and arcs of a path. More... | |
| struct | Path_Desc |
Public Types | |
| using | Node_Type = typename GT::Node_Type |
| The type of data stored in the nodes. | |
| using | Arc_Type = typename GT::Arc_Type |
| The type of data stored in the arc. | |
Public Member Functions | |
| bool | check () const |
Return true if the path is consistent: each arc joins its node with the next one, either way, and the last node has no arc. | |
| bool | check_directed () const |
Return true if the directed path is consistent: each arc goes from its node to the next one, and the last node has no arc. | |
| const GT & | get_graph () const noexcept |
| Get a constant reference to the graph. | |
| bool | inside_graph (const GT &gr) const noexcept |
Return true if this is on graph gr | |
| Path (const GT &__g) noexcept | |
Construct a empty path on graph __g | |
| Path () noexcept | |
| void | init (Node *start_node) |
| Set the first node of a path. | |
| Path (const GT &_g, Node *start_node) | |
| Construct a path starting from a given node. | |
| void | set_graph (const GT &__g, Node *start_node=nullptr) |
| Set the graph of the path. | |
| size_t | size () const noexcept |
| Return the path length in nodes. | |
| bool | is_empty () const noexcept |
Return true if the path is empty. | |
| void | empty () |
| Clean the path: all the nodes and arc are removed. | |
| void | clear () |
| Empties the container. | |
| Path (const Path &path) | |
| Copy constructor. | |
| Path (Path &&path) noexcept | |
| Move constructor. | |
| Path & | operator= (const Path &path) |
| Copy assignment. | |
| Path & | operator= (Path &&path) noexcept |
| Move assignment. | |
| void | append (Arc *arc) |
| Append an arc to the path. | |
| void | append (Node *node) |
| Append a node to the path. | |
| void | append_directed (Node *p) |
| Append a node to a directed path. | |
| void | append_directed (Arc *arc) |
| Append an arc to a directed path. | |
| void | insert (Arc *arc) |
| Insert an arc as the first of a path. | |
| void | insert (Node *node) |
| Insert a node to the path. | |
| void | insert_directed (Node *p) |
| Insert a node at the beginning of a directed path. | |
| void | insert_directed (Arc *arc) |
| Append an arc to a directed path. | |
| Node * | get_first_node () const |
Return the first node of path; throws overflow_error if path is empty. | |
| Node * | get_last_node () const |
Return the last node of path; throws overflow_error if path is empty. | |
| Arc * | get_first_arc () const |
Return the first arc of path; throws overflow_error if path is empty. | |
| Arc * | get_last_arc () const |
Return the last arc of a path; throws overflow_error if the path is empty. | |
| bool | is_cycle () const |
Return true if this is a cycle; throws if path is empty. | |
| Node * | remove_last_node () |
| Remove the last node of path. | |
| Node * | remove_first_node () |
| Remove the first node of a path. | |
| void | swap (Path &path) noexcept |
| Fast swap between two paths (constant time) | |
| Iterator | get_it () const |
| Returns an iterator on the path. | |
| template<class Operation > | |
| void | for_each_node (Operation op=Operation()) const |
| Execute an operation on each node of path. | |
| template<class Operation > | |
| void | for_each_arc (Operation op=Operation()) const |
| Execute an operation on each arc of path. | |
| bool | contains_node (Node *node) const noexcept |
Return true if node belongs to the path. | |
| bool | contains_arc (Arc *arc) const noexcept |
Return true if arc belongs to the path. | |
| DynList< Node * > | nodes () const |
| Return a list with the nodes of path (order according to the path) | |
| DynList< Arc * > | arcs () const |
| Return a list with the arcs of a path (order, according to the path) | |
| bool | operator== (const Path &p) const noexcept |
Return true if this is equal to p,. | |
| bool | operator!= (const Path &p) const noexcept |
Return true if this is not equal to p,. | |
Private Types | |
| using | Node = typename GT::Node |
| using | Arc = typename GT::Arc |
Private Member Functions | |
| void | check_graph () |
Private Attributes | |
| const GT * | g = nullptr |
| DynDlist< Path_Desc > | list |
Path on a graph.
Many problems on graphs require dynamic building of partial or complete paths. This class models a path on a graph and it is designed for dynamically and sequentially building the path during graph's traversal.
The paths are built by their ends; that is by inserting or appending. A path is a deque.
Path<GT> operates on both directed and non-directed graphs. However, it is necessary to take some previsions.
If the graph is directed (ListDigraph,List_SGraph or Array_Graph), then the class operates transparently and equivalently than on non-directed graphs.
If for practice circumstances you are treating a non-directed graph as a directed one, for example, because you need to know the incoming arcs, you must advertise to Path class about this fact.
The way that we are designed consists in separating the path construction through specific methods; concretely, the methods insert_directed() and append_directed(). You could observe very extraneous behaviors if you forget this separation.
Definition at line 3831 of file tpl_graph.H.
|
private |
Definition at line 3844 of file tpl_graph.H.
| using Aleph::Path< GT >::Arc_Type = typename GT::Arc_Type |
The type of data stored in the arc.
Definition at line 3838 of file tpl_graph.H.
|
private |
Definition at line 3843 of file tpl_graph.H.
| using Aleph::Path< GT >::Node_Type = typename GT::Node_Type |
The type of data stored in the nodes.
Definition at line 3835 of file tpl_graph.H.
|
inlinenoexcept |
Construct a empty path on graph __g
Definition at line 3933 of file tpl_graph.H.
|
inlinenoexcept |
Definition at line 3936 of file tpl_graph.H.
Construct a path starting from a given node.
| [in] | _g | the graph |
| [in] | start_node | pointer to start node of a path |
| bad_alloc | if there is no enough memory |
Definition at line 3959 of file tpl_graph.H.
References Aleph::init.
Copy constructor.
Definition at line 4014 of file tpl_graph.H.
Move constructor.
Definition at line 4017 of file tpl_graph.H.
|
inline |
Append an arc to the path.
This method searches the last node of path and appends it an arc.
The arc must be connected to the last node.
| [in] | arc | pointer to arc |
| bad_alloc | if there is no enough memory |
| invalid_argument | if arc is not linked to the last node of path |
| domain_error | if the graph has not been specified |
| domain_error | if the path is empty |
Definition at line 4052 of file tpl_graph.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::and, Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::g, GraphCommon< GT, Node, Arc >::get_connected_node(), last_node, and Aleph::Path< GT >::list.
Referenced by Aleph::__find_path_depth_first(), Aleph::Path< GT >::append(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::append_lightest_arc(), Aleph::mat_path_detail::append_node(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::build_path(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::find_path(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::get_min_path(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_min_path(), Aleph::get_min_path(), Aleph::IDA_Star< GT, Distance, Heuristic, Itor, SA >::search(), Aleph::k_shortest_paths_detail::state_to_path(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Append a node to the path.
This method appends node at the end of path. For this, the adjacent arcs of the last node are examined until finding an arc linking node.
If the path is empty, the node becomes its first node.
If the operation is successful, then node becomes the last node of the path.
| [in] | node | pointer to the node to append in the path |
| bad_alloc | if there is no enough memory |
| invalid_argument | if node is not reachable from the last node of the path |
| domain_error | if the graph has not been specified |
Definition at line 4085 of file tpl_graph.H.
References ah_invalid_argument_if, Aleph::Path< GT >::append(), Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::g, Aleph::Path< GT >::get_last_node(), Aleph::init, last_node, Aleph::Path< GT >::list, and Aleph::search_arc().
|
inline |
Append an arc to a directed path.
This method appends arc at the end of a directed path. For this, the source node of arc must match the current last node of a directed path.
If the operation is successful, then node becomes the last node of the path.
| [in] | arc | pointer |
| bad_alloc | if there is no enough memory |
| invalid_argument | if node is not reachable from the last node of the path |
| domain_error | if the graph has not been specified |
Definition at line 4164 of file tpl_graph.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::Path< GT >::check_graph(), last_node, and Aleph::Path< GT >::list.
|
inline |
Append a node to a directed path.
This method inserts node at the end of a directed path. For this, the outcoming arcs of the last node of path are examined until finding an arc linking node.
If the path is empty, the node becomes its first node.
If the operation is successful, then node becomes the last node of the path.
| [in] | p | node pointer to the node to append in the path |
| bad_alloc | if there is no enough memory |
| invalid_argument | if node is not reachable from the last node of the path |
| domain_error | if the graph has not been specified |
Definition at line 4124 of file tpl_graph.H.
References ah_invalid_argument_if, Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::g, Aleph::init, last_node, Aleph::Path< GT >::list, and Aleph::search_directed_arc().
Referenced by Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::append_lightest_arc(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::cycle_of_predecessors(), Aleph::k_shortest_paths_detail::state_to_path(), TEST_F(), TEST_F(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Return a list with the arcs of a path (order, according to the path)
Definition at line 4576 of file tpl_graph.H.
References Aleph::DynList< T >::append(), and Aleph::Path< GT >::for_each_arc().
Referenced by TEST_F(), and TYPED_TEST().
|
inline |
Return true if the path is consistent: each arc joins its node with the next one, either way, and the last node has no arc.
Definition at line 3880 of file tpl_graph.H.
References Aleph::and, Aleph::Path< GT >::Path_Desc::arc, Aleph::Path< GT >::g, GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Path< GT >::list, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and Aleph::Path< GT >::Path_Desc::node.
Referenced by TYPED_TEST().
|
inline |
Return true if the directed path is consistent: each arc goes from its node to the next one, and the last node has no arc.
Definition at line 3904 of file tpl_graph.H.
References Aleph::and, Aleph::Path< GT >::Path_Desc::arc, Aleph::Path< GT >::g, GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Path< GT >::list, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and Aleph::Path< GT >::Path_Desc::node.
Referenced by diamond_backward(), and TYPED_TEST().
|
inlineprivate |
Definition at line 3872 of file tpl_graph.H.
References ah_domain_error_if, and Aleph::Path< GT >::g.
Referenced by Aleph::Path< GT >::append(), Aleph::Path< GT >::append(), Aleph::Path< GT >::append_directed(), Aleph::Path< GT >::append_directed(), Aleph::Path< GT >::empty(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert_directed(), and Aleph::Path< GT >::insert_directed().
|
inline |
Empties the container.
| none |
Definition at line 4011 of file tpl_graph.H.
References Aleph::Path< GT >::empty().
|
inlinenoexcept |
Return true if arc belongs to the path.
Definition at line 4556 of file tpl_graph.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
Referenced by TEST_F().
|
inlinenoexcept |
Return true if node belongs to the path.
Definition at line 4547 of file tpl_graph.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
Referenced by TEST_F().
|
inline |
Clean the path: all the nodes and arc are removed.
Definition at line 3999 of file tpl_graph.H.
References Aleph::Path< GT >::check_graph(), and Aleph::Path< GT >::list.
Referenced by Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::build_path(), Aleph::Path< GT >::clear(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::compute_cycle(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::find(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::find_min_path(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::find_min_path(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::find_min_path(), Aleph::Dijkstra_Min_Paths< GT, Distance, Itor, SA, HeapT >::find_min_path(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::find_path(), Aleph::IDA_Star< GT, Distance, Heuristic, Itor, SA >::find_path(), Aleph::Find_Path_Breadth_First< GT, Itor, SA >::find_path(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::find_path(), Aleph::find_path_depth_first(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::get_min_path(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_min_path(), Aleph::get_min_path(), Aleph::Path< GT >::operator=(), and Aleph::Path< GT >::set_graph().
|
inline |
Execute an operation on each arc of path.
| [in] | op | operation |
Definition at line 4540 of file tpl_graph.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
Referenced by Aleph::Path< GT >::arcs(), Aleph::cancel_cycle(), Weighted_Graph::cost_of(), example_negative_cycle(), print_path(), print_path_detailed(), and TEST().
|
inline |
Execute an operation on each node of path.
| [in] | op | operation |
Definition at line 4529 of file tpl_graph.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
Referenced by example_negative_cycle(), main(), Aleph::Path< GT >::nodes(), print_path(), and print_path_detailed().
|
inline |
Return the first arc of path; throws overflow_error if path is empty.
Definition at line 4332 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by TEST_F().
|
inline |
Return the first node of path; throws overflow_error if path is empty.
Definition at line 4316 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by Weighted_Graph::cost_of(), demo_cycle_detection(), diamond_backward(), Aleph::Directed_Find_Path< GT, Itor, SA >::find(), Aleph::Find_Path_Breadth_First< GT, Itor, SA >::find_path(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert_directed(), Aleph::Path< GT >::is_cycle(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and Moved_From_Case< Floyd_All_Shortest_Paths< Dgraph > >::use().
|
inlinenoexcept |
Get a constant reference to the graph.
Definition at line 3921 of file tpl_graph.H.
References Aleph::Path< GT >::g.
Referenced by Aleph::get_min_path().
|
inline |
Returns an iterator on the path.
Definition at line 4519 of file tpl_graph.H.
Referenced by demo_any_path(), demo_cycle_detection(), and demo_degrees_of_separation().
|
inline |
Return the last arc of a path; throws overflow_error if the path is empty.
Definition at line 4339 of file tpl_graph.H.
References ah_domain_error_if, Aleph::Const_Iterator< It >::get_curr(), Aleph::Path< GT >::list, Aleph::Const_Iterator< It >::prev(), and Aleph::Const_Iterator< It >::reset_last().
Referenced by TEST_F().
|
inline |
Return the last node of path; throws overflow_error if path is empty.
Definition at line 4323 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by Aleph::Path< GT >::append(), Aleph::mat_path_detail::append_node(), Weighted_Graph::cost_of(), diamond_backward(), Aleph::Path< GT >::is_cycle(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TYPED_TEST().
|
inline |
Set the first node of a path.
| start_node | pointer to start node of a path |
| bad_alloc | if there is no enough memory |
start_node (of course) must belong to the graph. This is not verified Definition at line 3947 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by Aleph::Directed_Find_Path< GT, Itor, SA >::find(), Aleph::Find_Path_Breadth_First< GT, Itor, SA >::find_path(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::find_path(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::get_min_path(), and Aleph::get_min_path().
|
inline |
Insert an arc as the first of a path.
This method inserts arc at the beginning of a path. For this, the adjacent arcs of the current first node of the path are examined until find an arc linking node.
If the operation is successful, then node becomes the first node of the path.
| [in] | arc | pointer |
| bad_alloc | if there is no enough memory |
| invalid_argument | if node is not reachable from the first node of the path |
| domain_error | if the graph has not been specified |
Definition at line 4195 of file tpl_graph.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::and, Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::g, GraphCommon< GT, Node, Arc >::get_connected_node(), and Aleph::Path< GT >::list.
Referenced by Aleph::Find_Path_Breadth_First< GT, Itor, SA >::find_path(), Aleph::find_path_breadth_first(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Insert a node to the path.
This method inserts node at the beginning of the path, through the arc that search_arc() finds between node and the first node of the path.
If the path is empty, the node becomes its first node.
If the operation is successful, then node becomes the first node of the path.
| [in] | node | pointer to the node to insert in the path |
| bad_alloc | if there is no enough memory |
| invalid_argument | if no arc links node with the first node of the path; the path is then as it was |
| domain_error | if the graph has not been specified |
Definition at line 4228 of file tpl_graph.H.
References ah_invalid_argument_if, Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::g, Aleph::Path< GT >::get_first_node(), Aleph::init, Aleph::Path< GT >::list, and Aleph::search_arc().
|
inline |
Append an arc to a directed path.
This method appends arc at the beginning of a directed path. For this, the target node of arc must be the current first node of a directed path.
| [in] | arc | pointer |
| bad_alloc | if there is no enough memory |
| invalid_argument | if node is not reachable from the last node of the path |
| domain_error | if the graph has not been specified |
Definition at line 4299 of file tpl_graph.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::Path< GT >::check_graph(), and Aleph::Path< GT >::list.
|
inline |
Insert a node at the beginning of a directed path.
This method inserts p at the beginning of a directed path. For this, the outcoming arcs of p are examined until finding an arc p --> first, where first is the first node of the path.
If the path is empty, p becomes its first node.
If the operation is successful, then p becomes the first node of the path.
| [in] | p | node pointer to the node to insert in the path |
| bad_alloc | if there is no enough memory |
| invalid_argument | if there is no arc from p to the first node of the path; the path is then as it was |
| domain_error | if the graph has not been specified |
Definition at line 4266 of file tpl_graph.H.
References ah_invalid_argument_if, Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::g, Aleph::Path< GT >::get_first_node(), Aleph::init, Aleph::Path< GT >::list, and Aleph::search_directed_arc().
Referenced by Aleph::Directed_Find_Path< GT, Itor, SA >::find(), TEST_F(), TEST_F(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Return true if this is on graph gr
Definition at line 3927 of file tpl_graph.H.
References Aleph::Path< GT >::g.
Referenced by Aleph::Find_Path_Breadth_First< GT, Itor, SA >::find_path(), and TEST().
|
inline |
Return true if this is a cycle; throws if path is empty.
Definition at line 4351 of file tpl_graph.H.
References Aleph::Path< GT >::get_first_node(), and Aleph::Path< GT >::get_last_node().
Referenced by Aleph::cancel_cycle(), TEST(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Return true if the path is empty.
Definition at line 3993 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by Aleph::cancel_cycle(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::faster_find_negative_cycle(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::negative_cycle_witness(), path_edge_count(), Aleph::k_shortest_paths_detail::shortest_path_filtered(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::test_negative_cycle(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::test_negative_cycle(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Return a list with the nodes of path (order according to the path)
Definition at line 4565 of file tpl_graph.H.
References Aleph::DynList< T >::append(), and Aleph::Path< GT >::for_each_node().
Referenced by TEST_F().
|
inlinenoexcept |
Return true if this is not equal to p,.
Definition at line 4602 of file tpl_graph.H.
References Aleph::eq().
Copy assignment.
Definition at line 4020 of file tpl_graph.H.
References Aleph::Path< GT >::empty(), Aleph::Path< GT >::g, and Aleph::Path< GT >::list.
Move assignment.
Definition at line 4032 of file tpl_graph.H.
References Aleph::Path< GT >::g, and Aleph::Path< GT >::list.
|
inlinenoexcept |
Return true if this is equal to p,.
== must be defined for the data types stored in the nodes and arcs respectively.| [in] | p | path to compare with this |
true if node to node and arc to arc the paths are equal; false otherwise. Definition at line 4596 of file tpl_graph.H.
References Aleph::eq().
|
inline |
Remove the first node of a path.
| overflow_error | if the path is empty |
Definition at line 4376 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by TEST_F(), and TYPED_TEST().
|
inline |
Remove the last node of path.
The path may be left empty.
| underflow_error | if path is empty |
Definition at line 4363 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by Aleph::__find_path_depth_first(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::remove_last_node(), Aleph::IDA_Star< GT, Distance, Heuristic, Itor, SA >::search(), TEST_F(), TEST_F(), and TYPED_TEST().
|
inline |
Set the graph of the path.
Sometimes, by example, if you manage a path attribute inside a class, you do not use the graph, but you need to declare the path. This method is intended to set the graph of a path.
Eventually, if a path is already built, then this one is erased before to set the graph.
| [in] | __g | the graph |
| [in] | start_node | pointer to start node of path |
| bad_alloc | if there is no enough memory |
Definition at line 3977 of file tpl_graph.H.
References Aleph::Path< GT >::empty(), Aleph::Path< GT >::g, and Aleph::init.
Referenced by Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::build_path(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::compute_cycle(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::compute_cycle(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::find(), Aleph::find_min_path(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::find_path(), Aleph::IDA_Star< GT, Distance, Heuristic, Itor, SA >::find_path(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_min_path(), and Aleph::k_shortest_paths_detail::state_to_path().
|
inlinenoexcept |
Return the path length in nodes.
Definition at line 3987 of file tpl_graph.H.
References Aleph::Path< GT >::list.
Referenced by demo_any_path(), demo_cycle_detection(), demo_degrees_of_separation(), diamond_backward(), main(), print_path(), print_path_detailed(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and Moved_From_Case< Floyd_All_Shortest_Paths< Dgraph > >::use().
|
inlinenoexcept |
Fast swap between two paths (constant time)
Definition at line 4383 of file tpl_graph.H.
References Aleph::Path< GT >::g, and Aleph::Path< GT >::list.
Referenced by TYPED_TEST().
|
private |
Definition at line 3841 of file tpl_graph.H.
Referenced by Aleph::Path< GT >::append(), Aleph::Path< GT >::append(), Aleph::Path< GT >::append_directed(), Aleph::Path< GT >::check(), Aleph::Path< GT >::check_directed(), Aleph::Path< GT >::check_graph(), Aleph::Path< GT >::get_graph(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert_directed(), Aleph::Path< GT >::inside_graph(), Aleph::Path< GT >::operator=(), Aleph::Path< GT >::operator=(), Aleph::Path< GT >::set_graph(), and Aleph::Path< GT >::swap().
|
private |
Definition at line 3870 of file tpl_graph.H.
Referenced by Aleph::Path< GT >::append(), Aleph::Path< GT >::append(), Aleph::Path< GT >::append_directed(), Aleph::Path< GT >::append_directed(), Aleph::Path< GT >::check(), Aleph::Path< GT >::check_directed(), Aleph::Path< GT >::empty(), Aleph::Path< GT >::get_first_arc(), Aleph::Path< GT >::get_first_node(), Aleph::Path< GT >::get_last_arc(), Aleph::Path< GT >::get_last_node(), Aleph::Path< GT >::init(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert_directed(), Aleph::Path< GT >::insert_directed(), Aleph::Path< GT >::is_empty(), Aleph::Path< GT >::operator=(), Aleph::Path< GT >::operator=(), Aleph::Path< GT >::remove_first_node(), Aleph::Path< GT >::remove_last_node(), Aleph::Path< GT >::size(), and Aleph::Path< GT >::swap().