File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
library/graphs/bridges_cuts Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 66// ! vector<pii> edges(m);
77// ! UF uf(n);
88// ! cuts_callback(adj, [&](const vi& nodes) {
9- // ! if(sz(nodes) > 2)
9+ // ! if (sz(nodes) > 2)
1010// ! for (int v : nodes) uf.join(v, nodes[0]);
1111// ! });
1212// ! vector<basic_string<int>> bridge_tree(n);
1313// ! for (auto [u, v] : edges) {
14- // ! if(!uf.sameSet(u,v)) {
14+ // ! if (!uf.sameSet(u,v)) {
1515// ! u = uf.find(u), v = uf.find(v);
1616// ! bridge_tree[u] += v;
1717// ! bridge_tree[v] += u;
2323// ! vector<basic_string<array<int, 2>>> adj_edge_ids(n);
2424// ! vector<bool> seen(m);
2525// ! cuts_callback(adj, [&](const vi& nodes) {
26- // ! rep (i, 0, sz(nodes) - 1) {
27- // ! int v = nodes[i];
28- // ! for (auto [u, e_id] : adj_edge_ids[v]){
29- // ! if(!seen[e_id]) {
26+ // ! rep (i, 0, sz(nodes) - 1)
27+ // ! for (auto [u, e_id] : adj_edge_ids[nodes[i]])
28+ // ! if (!seen[e_id]) {
3029// ! seen[e_id] = 1;
3130// ! // this edge is in the current BCC
3231// ! }
33- // ! }
34- // ! }
3532// ! });
3633// ! @endcode
3734// ! callback not called on components with a single node
You can’t perform that action at this time.
0 commit comments