File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed
library/graphs/bridges_cuts
tests/library_checker_aizu_tests/graphs Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 5050"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp" : " 2024-11-17 14:04:03 -0600" ,
5151"tests/library_checker_aizu_tests/flow/hungarian.test.cpp" : " 2024-11-17 14:04:03 -0600" ,
5252"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp" : " 2024-12-05 10:41:42 -0600" ,
53- "tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp" : " 2025-06-25 15:06:18 -0600" ,
54- "tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp" : " 2025-06-25 15:06:18 -0600" ,
55- "tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp" : " 2025-06-25 15:06:18 -0600" ,
56- "tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp" : " 2025-06-25 15:06:18 -0600" ,
53+ "tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp" : " 2025-07-08 18:30:57 -0600" ,
54+ "tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp" : " 2025-07-08 18:30:57 -0600" ,
55+ "tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp" : " 2025-07-08 18:30:57 -0600" ,
56+ "tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp" : " 2025-07-08 18:30:57 -0600" ,
5757"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp" : " 2025-02-10 23:30:47 -0700" ,
5858"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp" : " 2024-12-14 19:50:29 -0600" ,
5959"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp" : " 2024-12-14 19:50:29 -0600" ,
Original file line number Diff line number Diff line change 2727// ! bridge_tree[uf.find(i)] += uf.find(v);
2828// ! }
2929// !
30+ // ! {
31+ // ! // ********* IF NO MULTIPLE EDGES *********
32+ // ! vector<vi> adj(n);
33+ // ! vi cc_id(n);
34+ // ! bcc_callback(adj, [&](const vi& nodes) {
35+ // ! if (sz(nodes) == 2) {
36+ // ! // nodes[0] <=> nodes[1] is a bridge
37+ // ! return;
38+ // ! }
39+ // ! for (int v : nodes) cc_id[v] = nodes.back();
40+ // ! });
41+ // ! }
42+ // !
3043// ! vector<basic_string<int>> adj(n);
3144// ! vector<basic_string<int>> block_vertex_tree(2 * n);
3245// ! int bcc_id = n;
Original file line number Diff line number Diff line change @@ -15,16 +15,8 @@ int main() {
1515 adj[v] += u;
1616 }
1717 vector<pii> bridges;
18- vector<bool > seen (n);
1918 bcc_callback (adj, [&](const vi& nodes) {
20- int count_edges = 0 ;
21- rep (i, 0 , sz (nodes) - 1 ) {
22- seen[nodes[i]] = 1 ;
23- count_edges += ranges::count_if (adj[nodes[i]],
24- [&](int v) -> bool { return !seen[v]; });
25- }
26- if (count_edges == 1 ) {
27- assert (sz (nodes) == 2 );
19+ if (sz (nodes) == 2 ) {
2820 pii bridge (nodes[0 ], nodes[1 ]);
2921 if (bridge.first > bridge.second )
3022 swap (bridge.first , bridge.second );
You can’t perform that action at this time.
0 commit comments