Graph

Trait Graph 

Source
pub trait Graph<T: PartialOrd + Debug, E: Edge<T>> {
    // Required methods
    fn vertices(&self) -> &HashSet<Vertice<T>>;
    fn edges(&self) -> &HashSet<E>;
    fn add_vertice(&mut self, vertice: Vertice<T>);
}
Expand description

The trait of a graph

Defines the functions every graph must have.

The generic parameters are: T: The type for the vertices IDs (must be orderable) E: The type for the edges, can be SymmetricEdge or AsymmetricEdge

Required Methods§

Source

fn vertices(&self) -> &HashSet<Vertice<T>>

Source

fn edges(&self) -> &HashSet<E>

Source

fn add_vertice(&mut self, vertice: Vertice<T>)

Implementors§

Source§

impl<T> Graph<T, SymmetricEdge<T>> for SimpleGraph<T>
where T: Eq + PartialOrd + Hash + Debug,