Trait Graph

Source
pub trait Graph {
    // Required methods
    fn len(&self) -> usize;
    fn neighbors(&self, key: u32) -> Arc<Vec<u32>>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Graph trait.

§Type parameters

K: Vertex Index type T: the data type of vector, i.e., f32 or f16.

Required Methods§

Source

fn len(&self) -> usize

Get the number of nodes in the graph.

Source

fn neighbors(&self, key: u32) -> Arc<Vec<u32>>

Get the neighbors of a graph node, identifyied by the index.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true if the graph is empty.

Implementors§