1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::graph::{Graph, Node};
use crate::path::PathFinding;
use crate::probing;
use crate::probing::{bi_directional_probe, probe};

pub struct BreadthFirstSearch {}

pub struct BiBreadthFirstSearch {}

impl PathFinding for BreadthFirstSearch {
    fn execute(&self, source: Node, target: Node, graph: &Graph) -> Graph {
        return probe(source.clone(), target.id, graph, probing::dequeue);
    }
}

impl PathFinding for BiBreadthFirstSearch {
    fn execute(&self, source: Node, target: Node, graph: &Graph) -> Graph {
        return bi_directional_probe(source, target, graph);
    }
}