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; }
Expand description

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.

Required Associated Types

The associated adjacency matrix type

Required Methods

Create the adjacency matrix

Return true if there is an edge from a to b, false otherwise.

Computes in O(1) time.

Implementations on Foreign Types

Implementors

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

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

The GraphMap keeps an adjacency matrix internally.

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

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