Skip to content

Conversation

@marianotepper
Copy link
Collaborator

Adds a method to the interface ImmutableGraphIndex that returns true if the index is hierarchical and false otherwise.

Note that a graph can be hierarchical even if it has a single layer, i.e., getMaxLevel() == 0. For example, while building a new hierarchical graph, we may temporarily only have nodes at level 0 because of the random assignment of nodes to levels.

This change enables to make public the GraphIndexBuilder constructor that takes an existing graph as an input, as we can infer the addHierarchy member from the provided graph.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Before you submit for review:

  • Does your PR follow guidelines from CONTRIBUTIONS.md?
  • Did you summarize what this PR does clearly and concisely?
  • Did you include performance data for changes which may be performance impacting?
  • Did you include useful docs for any user-facing changes or features?
  • Did you include useful javadocs for developer oriented changes, explaining new concepts or key changes?
  • Did you trigger and review regression testing results against the base branch via Run Bench Main?
  • Did you adhere to the code formatting guidelines (TBD)
  • Did you group your changes for easy review, providing meaningful descriptions for each commit?
  • Did you ensure that all files contain the correct copyright header?

If you did not complete any of these, then please explain below.

@marianotepper marianotepper marked this pull request as ready for review November 7, 2025 20:25
@marianotepper
Copy link
Collaborator Author

The alpha provided in the new public constructor is not really used by the builder. Something similar happens with neighborhoodOverflow. This may need a bit more refactoring to be sorted out properly. I'll label the constructor as Experimental for now until we have a proper solution.

Copy link
Contributor

@MarkWolters MarkWolters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Conflicts:
#	jvector-tests/src/test/java/io/github/jbellis/jvector/graph/OnHeapGraphIndexTest.java
Copy link
Contributor

@jshook jshook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jshook jshook merged commit d5cbe65 into main Nov 10, 2025
19 of 20 checks passed
@jshook jshook deleted the add-is-hierarchical-method branch November 10, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants