pub trait GraphNode: Sized + Clone {
    type NodeId: PartialEq + Eq + Hash + Clone;

    fn get_neighbors(&self) -> Vec<Self> ;
    fn get_id(&self) -> Self::NodeId;
}
Expand description

A trait for a node in the graph. Note a GraphNode has to be able to provide its neighbors by itself, without additional information.

Required Associated Types§

The type used to identify the nodes in the graph.

Required Methods§

Returns a list of the node’s neighbors

Gets the node’s ID.

Implementors§