Trait cairo_lang_utils::graph_algos::graph_node::GraphNode
source · pub trait GraphNode: Sized + Clone {
type NodeId: PartialEq + Eq + Hash + Clone;
// Required methods
fn get_neighbors(&self) -> Vec<Self> ⓘ;
fn get_id(&self) -> Self::NodeId;
}
Expand description
A trait for a node in a graph. Note that a GraphNode has to be able to provide its neighbors by itself, without additional information.
Required Associated Types§
Required Methods§
sourcefn get_neighbors(&self) -> Vec<Self> ⓘ
fn get_neighbors(&self) -> Vec<Self> ⓘ
Returns a list of the node’s neighbors. Must be stable for the SCC result to be stable. i.e. if the output for a node here doesn’t change between different runs, the computed SCC of the node is guaranteed to also not change.