Skip to main content

Graph

Trait Graph 

Source
pub trait Graph<NI>
where NI: Idx,
{ // Required methods fn node_count(&self) -> NI; fn edge_count(&self) -> NI; }
Expand description

A graph is a tuple (N, E), where N is a set of nodes and E a set of edges. Each edge connects exactly two nodes.

Graph is parameterized over the node index type Node which is used to uniquely identify a node. An edge is a tuple of node identifiers.

Required Methods§

Source

fn node_count(&self) -> NI

Returns the number of nodes in the graph.

Source

fn edge_count(&self) -> NI

Returns the number of edges in the graph.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<NI, NV, EV> Graph<NI> for DirectedALGraph<NI, NV, EV>
where NI: Idx, NV: Send + Sync, EV: Send + Sync,

Source§

impl<NI, NV, EV> Graph<NI> for DirectedCsrGraph<NI, NV, EV>
where NI: Idx,

Source§

impl<NI, NV, EV> Graph<NI> for UndirectedALGraph<NI, NV, EV>
where NI: Idx, NV: Send + Sync, EV: Send + Sync,

Source§

impl<NI, NV, EV> Graph<NI> for UndirectedCsrGraph<NI, NV, EV>
where NI: Idx,