Skip to main content

traverse_from_memories_with_hops

Function traverse_from_memories_with_hops 

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

BFS graph traversal that also returns the hop distance for each reached memory.

Identical to traverse_from_memories but returns (memory_id, hop_count) tuples instead of bare IDs. hop_count is the BFS depth at which the entity was first discovered, starting from 1 for direct neighbours of the seed entities.

ยงErrors

Propaga AppError::Database (exit 10) em falhas de consulta SQLite.