Skip to main content

Articulation Points

Definition​

Articulation Points Algorithm is a graph algorithm used to identify critical points, or articulation points, within a connected graph. These points, when removed, disconnect the graph or increase its number of connected components

Practice​

function findArticulationPoints(graph):
// Initialization
articulationPoints = []
visited = [False] * (number of vertices)
discoveryTime = [0] * (number of vertices)
low = [float('inf')] * (number of vertices)
parent = [-1] * (number of vertices)
time = 0

// DFS traversal
for vertex in range(number of vertices):
if not visited[vertex]:
dfsArticulationPoints(graph, vertex, visited, discoveryTime, low, parent, articulationPoints)

return articulationPoints

function dfsArticulationPoints(graph, vertex, visited, discoveryTime, low, parent, articulationPoints):
// Initialization
visited[vertex] = True
children = 0
discoveryTime[vertex] = time
low[vertex] = time
time += 1

// Traverse adjacent vertices
for adjacentVertex in graph[vertex]:
if not visited[adjacentVertex]:
children += 1
parent[adjacentVertex] = vertex
dfsArticulationPoints(graph, adjacentVertex, visited, discoveryTime, low, parent, articulationPoints)

// Update low value
low[vertex] = min(low[vertex], low[adjacentVertex])

// Check if vertex is articulation point
if parent[vertex] == -1 and children > 1:
articulationPoints.append(vertex)
if parent[vertex] != -1 and low[adjacentVertex] >= discoveryTime[vertex]:
articulationPoints.append(vertex)
elif adjacentVertex != parent[vertex]:
low[vertex] = min(low[vertex], discoveryTime[adjacentVertex])