From 4576d70b03ebb89d7747541bafa1e9018a39699b Mon Sep 17 00:00:00 2001 From: mzuenni Date: Sat, 22 Jul 2017 14:09:47 +0200 Subject: Update articulationPoints.cpp root has an other calculation for isArt --- graph/articulationPoints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graph/articulationPoints.cpp') 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) { -- cgit v1.2.3