msokolov commented on code in PR #13566: URL: https://github.com/apache/lucene/pull/13566#discussion_r1676091586
########## lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java: ########## @@ -408,7 +410,23 @@ private void finish() throws IOException { } private void connectComponents() throws IOException { - List<Component> components = HnswUtil.components(hnsw); + long start = System.nanoTime(); + for (int level = 0; level < hnsw.numLevels(); level++) { + if (connectComponents(level) == false) { Review Comment: A degenerate case is `M=1` in this case every component will have 2 nodes connected to each other and we cannot connect them further, but this will arise for M>1 too. We can try to use pruning again, but then we run the risk of orphaning a new component and would have to iterate and as far as I can tell there is no guarantee we would converge even for higher M. I think in order to guarantee connectedness we have to relax the number of connections limit, but we assume elsewhere (not only in NeighborArray) that this limit is obeyed (eg when searching) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org