stevenhalim / cpbook-code

CP4 Free Source Code Project (C++17, Java11, Python3 and OCaml)
2k stars 493 forks source link

Possible bug in articulation.[cpp|py|...] #94

Open Edmond-Mo opened 2 years ago

Edmond-Mo commented 2 years ago

This condition doesn't check for node u's parent to see if it's a root node. https://github.com/stevenhalim/cpbook-code/blob/c3fb85a1acc5f31e15879741e4c826684243fddf/ch4/traversal/articulation.cpp#L24

I think it should be something like this: if (dfs_parent[u] != -1 && dfs_low[v] >= dfs_num[u])