8000 GitHub - aknlite48/KD_tree · GitHub
[go: up one dir, main page]

Skip to content
aknlite48Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

Repository files navigation

KD_tree

Load Instructions

Load with ./main filename.csv (file must be in csv format)

Shell Instructions

Tree Viewing

to print the whole tree (not recommended for large trees) run:
show tree
to print the root value run:
show root to print tree size run:
show size

K Nearest Neighbours

Given a point p in format (x,y,z) (for 3d points) to find k nearest neighbors run:
nn k (x,y,z)
for 3 nearest neighbors of (5,1,2) run:
nn 3 (5,1,2)
input point dimensions must match with point dimensions of tree

Range Search and Delete

To search points that lie between (x1,y1,z1) and (x2,y2,z2) run:
search range (x1,y1,z1) (x2,y2,z2)

To delete points that lie between (x1,y1,z1) and (x2,y2,z2) run:
delete range (x1,y1,z1) (x2,y2,z2)

A point (x,y,z) lies between (x1,y1,z1) and (x2,y2,z2) if x1<x<x2, y1<y<y2, and z1<z<z2

using _ in place of a number relaxes the constraint
running:
range (x1,,z1) (x2,,z2)

this shows points (x,y,z) such that x1<x<x2 and z1<z<z2 with no constraint on the y coordinate

running:
range range (x1,_,z1) (x2,y2,z2)

this shows points (x,y,z) such that x1<x<x2, z1<z<z2 and y<y2

data_gen.py

input commands

python data_gen.py n dim range filename

n = number of datapoints
dim = datapoint dimension
range = range of datapoint coordinate from 0 to range filename = use .csv filename

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

0