File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
library/graphs/bridges_cuts Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 33// ! @code
44// ! {
55// ! vector<vector<int>> adj(n);
6- // ! cuts_callback(adj, [&](const vi& nodes) {});
6+ // ! vector<pii> edges(m);
7+ // ! UF uf(n);
8+ // ! cuts_callback(adj, [&](const vi& nodes) {
9+ // ! if(sz(nodes) > 2)
10+ // ! for (int v : nodes) uf.join(v, nodes[0]);
11+ // ! });
12+ // ! vector<basic_string<int>> bridge_tree(n);
13+ // ! for (auto [u, v] : edges) {
14+ // ! if(!uf.sameSet(u,v)) {
15+ // ! u = uf.find(u), v = uf.find(v);
16+ // ! bridge_tree[u] += v;
17+ // ! bridge_tree[v] += u;
18+ // ! }
19+ // ! }
720// ! }
21+ // !
822// ! vector<basic_string<int>> adj(n);
23+ // ! vector<basic_string<array<int, 2>>> adj_edge_ids(n);
24+ // ! vector<bool> seen(m);
925// ! 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]) {
30+ // ! seen[e_id] = 1;
31+ // ! // this edge is in the current BCC
32+ // ! }
33+ // ! }
34+ // ! }
1035// ! });
1136// ! @endcode
1237// ! callback not called on components with a single node
You can’t perform that action at this time.
0 commit comments