Trait petgraph::visit::GetAdjacencyMatrix[][src]

pub trait GetAdjacencyMatrix: GraphBase {
    type AdjMatrix;
    fn adjacency_matrix(&self) -> Self::AdjMatrix;
fn is_adjacent(
        &self,
        matrix: &Self::AdjMatrix,
        a: Self::NodeId,
        b: Self::NodeId
    ) -> bool; }
[]

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[src][]

The associated adjacency matrix type

Required methods

fn adjacency_matrix(&self) -> Self::AdjMatrix[src][]

Create the adjacency matrix

fn is_adjacent(
    &self,
    matrix: &Self::AdjMatrix,
    a: Self::NodeId,
    b: Self::NodeId
) -> bool
[src][]

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]

type AdjMatrix = G::AdjMatrix

Implementors

impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G> where
    G: GetAdjacencyMatrix
[src]

type AdjMatrix = G::AdjMatrix

impl<N, E, Ty> GetAdjacencyMatrix for GraphMap<N, E, Ty> where
    N: Copy + Ord + Hash,
    Ty: EdgeType
[src]

The GraphMap keeps an adjacency matrix internally.

impl<N, E, Ty, Ix> GetAdjacencyMatrix for Graph<N, E, Ty, Ix> where
    Ty: EdgeType,
    Ix: IndexType
[src]

The adjacency matrix for Graph is a bitmap that’s computed by .adjacency_matrix().

type AdjMatrix = FixedBitSet

impl<N, E, Ty, Ix> GetAdjacencyMatrix for StableGraph<N, E, Ty, Ix> where
    Ty: EdgeType,
    Ix: IndexType
[src]

The adjacency matrix for Graph is a bitmap that’s computed by .adjacency_matrix().

type AdjMatrix = FixedBitSet

impl<N, E, Ty: EdgeType, Null: Nullable<Wrapped = E>, Ix: IndexType> GetAdjacencyMatrix for MatrixGraph<N, E, Ty, Null, Ix>[src]

type AdjMatrix = ()