Skip to content

Commit 42dc5a8

Browse files
lrvideckisweb-flow
andauthored
Add more example usages (#137)
* add better example usages * [auto-verifier] verify commit c67f8d7 * format and golf * [auto-verifier] verify commit 6580c6f * more golf and format --------- Co-authored-by: GitHub <noreply@github.com>
1 parent 942e204 commit 42dc5a8

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

.verify-helper/timestamps.remote.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2024-12-05 10:41:42 -0600",
5353
"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-02-10 23:30:47 -0700",
5454
"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2024-12-14 19:50:29 -0600",
55-
"tests/library_checker_aizu_tests/graphs/cuts_callback.test.cpp": "2025-06-23 04:33:28 -0600",
55+
"tests/library_checker_aizu_tests/graphs/cuts_callback.test.cpp": "2025-06-23 18:22:23 -0600",
5656
"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
5757
"tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600",
5858
"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2025-02-10 23:30:47 -0700",

library/graphs/bridges_cuts/cuts_callback.hpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,31 @@
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+
//! }
719
//! }
20+
//!
821
//! vector<basic_string<int>> adj(n);
22+
//! vector<basic_string<array<int, 2>>> adj_edge_ids(n);
23+
//! vector<bool> seen(m);
924
//! cuts_callback(adj, [&](const vi& nodes) {
25+
//! rep (i, 0, sz(nodes) - 1)
26+
//! for (auto [u, e_id] : adj_edge_ids[nodes[i]])
27+
//! if (!seen[e_id]) {
28+
//! seen[e_id] = 1;
29+
//! // this edge is in the current BCC
30+
//! }
1031
//! });
1132
//! @endcode
1233
//! callback not called on components with a single node

0 commit comments

Comments
 (0)