Skip to content

Commit

Permalink
Edited README and added standalone header(hpp) file
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewB330 committed Feb 24, 2020
1 parent cc8fc11 commit 52907f0
Show file tree
Hide file tree
Showing 3 changed files with 541 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,5 @@ ASALocalRun/

*.vcxproj
*.vcxproj.filters

*.exe
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
# EuclideanMST
Implementations of different algorithms for building Euclidean minimum spanning tree in k-dimensional space.
### Algorithms:
- EMST using Kd-tree O(NlogN)

Implementation of algorithm described in "Fast Euclidean Minimum Spanning Tree: Algorithm, Analysis, and Applications. William B. March, Parikshit Ram, Alexander G. Gray"
- Prim's algorithm O(N^2)
- EMST using Kd-tree __O(NlogN)__*
- Implementation of algorithm described in "Fast Euclidean Minimum Spanning Tree: Algorithm, Analysis, and Applications. William B. March, Parikshit Ram, Alexander G. Gray"*
- Prim's algorithm __O(N^2)__
- Straightforward MST on fully connected Eclidean graph

### Build

```>>> g++ main.cpp -o main```

### How to use

```cpp
std::vector<Point<3>> points(n); // your data
// read data ...
// you can acces any Point<> dimension by index
// e.g. cin >> points[i][0] >> points[i][1] >> points[i][2];

KdTreeSolver<3> solver(points);

Straightforward MST on fully connected Eclidean graph
double total_length = solver.get_total_length();
std::vector<Edge> edges = solver.get_solution();
// Edge is std::pair<size_t, size_t> - describes connected pair
```
### Benchmarks:
Expand All @@ -19,6 +36,11 @@ Implementations of different algorithms for building Euclidean minimum spanning
| 3 | 10000000 | 186.0 | ~1300000 |
| 4 | 10000000 | 673.9 | ~1500000 |
### Contribution
__Very appreciated__
### TODO:
- Implement EMST using Cover-tree
- More use-cases
- Online-solver
- \dots
Loading

0 comments on commit 52907f0

Please sign in to comment.