Skip to content

Conversation

@4adex
Copy link
Collaborator

@4adex 4adex commented Oct 14, 2025

No description provided.

@4adex 4adex changed the title Implement basic tree Implement KD Tree indexer Oct 14, 2025
@4adex 4adex marked this pull request as ready for review December 18, 2025 11:08
@4adex 4adex requested review from Arshdeep54 and h4shk4t December 18, 2025 11:09
self.check_and_rebalance(&path);
}

// Rebuild helper methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Shift the helper methods to different file

pub left: Option<Box<KDTreeNode>>,
pub right: Option<Box<KDTreeNode>>,
pub is_deleted: bool,

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add axis field in the node itself?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fair enough

#[derive(Debug, Clone, PartialEq)]
pub struct Neighbor {
pub id: PointId,
pub distance: f32,
Copy link
Contributor

Choose a reason for hiding this comment

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

Refer
I added this type for usage in binaryheap, see if it is of any use here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, used same type in Neighbor definition

pub const DELETE_REBUILD_RATIO: f32 = 0.25;

/// Checks if a node is unbalanced based on the balance threshold
pub fn is_unbalanced(node: &KDTreeNode) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can have these helpers as impl for KDTreeNode{}.

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.

3 participants