-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
added a decremental connectivity data structure #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added a decremental connectivity data structure #684
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #684 +/- ##
==========================================
+ Coverage 94.70% 94.76% +0.06%
==========================================
Files 292 297 +5
Lines 23292 22148 -1144
==========================================
- Hits 22058 20989 -1069
+ Misses 1234 1159 -75 ☔ View full report in Codecov by Sentry. |
@Miraksi could you please share some reliable source about this data structure? |
This also is the paper took as reference, which was also referenced in the wikipedia entry on decremental connectivity |
@Miraksi your implementation works only for forests (connected list of trees), but the it is possible to (mis)use it for any graph. Do you see some reasonable way to avoid that? By the way: feel free to rebase. |
Good Idea! I've added a function that checks whether the given graph is acyclic (ignoring cycles of lenght one). This check runs in O(n) time, so its basically for free. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good enough, thanks!
Co-authored-by: Piotr Idzik <[email protected]>
Co-authored-by: Piotr Idzik <[email protected]>
Co-authored-by: Piotr Idzik <[email protected]>
8f9be6b
to
ad7e1a6
Compare
Decremental Connectivity Query in Rust
Description
A data structure that, given a forest, allows dynamic-connectivity queries. Meaning deletion of an edge (u,v) and checking whether two vertecies are still connected. This implementation of an algorithm developed by Shimon Even and Yossi Shiloach, has a precomputiation phase with complexity O(n) (n being the number of verticies), a deletion complexity of O(log n) and a connectivity-query complexity of O(1).
New feature
Checklist:
cargo clippy --all -- -D warnings
just before my last commit and fixed any issue that was found.cargo fmt
just before my last commit.cargo test
just before my last commit and all tests passed.mod.rs
file within its own folder, and in any parent folder(s).DIRECTORY.md
with the correct link.COUNTRIBUTING.md
and my code follows its guidelines.