Skip to content

Commit

Permalink
Update BCC Vertex.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
baluteshih committed Oct 21, 2023
1 parent d87b4b1 commit b67073b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions codebook/2_Graph/BCC_Vertex.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
vector<int> G[N]; // 1-base
vector<int> nG[N * 2], bcc[N];
int low[N], dfn[N], Time;
int low[N], dfn[N], Time, st[N], top;
int bcc_id[N], bcc_cnt; // 1-base
bool is_cut[N]; // whether is av
bool cir[N * 2];
int st[N], top;

void dfs(int u, int pa = -1) {
int child = 0;
low[u] = dfn[u] = ++Time;
Expand All @@ -29,13 +27,11 @@ void dfs(int u, int pa = -1) {
low[u] = min(low[u], dfn[v]);
if (pa == -1 && child < 2) is_cut[u] = 0;
}

void bcc_init(int n) { // TODO: init {nG, cir}[1..2n]
Time = bcc_cnt = top = 0;
for (int i = 1; i <= n; ++i)
G[i].clear(), dfn[i] = bcc_id[i] = is_cut[i] = 0;
}

void bcc_solve(int n) {
for (int i = 1; i <= n; ++i)
if (!dfn[i]) dfs(i);
Expand Down

0 comments on commit b67073b

Please sign in to comment.