Skip to content

Commit 750fc6c

Browse files
committed
extended dfs tmpl to accept traversal direction
1 parent 5c12c4a commit 750fc6c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • include/hgl/algorithm/templates

include/hgl/algorithm/templates/dfs.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace hgl::algorithm {
1212

1313
template <
14+
traversal_direction Dir = traversal_direction::forward,
1415
hgl::traits::c_hypergraph H,
1516
traits::c_forward_range_of<search_node<H>> InitQueueRangeType = std::vector<search_node<H>>,
1617
traits::c_optional_predicate<const search_node<H>&> VisitVertexPredicate = empty_callback,
@@ -30,7 +31,7 @@ bool dfs(
3031
const PreVisitCallback& pre_visit = {},
3132
const PostVisitCallback& post_visit = {}
3233
) {
33-
using policy = traversal_policy<H>;
34+
using policy = traversal_policy<H, Dir>;
3435

3536
if (std::ranges::empty(initial_queue_content))
3637
return false;

0 commit comments

Comments
 (0)