Skip to content

Commit

Permalink
Merge pull request #6 from azizkayumov/develop
Browse files Browse the repository at this point in the history
fully-dynamic index
  • Loading branch information
azizkayumov authored Aug 25, 2024
2 parents f2f5ec1 + 2dc2d5f commit 5e8557b
Show file tree
Hide file tree
Showing 30 changed files with 2,069 additions and 837 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/Cargo.lock
.DS_Store
target
Cargo.lock
/demo/data/env
.DS_Store
34 changes: 6 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
[package]
name = "rindex"
version = "0.1.0"
edition = "2021"
rust-version = "1.63"
description = "Rindex: reverse nearest neighbor search index for high-dimensional clustered datasets."
readme = "README.md"
documentation = "https://docs.rs/rindex"
homepage = "https://github.com/azizkayumov/rindex"
repository = "https://github.com/azizkayumov/rindex"
license = "Apache-2.0"
keywords = ["tree", "dynamic-connectivity"]
categories = ["algorithms", "data-structures"]
authors = ["Kayumov A.I. <[email protected]>"]
exclude = ["./github"]
[workspace]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
conv = "0.3.3"
ordered-float = "4.1.1"

[dev-dependencies]
rand = "0.8"
criterion = "0.5.1"

[[bench]]
name = "benchmark"
harness = false
members = [
"lib",
"demo",
]
resolver = "2"
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/azizkayumov/rindex/ci.yml?style=plastic)](#)
[![crates.io](https://img.shields.io/crates/v/rindex)](https://crates.io/crates/rindex)

# rindex
Rindex: reverse nearest neighbor search index for high-dimensional clustered datasets.
Rindex: fully dynamic nearest neighbor search index for high-dimensional clustered datasets.

## License
This project is licensed under the [Apache License, Version 2.0](LICENSE.md) - See the [LICENSE.md](https://github.com/azizkayumov/rindex/blob/main/LICENSE) file for details.
41 changes: 0 additions & 41 deletions benches/benchmark.rs

This file was deleted.

10 changes: 10 additions & 0 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "demo"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rindex = { path = "../lib" }
rand = "0.8"
42 changes: 42 additions & 0 deletions demo/data/plot_tree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import matplotlib.pyplot as plt


# Read the data
lines = open("tree.csv").readlines()

points = {}
bubbles = {}
for row in lines:
s = row.split(",")
id = int(s[0])
height = int(s[1])
if height == 0:
x, y = float(s[-2]), float(s[-1])
points[id] = (x, y)
elif height == 1:
radius = float(s[-3])
x, y = float(s[-2]), float(s[-1])
children = s[3].split("+")
bubbles[id] = (x, y, radius, children)

fig, ax = plt.subplots()
colors = ['r', 'g', 'b', 'y', 'c', 'm']
for id, (x, y, radius, children) in bubbles.items():
color = colors[id % len(colors)]
circle = plt.Circle((x, y), radius, color='b', alpha=0.25)
ax.add_artist(circle)
for child in children:
child = int(child)
x, y = points[child][0], points[child][1]
plt.scatter(x, y, color='b', s=2, marker='+')

# remove coordinate axis names
plt.xticks([])
plt.yticks([])
plt.gca().set_aspect('equal')

title = "N = " + str(len(points)) + ", L = " + str(len(bubbles))
plt.title(title)

# set axis limits
plt.savefig("tree.png", dpi=300)
13 changes: 13 additions & 0 deletions demo/data/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
contourpy==1.2.1
cycler==0.12.1
fonttools==4.53.1
importlib_resources==6.4.2
kiwisolver==1.4.5
matplotlib==3.9.2
numpy==2.0.1
packaging==24.1
pillow==10.4.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
six==1.16.0
zipp==3.20.0
Loading

0 comments on commit 5e8557b

Please sign in to comment.