Update README, missing benchmarks
This commit is contained in:
22
README.md
22
README.md
@@ -1,4 +1,4 @@
|
|||||||
# Dynamic Reachability Algorithms [DRA]
|
# Reachability algorithms by Roditty and Zwick
|
||||||
The goal of this project is to implement a collection of dynamic reachability
|
The goal of this project is to implement a collection of dynamic reachability
|
||||||
algorithms covered in "Improved Dynamic Reachability Algorithms for Directed Graphs"
|
algorithms covered in "Improved Dynamic Reachability Algorithms for Directed Graphs"
|
||||||
by Liam Roditty and Uri Zwick.
|
by Liam Roditty and Uri Zwick.
|
||||||
@@ -27,32 +27,32 @@ int main() {
|
|||||||
auto hk = new algo::HenzingerKing(G);
|
auto hk = new algo::HenzingerKing(G);
|
||||||
hk->init();
|
hk->init();
|
||||||
|
|
||||||
// Query the dynamic reachability algorithm
|
|
||||||
std::cout << "Path from 4 to 8 exists: " << hk.query(4, 8) << '\n';
|
|
||||||
|
|
||||||
// Remove edges
|
// Remove edges
|
||||||
std::vector<std::pair<int, int>> delEdges( {4, 6}, {5, 6}, {3, 1} );
|
std::vector<std::pair<int, int>> delEdges( {4, 6}, {5, 6}, {3, 1} );
|
||||||
for (const auto& [u, v] : delEdges)
|
for (const auto& [u, v] : delEdges)
|
||||||
hk.remove(u, v);
|
hk.remove(u, v);
|
||||||
|
|
||||||
std::cout << "Path from 4 to 8 exists: " << dr.query(4, 8);
|
|
||||||
|
|
||||||
// Insert edges
|
// Insert edges
|
||||||
std::pair<int, std::vector<int>> addEdges( { 1 , {2, 3, 4, 5} } );
|
std::pair<int, std::vector<int>> addEdges( { 1 , {2, 3, 4, 5} } );
|
||||||
hk.insert(u, { v });
|
hk.insert(u, addEdges);
|
||||||
|
|
||||||
std::cout << "Path from 4 to 8 exists: " << dr.query(4, 8);
|
// Search query
|
||||||
|
std::cout << "Path from 4 to 8 exists: " << hk.query(4, 8) << '\n';
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run Locally
|
## Run locally
|
||||||
Clone the repository with submodules (doctest/nanobench):
|
Clone the repository with submodules (doctest/nanobench):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone --recurse-submodules https://github.com/stefiosif/dynamic-reachability-algorithms
|
git clone --recurse-submodules https://github.com/stefiosif/dynamic-reachability-algorithms
|
||||||
|
cd dynamic-reachability-algorithms
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Benchmark
|
||||||
|
|
||||||
|
|
||||||
## References
|
## References
|
||||||
* [Improved Dynamic Reachability Algorithms for Directed Graphs](www.google.com)
|
* [Improved Dynamic Reachability Algorithms for Directed Graphs](https://ieeexplore.ieee.org/document/1181993)
|
||||||
|
|||||||
Reference in New Issue
Block a user