[][src]Trait gamma::graph::Graph

pub trait Graph {
    fn is_empty(&self) -> bool;
fn order(&self) -> usize;
fn size(&self) -> usize;
fn ids(&self) -> Box<dyn Iterator<Item = usize>>;
fn neighbors(
        &self,
        id: usize
    ) -> Result<Box<dyn Iterator<Item = usize>>, Error>;
fn has_id(&self, id: usize) -> bool;
fn degree(&self, id: usize) -> Result<usize, Error>;
fn edges(&self) -> Box<dyn Iterator<Item = (usize, usize)>>;
fn has_edge(&self, sid: usize, tid: usize) -> Result<bool, Error>; }

An unweighted graph.

Required methods

fn is_empty(&self) -> bool[src]

Returns true if there are no nodes, or false otherwise.

fn order(&self) -> usize[src]

Returns the number of nodes in this graph.

fn size(&self) -> usize[src]

Returns the number of edges in this graph.

fn ids(&self) -> Box<dyn Iterator<Item = usize>>[src]

Returns an Iterator over node identifiers.

fn neighbors(&self, id: usize) -> Result<Box<dyn Iterator<Item = usize>>, Error>[src]

Returns an iterator over node identifiers for the neighbors at id, or Error if not found.

fn has_id(&self, id: usize) -> bool[src]

Returns true if id is a member, or false otherwise.

fn degree(&self, id: usize) -> Result<usize, Error>[src]

Returns the count of neighbors at id, or Error if id not found.

fn edges(&self) -> Box<dyn Iterator<Item = (usize, usize)>>[src]

Returns an iterator over the edges of this graph.

fn has_edge(&self, sid: usize, tid: usize) -> Result<bool, Error>[src]

Returns true if the edge (sid, tid) exists, or false otherwise. Returns Error if either sid or tid are not found.

Loading content...

Implementors

impl Graph for DefaultGraph[src]

Loading content...