[][src]Trait generic_graph::DirectedGraph

pub trait DirectedGraph<T, E, K, V, W, C> where
    K: Hash + Eq + Clone,
    C: Hash + Eq + Clone,
    W: Add + Sub + Eq + Ord + Copy,
    T: Vertex<K, V>,
    E: Edge<K, W, C>, 
{ fn adjacent(&self, from: &K, to: &K) -> bool;
fn neighbors(&self, from: &K) -> Vec<&K>;
fn leading_to(&self, to: &K) -> Vec<&K>;
fn get_vertex(&self, key: &K) -> Option<&T>;
fn get_mutable_vertex(&mut self, key: &K) -> Option<&mut T>;
fn get_edge(&self, pair: (&K, &K)) -> Option<&E>;
fn get_mutable_edge(&mut self, pair: (&K, &K)) -> Option<&mut E>; }

This trait define the behaviour of a directed graph it requires the for vertexes (T), edges (E), vertex's keys (K), vertex's values (v), edge's weights (W) and edge's keys (C)

Required methods

fn adjacent(&self, from: &K, to: &K) -> bool

This method returns a boolean stating if exist an edge from the first vertex to the other

fn neighbors(&self, from: &K) -> Vec<&K>

This method returns a vector containing the keys of all the vertexes reached by edges starting from the argument

fn leading_to(&self, to: &K) -> Vec<&K>

This method returns a vector containing the keys of all the vertexes with by edges leading to the argument

fn get_vertex(&self, key: &K) -> Option<&T>

fn get_mutable_vertex(&mut self, key: &K) -> Option<&mut T>

fn get_edge(&self, pair: (&K, &K)) -> Option<&E>

fn get_mutable_edge(&mut self, pair: (&K, &K)) -> Option<&mut E>

Loading content...

Implementors

impl<K: Hash + Eq + Clone, V, W: Add + Sub + Eq + Ord + Copy> DirectedGraph<SimpleVertex<K, V>, DirectedEdge<K, W>, K, V, W, CompoundKey<K>> for AdjacencyGraph<K, V, W>[src]

Loading content...