Cut point: removing a point x, the non-directed graph is divided into two (or more)
Cutting edge: remove one edge x, without dividing the directed graph into two (or more)
Timestamp: Number dfn traverse the search tree
Retrospective values: subtree subtree and non-search tree up to the minimum point
Cutpoint determination and cutting edge
1 void tarjan(int x, int in_edge) { 2 dfn[x] = low[x] = ++num; 3 for (int i = head[x]; i; i = nex[i]) { 4 int y = ver[i]; 5 if (!dfn[y]) { 6 tarjan(y, i); 7 low[x] = min(low[x], low[y]); 8 if (low[y] > dfn[x]) 9 bridge[i] = bridge[i ^ 1] = true; 10 } else if (i != (in_edge ^ 1)) 11 low[x] = min(low[x], dfn[y]); 12 } 13 }
1 void tarjan(int x) { 2 dfn[x] = low[x] = ++num; 3 int flag = 0; 4 for (int i = head[x]; i; i = nex[i]) { 5 int y = ver[i]; 6 if (!dfn[y]) { 7 tarjan(y); 8 low[x] = min(low[x], low[y]); 9 if (low[y] >= dfn[x]) { 10 flag++; 11 if (x != 1 || flag > 1) cut[x] = true; 12 } 13 } else low[x] = min(low[x], dfn[y]); 14 } 15 }
Reduced edge point: No labeled using dfs
Point Point reduction: %%%