-
Notifications
You must be signed in to change notification settings - Fork 20.8k
Feature/centroid decomposition #7086
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
base: master
Are you sure you want to change the base?
Feature/centroid decomposition #7086
Conversation
- Implement CentroidDecomposition with O(N log N) construction - Add CentroidTree class with parent tracking and query methods - Include buildFromEdges helper for easy tree construction - Add comprehensive test suite with 20+ test cases - Cover edge cases, validation, and various tree structures Closes TheAlgorithms#7054
- Implement CentroidDecomposition with O(N log N) construction - Add CentroidTree class with parent tracking and query methods - Include buildFromEdges helper for easy tree construction - Add comprehensive test suite with 20+ test cases - Cover edge cases, validation, and various tree structures Closes TheAlgorithms#7054
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7086 +/- ##
============================================
+ Coverage 78.46% 78.51% +0.04%
- Complexity 6745 6751 +6
============================================
Files 758 759 +1
Lines 22339 22402 +63
Branches 4384 4400 +16
============================================
+ Hits 17529 17588 +59
- Misses 4106 4108 +2
- Partials 704 706 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Change single-line lambdas to multi-line format - Align with repository code style guidelines
- Format code according to .clang-format configuration - Use single-line lambdas as allowed by AllowShortLambdasOnASingleLine: All - Apply 4-space indentation - Ensure proper line endings
|
Hi @DenizAltunkapan , When you get a chance, please review and provide an approval so we can proceed with merging. |
Description
Implements Centroid Decomposition for trees as requested in #7054.
Centroid Decomposition is a divide-and-conquer technique for tree data structures that recursively partitions trees by finding centroids - nodes whose removal creates balanced subtrees.
Changes
Features
Testing
Closes #7054
Checklist: