From 163dceca4b05ad1c83e56a238e95ad2dc0627a79 Mon Sep 17 00:00:00 2001 From: osmarks Date: Thu, 16 Jan 2025 21:36:15 +0000 Subject: [PATCH] enforce r, oops --- diskann/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diskann/src/lib.rs b/diskann/src/lib.rs index 0a564a2..447fb99 100644 --- a/diskann/src/lib.rs +++ b/diskann/src/lib.rs @@ -360,7 +360,7 @@ pub fn robust_stitch(rng: &mut Rng, graph: &mut IndexGraph, vecs: &VectorList, c let mut in_neighbour_out_edges = graph.out_neighbours_mut(in_neighbour); let mut added = 0; for (neigh, _score) in candidates { - if added >= config.max_add_per_stitch_iter { + if added >= config.max_add_per_stitch_iter || in_neighbour_out_edges.len() >= config.r { break; } if in_neighbour_out_edges.contains(&neigh) {