Package org.apache.lucene.util.hnsw

# Class UpdateGraphsUtils

java.lang.Object
org.apache.lucene.util.hnsw.UpdateGraphsUtils

public class UpdateGraphsUtils extends Object
Utility class for updating a big graph with smaller graphs. This is used during merging of segments containing HNSW graphs.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UpdateGraphsUtils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static IntHashSet`
  `computeJoinSet(HnswGraph graph)`
  Find nodes in the graph that best cover the graph.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### UpdateGraphsUtils

    public UpdateGraphsUtils()

- ## Method Details

  - ### computeJoinSet

    public static IntHashSet computeJoinSet(HnswGraph graph) throws IOException
    Find nodes in the graph that best cover the graph. This is reminiscent of an edge cover problem. Here rather than choosing edges we pick nodes and increment a count at their neighbours.
    Returns:
      a set of nodes that best cover the graph
    Throws:
      `IOException`