diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 785c8910..1108429c 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -52,7 +52,7 @@ "tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2024-12-05 10:41:42 -0600", "tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-02-10 23:30:47 -0700", "tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2024-12-14 19:50:29 -0600", -"tests/library_checker_aizu_tests/graphs/cuts_callback.test.cpp": "2025-06-23 04:33:28 -0600", +"tests/library_checker_aizu_tests/graphs/cuts_callback.test.cpp": "2025-06-23 18:22:23 -0600", "tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600", "tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600", "tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2025-02-10 23:30:47 -0700", diff --git a/library/graphs/bridges_cuts/cuts_callback.hpp b/library/graphs/bridges_cuts/cuts_callback.hpp index 32648536..e103c2a4 100644 --- a/library/graphs/bridges_cuts/cuts_callback.hpp +++ b/library/graphs/bridges_cuts/cuts_callback.hpp @@ -3,10 +3,31 @@ //! @code //! { //! vector> adj(n); -//! cuts_callback(adj, [&](const vi& nodes) {}); +//! vector edges(m); +//! UF uf(n); +//! cuts_callback(adj, [&](const vi& nodes) { +//! if (sz(nodes) > 2) +//! for (int v : nodes) uf.join(v, nodes[0]); +//! }); +//! vector> bridge_tree(n); +//! for (auto [u, v] : edges) +//! if (!uf.sameSet(u, v)) { +//! u = uf.find(u), v = uf.find(v); +//! bridge_tree[u] += v; +//! bridge_tree[v] += u; +//! } //! } +//! //! vector> adj(n); +//! vector>> adj_edge_ids(n); +//! vector seen(m); //! cuts_callback(adj, [&](const vi& nodes) { +//! rep (i, 0, sz(nodes) - 1) +//! for (auto [u, e_id] : adj_edge_ids[nodes[i]]) +//! if (!seen[e_id]) { +//! seen[e_id] = 1; +//! // this edge is in the current BCC +//! } //! }); //! @endcode //! callback not called on components with a single node