Feature/centroid decomposition#7086
Merged
DenizAltunkapan merged 8 commits intoTheAlgorithms:masterfrom Nov 22, 2025
Merged
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.50% +0.04%
- Complexity 6746 6752 +6
============================================
Files 758 759 +1
Lines 22339 22402 +63
Branches 4384 4400 +16
============================================
+ Hits 17528 17587 +59
- Misses 4107 4109 +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
Contributor
Author
|
Hi @DenizAltunkapan , When you get a chance, please review and provide an approval so we can proceed with merging. |
DenizAltunkapan
approved these changes
Nov 22, 2025
Member
DenizAltunkapan
left a comment
There was a problem hiding this comment.
Thank you for your contribution @saikirankanakala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: