|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Performs a depth-first search for a path between a pair of nodes. More...
#include <tpl_find_path.H>
Classes | |
| struct | Frame |
Public Member Functions | |
| Find_Path_Depth_First (SA &&__sa=SA()) | |
| Find_Path_Depth_First (SA &__sa) | |
| bool | operator() (const GT &g, typename GT::Node *start, typename GT::Node *end, Path< GT > &path) |
| Invokes the depth-first path search. | |
| Path< GT > | operator() (const GT &g, typename GT::Node *start, typename GT::Node *end) |
| Invokes the depth-first path search. | |
| template<class Op > | |
| Path< GT > | operator() (const GT &g, typename GT::Node *start, Op &op) |
| Invokes the depth-first path search. | |
| template<class Op = Dft_Goal_Node<GT>> | |
| Path< GT > | operator() (const GT &g, typename GT::Node *start, Op &&op) |
Private Member Functions | |
| template<class Op > | |
| GT::Node * | next_target (Frame &f, Op &op, bool &found) |
| template<class Op > | |
| bool | find_path (Dfs_Stack< Frame > &frames, typename GT::Node *curr, typename GT::Arc *arc, Path< GT > &path, Op &op) |
| template<class Op > | |
| bool | find (const GT &g, typename GT::Node *start, Path< GT > &path, Op &op) |
| template<class Op > | |
| bool | find (const GT &g, typename GT::Node *start, Path< GT > &path, Op &&op) |
Static Private Member Functions | |
| static void | remove_last_node (Path< GT > &path) |
Private Attributes | |
| Kept_Filter< SA > | sa |
| GT * | g_ptr = nullptr |
Performs a depth-first search for a path between a pair of nodes.
Find_Path_Depth_First searches depth-first for a path between start_node and end_node, building a path equivalent to the depth of the search as it goes. If a path is found, the method returns true and the path parameter holds the path in question; otherwise, the function returns false and the path is empty.
The class takes two type parameters:
Definition at line 97 of file tpl_find_path.H.
|
inline |
Definition at line 259 of file tpl_find_path.H.
|
inline |
Definition at line 264 of file tpl_find_path.H.
|
inlineprivate |
Definition at line 253 of file tpl_find_path.H.
References Aleph::Find_Path_Depth_First< GT, Itor, SA >::find().
|
inlineprivate |
Definition at line 219 of file tpl_find_path.H.
References ARC_BITS, Aleph::Path< GT >::empty(), Aleph::Find_Path, Aleph::Find_Path_Depth_First< GT, Itor, SA >::find_path(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::g_ptr, GraphCommon< GT, Node, Arc >::get_connected_node(), IS_NODE_VISITED, NODE_BITS, GraphCommon< GT, Node, Arc >::reset_bit_arcs(), GraphCommon< GT, Node, Arc >::reset_bit_nodes(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::sa, and Aleph::Path< GT >::set_graph().
Referenced by Aleph::Find_Path_Depth_First< GT, Itor, SA >::find(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::operator()(), and Aleph::Find_Path_Depth_First< GT, Itor, SA >::operator()().
|
inlineprivate |
Definition at line 156 of file tpl_find_path.H.
References Aleph::Path< GT >::append(), Aleph::Dfs_Stack< T >::clear(), Aleph::dfs_curr(), Aleph::dfs_frame(), Aleph::dfs_replace(), Aleph::Find_Path, Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, Aleph::Find_Path_Depth_First< GT, Itor, SA >::Frame::it, Aleph::next(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::Frame::next_arc(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::next_target(), NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::remove_last_node(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::sa, and Aleph::Dfs_Stack< T >::top().
Referenced by Aleph::Find_Path_Depth_First< GT, Itor, SA >::find().
|
inlineprivate |
Definition at line 127 of file tpl_find_path.H.
References ARC_BITS, Aleph::Find_Path_Depth_First< GT, Itor, SA >::Frame::curr, Aleph::dfs_curr(), Aleph::Find_Path, Aleph::Find_Path_Depth_First< GT, Itor, SA >::g_ptr, GraphCommon< GT, Node, Arc >::get_connected_node(), IS_ARC_VISITED, IS_NODE_VISITED, Aleph::Find_Path_Depth_First< GT, Itor, SA >::Frame::it, and Aleph::Find_Path_Depth_First< GT, Itor, SA >::Frame::next_arc().
Referenced by Aleph::Find_Path_Depth_First< GT, Itor, SA >::find_path().
|
inline |
Definition at line 326 of file tpl_find_path.H.
|
inline |
Invokes the depth-first path search.
| [in] | g | the graph on which the path is to be searched. |
| [in] | start | pointer to the path's starting node. |
| [in] | op | functor that implements the search criterion. The functor receives the node as a parameter and must return true if the node satisfies the criterion, false otherwise. |
| bad_alloc | if there is not enough memory to keep building the path |
Definition at line 318 of file tpl_find_path.H.
|
inline |
Invokes the depth-first path search.
| [in] | g | the graph on which the path is to be searched. |
| [in] | start | pointer to the path's starting node. |
| [in] | end | pointer to the path's destination node. |
end if this one was found; false otherwise | bad_alloc | if there is not enough memory to keep building the path |
Definition at line 296 of file tpl_find_path.H.
References Aleph::Find_Path_Depth_First< GT, Itor, SA >::find().
|
inline |
Invokes the depth-first path search.
| [in] | g | the graph on which the path is to be searched. |
| [in] | start | pointer to the path's starting node. |
| [in] | end | pointer to the path's destination node. |
| [out] | path | the path seen during the depth-first search; empty if the return value is false. |
| bad_alloc | if there is not enough memory to keep building the path |
Definition at line 280 of file tpl_find_path.H.
References Aleph::Find_Path_Depth_First< GT, Itor, SA >::find().
|
inlinestaticprivate |
Definition at line 119 of file tpl_find_path.H.
References Aleph::Path< GT >::remove_last_node().
Referenced by Aleph::Find_Path_Depth_First< GT, Itor, SA >::find_path().
|
private |
Definition at line 100 of file tpl_find_path.H.
Referenced by Aleph::Find_Path_Depth_First< GT, Itor, SA >::find(), and Aleph::Find_Path_Depth_First< GT, Itor, SA >::next_target().
|
private |
Definition at line 99 of file tpl_find_path.H.
Referenced by Aleph::Find_Path_Depth_First< GT, Itor, SA >::find(), and Aleph::Find_Path_Depth_First< GT, Itor, SA >::find_path().