Struct rs_graph::linkedlistgraph::LinkedListGraph
[−]
[src]
pub struct LinkedListGraph<ID = u32> { /* fields omitted */ }
The linked list based graph data structure.
Methods
impl<ID> LinkedListGraph<ID> where
ID: PrimInt + Unsigned,
[src]
ID: PrimInt + Unsigned,
fn new() -> LinkedListGraph<ID>
[src]
Trait Implementations
impl<'a, ID> Graph<'a> for LinkedListGraph<ID> where
ID: 'a + PrimInt + Unsigned,
[src]
ID: 'a + PrimInt + Unsigned,
type Node = Node<ID>
Type of a node.
type Edge = Edge<ID>
Type of an edge.
type NodeIter = NodeIter<ID>
Type of an iterator over all nodes.
type EdgeIter = EdgeIter<ID>
Type of an iterator over all edges.
type NeighIter = NeighIter<'a, ID>
Type of an iterator over incident edges.
fn num_nodes(&self) -> usize
[src]
Return the number of nodes.
fn num_edges(&self) -> usize
[src]
Return the number of edges.
fn enodes(&self, e: Self::Edge) -> (Self::Node, Self::Node)
[src]
Return the nodes connected by an edge. Read more
fn nodes(&'a self) -> Self::NodeIter
[src]
Return an iterator over all nodes.
fn edges(&self) -> Self::EdgeIter
[src]
Return an iterator over all edges. Read more
fn neighs(&'a self, u: Self::Node) -> Self::NeighIter
[src]
Return an iterator over the edges adjacent to some node. Read more
impl<'a, ID> Digraph<'a> for LinkedListGraph<ID> where
ID: 'a + PrimInt + Unsigned,
[src]
ID: 'a + PrimInt + Unsigned,
type OutEdgeIter = OutEdgeIter<'a, ID>
Type of an iterator over the forward edges leaving a node.
type InEdgeIter = InEdgeIter<'a, ID>
Type of an iterator over the backward edges entering a node.
fn src(&self, e: Self::Edge) -> Self::Node
[src]
Return the source node of an edge.
fn snk(&self, e: Self::Edge) -> Self::Node
[src]
Return the sink node of an edge.
fn outedges(&'a self, u: Self::Node) -> Self::OutEdgeIter
[src]
Return an iterator over the outgoing edges of a node. Read more
fn inedges(&'a self, u: Self::Node) -> Self::InEdgeIter
[src]
Return an iterator over the incoming edges of a node. Read more
impl<'a, ID> Network<'a> for LinkedListGraph<ID> where
ID: 'a + PrimInt + Unsigned,
[src]
ID: 'a + PrimInt + Unsigned,
fn is_reverse(&self, e: Self::Edge, f: Self::Edge) -> bool
[src]
Return true if e is the reverse edge of f.
fn reverse(&self, e: Self::Edge) -> Self::Edge
[src]
Return the reverse edge of e.
fn is_forward(&self, e: Self::Edge) -> bool
[src]
Return true if e is a forward edge.
fn forward(&'a self, e: Self::Edge) -> Self::Edge
[src]
Return the forward edge of e. Read more
fn is_backward(&self, e: Self::Edge) -> bool
[src]
Return true if e is a backward edge.
fn backward(&'a self, e: Self::Edge) -> Self::Edge
[src]
Return the backward edge of e. Read more
fn bisrc(&'a self, e: Self::Edge) -> Self::Node
[src]
Return the source of the directed edge e. Read more
fn bisnk(&'a self, e: Self::Edge) -> Self::Node
[src]
Return the sink of the directed edge e. Read more
impl<'a, ID> IndexGraph<'a> for LinkedListGraph<ID> where
ID: 'a + PrimInt + Unsigned,
[src]
ID: 'a + PrimInt + Unsigned,
fn node_id(&self, u: Self::Node) -> usize
[src]
Return a unique id associated with a node.
fn id2node(&self, id: usize) -> Self::Node
[src]
Return the node associated with the given id. Read more
fn edge_id(&self, e: Self::Edge) -> usize
[src]
Return a unique id associated with an edge. Read more
fn id2edge(&self, id: usize) -> Self::Edge
[src]
Return the edge associated with the given id. Read more
impl<'a, ID> IndexNetwork<'a> for LinkedListGraph<ID> where
ID: 'a + PrimInt + Unsigned,
[src]
ID: 'a + PrimInt + Unsigned,
fn id2biedge(&self, id: usize) -> Self::Edge
[src]
Return the edge associated with the given id. Read more
fn biedge_id(&self, a: Self::Edge) -> usize
[src]
Return a unique id associated with a directed edge. Read more
impl<ID> Builder for LinkedListGraph<ID> where
ID: PrimInt + Unsigned,
[src]
ID: PrimInt + Unsigned,
type Graph = Self
The graph type produced by this builder.
type Node = Node<ID>
The type of a nodes.
type Edge = Edge<ID>
The type of an edge.
fn with_capacities(nnodes: usize, nedges: usize) -> Self
[src]
Create a new, empty builder. Read more
fn reserve(&mut self, nnodes: usize, nedges: usize)
[src]
Reserve memory for a certain number of nodes and edges.
fn add_node(&mut self) -> Self::Node
[src]
Add a new node.
fn add_edge(&mut self, u: Self::Node, v: Self::Node) -> Self::Edge
[src]
Add a new edge.
fn node2id(&self, u: Self::Node) -> usize
[src]
Return a unique id of a node.
fn edge2id(&self, e: Self::Edge) -> usize
[src]
Return a unique id of an edge.
fn to_graph(self) -> Self
[src]
Turn the builder into a graph.
fn new() -> Self
[src]
Create a new, empty builder.
fn add_nodes(&mut self, n: usize) -> Vec<Self::Node>
[src]
Add n
new nodes.
impl<ID> Buildable for LinkedListGraph<ID> where
ID: PrimInt + Unsigned,
[src]
ID: PrimInt + Unsigned,
type Builder = Self
impl<ID> Default for LinkedListGraph<ID> where
ID: PrimInt + Unsigned,
[src]
ID: PrimInt + Unsigned,