lance_index::vector::graphTrait 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
.
Get the number of nodes in the graph.
Get the neighbors of a graph node, identifyied by the index.
Returns true if the graph is empty.