Skip to content

Commit 925ec3f

Browse files
authored
feat: centroid_decomposition was updated
1 parent 0ea61bb commit 925ec3f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

graph/graph_centroid_decomposition.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ namespace decomposition {
5252
centroids.push_back(centroid);
5353
clean(n);
5454
dfs(centroid);
55-
for(const auto &v: adj[centroid]) {
56-
if((subtree[centroid] - subtree[v]) == n / 2) {
55+
for(const auto &v: adj[centroid])
56+
if((subtree[centroid] - subtree[v]) == n / 2)
5757
centroids.push_back(v);
58-
}
59-
}
6058
assert(0 < (int) centroids.size() && (int) centroids.size() <= 2);
6159
return centroids;
6260
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy