[][src]Trait graphrepresentations::graph::MutableGraph

pub trait MutableGraph<N, E> {
    fn new() -> Self;
fn add_node(&mut self, node: Node<N>) -> NodeId;
fn add_edge(
        &mut self,
        edge: Edge<E>
    ) -> Result<EdgeId, GraphModificationError>; }

A mutable graph.

Graphs implementing this trait are able to be updated efficiently.

Required methods

fn new() -> Self

Creates a new empty graph.

fn add_node(&mut self, node: Node<N>) -> NodeId

Adds the given node to the graph. The return value is the id assigned to the new node.

fn add_edge(&mut self, edge: Edge<E>) -> Result<EdgeId, GraphModificationError>

Adds the given edge to the graph. The return value is the id assigned to the new edge, or an error, if the edge refers a non-existing node.

Loading content...

Implementors

impl<N, E> MutableGraph<N, E> for SimpleGraph<N, E>[src]

Loading content...