diff options
| author | mzuenni <mzuenni@users.noreply.github.com> | 2017-07-22 14:09:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-22 14:09:47 +0200 |
| commit | 4576d70b03ebb89d7747541bafa1e9018a39699b (patch) | |
| tree | affe9ecaa7afe5315d0705673309ca7c9cb57296 /graph | |
| parent | ea229a62473986aa76edf9b890c7c3592ef27b46 (diff) | |
Update articulationPoints.cpp
root has an other calculation for isArt
Diffstat (limited to 'graph')
| -rw-r--r-- | graph/articulationPoints.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/graph/articulationPoints.cpp b/graph/articulationPoints.cpp index 7b81c91..e7139d0 100644 --- a/graph/articulationPoints.cpp +++ b/graph/articulationPoints.cpp @@ -12,7 +12,7 @@ void dfs(int v, int parent = -1) { for (auto w : adjlist[v]) { if (!d[w]) { dfs(w, v); - if (low[w] >= d[v]) isArt[v] = true; + if (low[w] >= d[v] && v != root) isArt[v] = true; if (low[w] > d[v]) bridges.push_back(ii(v, w)); low[v] = min(low[v], low[w]); } else if (w != parent) { |
