From the algorithm course of Princeton Articulation Point, the articulation algorithm dfs() ignores reverse of edge leading to v. But why cannot we use the backward edge when it points to direct parent? Please refer to this part of code
// **low number - ignore reverse of edge leading to v. Why is this???**
else if (w != u)
low[v] = Math.min(low[v], pre[w]);
The full code is below.
private void dfs(Graph G, int u, int v) {
int children = 0;
pre[v] = cnt++;
low[v] = pre[v];
for (int w : G.adj(v)) {
if (pre[w] == -1) {
children++;
dfs(G, v, w);
// update low number
low[v] = Math.min(low[v], low[w]);
// non-root of DFS is an articulation point if low[w] >= pre[v]
if (low[w] >= pre[v] && u != v)
articulation[v] = true;
}
// **low number - ignore reverse of edge leading to v. Why is this???**
else if (w != u)
low[v] = Math.min(low[v], pre[w]);
}
// root of DFS is an articulation point if it has more than 1 child
if (u == v && children > 1)
articulation[v] = true;
}