Skip to main content

traverse_from_memories_with_hops_capped

Function traverse_from_memories_with_hops_capped 

Source
pub fn traverse_from_memories_with_hops_capped(
    conn: &Connection,
    seed_memory_ids: &[i64],
    namespace: &str,
    min_weight: f64,
    max_hops: u32,
    max_neighbors_per_hop: Option<usize>,
) -> Result<Vec<(i64, u32)>, AppError>
Expand description

Extended variant that accepts an optional neighbour cap per hop.

Pass max_neighbors_per_hop = Some(k) to prune each entity’s expansion to its top-k neighbours by edge weight, limiting combinatorial blow-up in dense graphs. None is equivalent to the public traverse_from_memories_with_hops function.

§Errors

Propagates AppError::Database (exit 10) on SQLite query failures.