#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::hash::Hash;
pub trait GraphNode: Sized + Clone {
type NodeId: Eq + Hash + Clone;
fn get_neighbors(&self) -> Vec<Self>;
fn get_id(&self) -> Self::NodeId;
fn get_neighbors_in_given_scc(&self, scc: Vec<Self::NodeId>) -> Vec<Self> {
let mut neighbors_in_scc = Vec::new();
for neighbor in self.get_neighbors() {
if scc.contains(&neighbor.get_id()) {
neighbors_in_scc.push(neighbor);
}
}
neighbors_in_scc
}
}