algae_graph/search/mod.rs
1/*
2 Appellation: search <module>
3 Contrib: FL03 <jo3mccain@icloud.com>
4 Description: ... Summary ...
5*/
6pub use self::{bfs::BreadthFirstSearch, dfs::DepthFirstSearch};
7
8mod bfs;
9mod dfs;
10
11use crate::{Contain, Graph, Node, Weight};
12
13/// [Searcher] is a trait that defines the behavior of a graph search algorithm.
14pub trait Searcher<N, V>: Contain<N>
15where
16 N: Node,
17 V: Weight,
18{
19 /// Search the graph for nodes.
20 fn search(&mut self, graph: impl Graph<N, V>, start: N) -> Vec<N>;
21 /// Reset the search state.
22 fn reset(&mut self);
23}