Add README and LICENCE
This commit is contained in:
21
LICENCE
Normal file
21
LICENCE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) [2022] [Stefanos Iosifidis]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
46
README.md
46
README.md
@@ -0,0 +1,46 @@
|
||||
|
||||
# R-Tree
|
||||
This project demonstrates the construction of an R-Tree using the Morton
|
||||
space filling curve.
|
||||
|
||||
## Bulk-loading
|
||||
For every object of the collection, we calculate the z-order value of its center and sort
|
||||
the collection based on it. Using this technique we want nodes created in the upper levels
|
||||
to contain objects that are as close to each other as possible. We set the maximum capacity
|
||||
of a node to 20. To utilize disk space properly at least 40% of each node should be full.
|
||||
With that in mind, every node except the root should have at least 8 nodes.
|
||||
|
||||
## Range query
|
||||
Given a window size, recursively search the tree from top to bottom for the nodes that
|
||||
intersect the window. When reaching the leaf nodes stop. Every object from the leaf nodes
|
||||
that still intersects the window is a hit.
|
||||
|
||||
## Nearest Neighbor Query
|
||||
A heap queue stores the child nodes of the root node, based on the distance from the
|
||||
point query. Iteratively pop a node from the heap queue and then push its child nodes in it.
|
||||
When reaching a leaf node, put the objects into the heap queue. Finally, if the heap queue
|
||||
is about to pop an object, this is the first neighbor hit. Continue until reaching the number
|
||||
of neighbors requested.
|
||||
|
||||
## Run Locally
|
||||
|
||||
Clone the project
|
||||
```bash
|
||||
git clone --recursive https://github.com/stefiosif/rtree
|
||||
```
|
||||
|
||||
Construct the R-Tree
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
Run all range queries given on `data/ranges.txt`
|
||||
```bash
|
||||
make range
|
||||
```
|
||||
|
||||
Run all knn queries given on `data/knn.txt` where k is specified (e.g. k=10)
|
||||
```bash
|
||||
make knn k=10
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user