You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// 1\. Provide an external state array to track the visited vertices.
44
+
///
45
+
/// 2\. Initialize the search queue with a root @ref hgl::algorithm::search_node "search node" representing the starting point.
46
+
///
47
+
/// 3\. The *visit predicate* ensures vertices are not processed multiple times.
48
+
///
49
+
/// 4\. The concrete vertex visiting logic - marks the vertex as visited and logs it to the console.
50
+
///
51
+
/// 5\. Traverse all hyperedges unconditionally.
52
+
///
53
+
/// 6\. The *enqueue predicate* filters out already visited adjacent vertices before they enter the queue.
54
+
///
55
+
/// ### Template Parameters
56
+
/// | Parameter | Description | Constraint |
57
+
/// | :-------- | :--- | :--- |
58
+
/// | Dir | The @ref hgl::algorithm::traversal_direction "traversal direction" (i.e., `forward` or `backward`). Relevant only for BF-directed hypergraphs. | Defaults to `forward`. |
59
+
/// | H | The type of the hypergraph being searched. | Must satisfy the [**c_hypergraph**](hgl_concepts.md#hgl-traits-c-hypergraph) concept. |
60
+
/// | InitQueueRangeType | A forward range of `search_node<H>` used to prime the BFS queue. | Must be a *forward range* of @ref hgl::algorithm::search_node "search nodes". |
61
+
/// | VisitPredicate | Type of the callable deciding if a popped node should be processed. | Must be one of:<br/>- A `(const search_node<H>&) -> bool` callable<br/>- An @ref hgl::algorithm::empty_callback "empty_callback" |
62
+
/// | VisitCallback | Type of the callable executed when a vertex is officially visited. | Must be one of:<br/>- A `(const search_node<H>&) -> bool` callable<br/>- An @ref hgl::algorithm::empty_callback "empty_callback" |
63
+
/// | TraverseHePredicate | Type of the callable deciding if an incident hyperedge should be traversed. | Must be one of:<br/>- An `(id_type, id_type) -> decision` callable<br/>- An @ref hgl::algorithm::empty_callback "empty_callback" |
64
+
/// | EnqueuePredicate | Type of the callable deciding if a target vertex should be enqueued via a specific hyperedge. | Must be one of:<br/>- A `(const search_node<H>&) -> decision` callable<br/>- An @ref hgl::algorithm::empty_callback "empty_callback" |
65
+
/// | PreVisitCallback | Type of the callable executed immediately before `VisitCallback`. | Must be one of:<br/>- A `(const search_node<H>&) -> void` callable<br/>- An @ref hgl::algorithm::empty_callback "empty_callback" |
66
+
/// | PostVisitCallback | Type of the callable executed after all adjacent elements are evaluated. | Must be one of:<br/>- A `(const search_node<H>&) -> void` callable<br/>- An @ref hgl::algorithm::empty_callback "empty_callback" |
67
+
///
68
+
/// @param hypergraph The hypergraph to traverse.
69
+
/// @param initial_queue_content The initial set of search nodes to begin the traversal from.
70
+
/// @param visit_pred Predicate to filter nodes immediately after popping them from the queue.
71
+
/// @param visit Primary callback for node processing.
72
+
/// @param traverse_he_pred Predicate to determine if an incident hyperedge should be traversed. Returns a @ref hgl::algorithm::decision "decision":
73
+
/// - `accept` to traverse the hyperedge,
74
+
/// - `reject` to skip the hyperedge,
75
+
/// - `abort` to terminate the BFS entirely.
76
+
/// @param enqueue_pred Predicate to determine if an adjacent vertex should be queued via a hyperedge. Returns a @ref hgl::algorithm::decision "decision":
77
+
/// - `accept` to enqueue the vertex's search node,
78
+
/// - `reject` to skip the node,
79
+
/// - `abort` to terminate the BFS entirely.
80
+
/// @param pre_visit Callback executed prior to the primary visit logic.
81
+
/// @param post_visit Callback executed after all adjacent elements of the current node have been processed.
82
+
/// @return `true` if the search completed normally, `false` if it was explicitly aborted via a callback.
83
+
/// @hideparams
14
84
template <
15
85
traversal_direction Dir = traversal_direction::forward,
0 commit comments