Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .verify-helper/timestamps.remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600",
"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/bcc_callback_aizu_bcc.test.cpp": "2025-06-25 15:06:18 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-06-25 15:06:18 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-06-25 15:06:18 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-06-25 15:06:18 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2025-07-08 18:30:57 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-07-08 18:30:57 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-07-08 18:30:57 -0600",
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-07-08 18:30:57 -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/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
Expand Down
13 changes: 13 additions & 0 deletions library/graphs/bridges_cuts/bcc_callback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
//! bridge_tree[uf.find(i)] += uf.find(v);
//! }
//!
//! {
//! // ********* IF NO MULTIPLE EDGES *********
//! vector<vi> adj(n);
//! vi cc_id(n);
//! bcc_callback(adj, [&](const vi& nodes) {
//! if (sz(nodes) == 2) {
//! // nodes[0] <=> nodes[1] is a bridge
//! return;
//! }
//! for (int v : nodes) cc_id[v] = nodes.back();
//! });
//! }
//!
//! vector<basic_string<int>> adj(n);
//! vector<basic_string<int>> block_vertex_tree(2 * n);
//! int bcc_id = n;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@ int main() {
adj[v] += u;
}
vector<pii> bridges;
vector<bool> seen(n);
bcc_callback(adj, [&](const vi& nodes) {
int count_edges = 0;
rep(i, 0, sz(nodes) - 1) {
seen[nodes[i]] = 1;
count_edges += ranges::count_if(adj[nodes[i]],
[&](int v) -> bool { return !seen[v]; });
}
if (count_edges == 1) {
assert(sz(nodes) == 2);
if (sz(nodes) == 2) {
pii bridge(nodes[0], nodes[1]);
if (bridge.first > bridge.second)
swap(bridge.first, bridge.second);
Expand Down
Loading