Trait traitgraph::interface::NavigableGraph
source · pub trait NavigableGraph: ImmutableGraphContainer + Sized {
type OutNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where Self: 'a;
type InNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where Self: 'a;
type EdgesBetween<'a>: Iterator<Item = Self::EdgeIndex>
where Self: 'a;
Show 13 methods
// Required methods
fn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>;
fn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>;
fn edges_between(
&self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex
) -> Self::EdgesBetween<'_>;
// Provided methods
fn contains_edge_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex
) -> bool { ... }
fn edge_count_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex
) -> usize { ... }
fn out_degree(&self, node_id: Self::NodeIndex) -> usize { ... }
fn in_degree(&self, node_id: Self::NodeIndex) -> usize { ... }
fn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool { ... }
fn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool { ... }
fn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool { ... }
fn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool { ... }
fn is_split_node(&self, node_id: Self::NodeIndex) -> bool { ... }
fn is_join_node(&self, node_id: Self::NodeIndex) -> bool { ... }
}
Expand description
A graph that can be navigated, i.e. that can iterate the neighbors of its nodes.
Required Associated Types§
sourcetype OutNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where
Self: 'a
type OutNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>> where Self: 'a
The iterator type used to iterate over the outgoing neighbors of a node.
sourcetype InNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where
Self: 'a
type InNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>> where Self: 'a
The iterator type used to iterate over the incoming neighbors of a node.
sourcetype EdgesBetween<'a>: Iterator<Item = Self::EdgeIndex>
where
Self: 'a
type EdgesBetween<'a>: Iterator<Item = Self::EdgeIndex> where Self: 'a
The iterator type used to iterate over the edges between two nodes.
Required Methods§
sourcefn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>
fn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>
Returns an iterator over the outgoing neighbors of the given node.
sourcefn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>
fn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>
Returns an iterator over the incoming neighbors of the given node.
sourcefn edges_between(
&self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex
) -> Self::EdgesBetween<'_>
fn edges_between( &self, from_node_id: Self::NodeIndex, to_node_id: Self::NodeIndex ) -> Self::EdgesBetween<'_>
Returns an iterator over the edges (from_node_id, to_node_id)
.
Provided Methods§
sourcefn contains_edge_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex
) -> bool
fn contains_edge_between( &self, from: Self::NodeIndex, to: Self::NodeIndex ) -> bool
Returns true if the graph contains an edge (from, to)
.
sourcefn edge_count_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex
) -> usize
fn edge_count_between( &self, from: Self::NodeIndex, to: Self::NodeIndex ) -> usize
Returns the amount of edges (from, to)
.
sourcefn out_degree(&self, node_id: Self::NodeIndex) -> usize
fn out_degree(&self, node_id: Self::NodeIndex) -> usize
Returns the amount of outgoing edges from a node.
sourcefn in_degree(&self, node_id: Self::NodeIndex) -> usize
fn in_degree(&self, node_id: Self::NodeIndex) -> usize
Returns the amount of incoming edges to a node.
sourcefn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool
fn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree == 1 and outdegree == 1.
sourcefn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool
fn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree > 1 and outdegree > 1.
sourcefn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool
fn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool
Returns true if the given edge’s tail has outdegree > 1.
sourcefn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool
fn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool
Returns true if the given edge’s head has indegree > 1.
sourcefn is_split_node(&self, node_id: Self::NodeIndex) -> bool
fn is_split_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has outdegree > 1.
sourcefn is_join_node(&self, node_id: Self::NodeIndex) -> bool
fn is_join_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree > 1.