[−][src]Trait petgraph::visit::GetAdjacencyMatrix
Create or access the adjacency matrix of a graph.
The implementor can either create an adjacency matrix, or it can return a placeholder if it has the needed representation internally.
Associated Types
type AdjMatrix
The associated adjacency matrix type
Required methods
fn adjacency_matrix(&self) -> Self::AdjMatrix
Create the adjacency matrix
fn is_adjacent(
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
Return true if there is an edge from a
to b
, false otherwise.
Computes in O(1) time.
Implementations on Foreign Types
impl<'a, G> GetAdjacencyMatrix for &'a G where
G: GetAdjacencyMatrix,
[src]
G: GetAdjacencyMatrix,
type AdjMatrix = G::AdjMatrix
fn adjacency_matrix(&self) -> Self::AdjMatrix
[src]
fn is_adjacent(
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
[src]
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
Implementors
impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G> where
G: GetAdjacencyMatrix,
[src]
G: GetAdjacencyMatrix,
type AdjMatrix = G::AdjMatrix
fn adjacency_matrix(&self) -> Self::AdjMatrix
[src]
fn is_adjacent(
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
[src]
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
impl<N, E, Ty> GetAdjacencyMatrix for GraphMap<N, E, Ty> where
N: Copy + Ord + Hash,
Ty: EdgeType,
[src]
N: Copy + Ord + Hash,
Ty: EdgeType,
The GraphMap
keeps an adjacency matrix internally.
type AdjMatrix = ()
fn adjacency_matrix(&self)
[src]
fn is_adjacent(&self, _: &(), a: N, b: N) -> bool
[src]
impl<N, E, Ty, Ix> GetAdjacencyMatrix for Graph<N, E, Ty, Ix> where
Ty: EdgeType,
Ix: IndexType,
[src]
Ty: EdgeType,
Ix: IndexType,
The adjacency matrix for Graph is a bitmap that's computed by
.adjacency_matrix()
.
type AdjMatrix = FixedBitSet
fn adjacency_matrix(&self) -> FixedBitSet
[src]
fn is_adjacent(
&self,
matrix: &FixedBitSet,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>
) -> bool
[src]
&self,
matrix: &FixedBitSet,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>
) -> bool
impl<N, E, Ty, Ix> GetAdjacencyMatrix for StableGraph<N, E, Ty, Ix> where
Ty: EdgeType,
Ix: IndexType,
[src]
Ty: EdgeType,
Ix: IndexType,
The adjacency matrix for Graph is a bitmap that's computed by
.adjacency_matrix()
.
type AdjMatrix = FixedBitSet
fn adjacency_matrix(&self) -> FixedBitSet
[src]
fn is_adjacent(
&self,
matrix: &FixedBitSet,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>
) -> bool
[src]
&self,
matrix: &FixedBitSet,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>
) -> bool