A vertex in an undirected connected graph is an articulation point (or cut vertex) iff removing it (and edges through it) disconnects the graph. Articulation points represent vulnerabilities in a connected network – single points whose failure would split the network into 2 or more disconnected components. They are useful for designing reliable networks.
For a disconnected undirected graph, an articulation point is a vertex removing which increases number of connected components.

Following are some example graphs with articulation points encircled with red color.

[ad type=”banner”]

How to find all articulation points in a given graph?
A simple approach is to one by one remove all vertices and see if removal of a vertex causes disconnected graph. Following are steps of simple approach for connected graph.

1) For every vertex v, do following
…..a) Remove v from graph
..…b) See if the graph remains connected (We can either use BFS or DFS)
…..c) Add v back to the graph

Time complexity of above method is O(V*(V+E)) for a graph represented using adjacency list. Can we do better?

A O(V+E) algorithm to find all Articulation Points (APs)
The idea is to use DFS (Depth First Search). In DFS, we follow vertices in tree form called DFS tree. In DFS tree, a vertex u is parent of another vertex v, if v is discovered by u (obviously v is an adjacent of u in graph). In DFS tree, a vertex u is articulation point if one of the following two conditions is true.
1) u is root of DFS tree and it has at least two children.
2) u is not root of DFS tree and it has a child v such that no vertex in subtree rooted with v has a back edge to one of the ancestors (in DFS tree) of u.

Following figure shows same points as above with one additional point that a leaf in DFS Tree can never be an articulation point. (Source Ref 2)

[ad type=”banner”]

We do DFS traversal of given graph with additional code to find out Articulation Points (APs). In DFS traversal, we maintain a parent[] array where parent[u] stores parent of vertex u. Among the above mentioned two cases, the first case is simple to detect. For every vertex, count children. If currently visited vertex u is root (parent[u] is NIL) and has more than two children, print it.
How to handle second case? The second case is trickier. We maintain an array disc[] to store discovery time of vertices. For every node u, we need to find out the earliest visited vertex (the vertex with minimum discovery time) that can be reached from subtree rooted with u. So we maintain an additional array low[] which is defined as follows.

low[u] = min(disc[u], disc[w]) 
where w is an ancestor of u and there is a back edge from 
some descendant of u to w.

JAVA programming:

[pastacode lang=”java” manual=”%2F%2F%20A%20Java%20program%20to%20find%20articulation%20points%20in%20an%20undirected%20graph%0Aimport%20java.io.*%3B%0Aimport%20java.util.*%3B%0Aimport%20java.util.LinkedList%3B%0A%C2%A0%0A%2F%2F%20This%20class%20represents%20an%20undirected%20graph%20using%20adjacency%20list%0A%2F%2F%20representation%0Aclass%20Graph%0A%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0private%20int%20V%3B%C2%A0%C2%A0%20%2F%2F%20No.%20of%20vertices%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Array%C2%A0%20of%20lists%20for%20Adjacency%20List%20Representation%0A%C2%A0%C2%A0%C2%A0%C2%A0private%20LinkedList%3CInteger%3E%20adj%5B%5D%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0int%20time%20%3D%200%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0static%20final%20int%20NIL%20%3D%20-1%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Constructor%0A%C2%A0%C2%A0%C2%A0%C2%A0Graph(int%20v)%0A%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0V%20%3D%20v%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0adj%20%3D%20new%20LinkedList%5Bv%5D%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0for%20(int%20i%3D0%3B%20i%3Cv%3B%20%2B%2Bi)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0adj%5Bi%5D%20%3D%20new%20LinkedList()%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2FFunction%20to%20add%20an%20edge%20into%20the%20graph%0A%C2%A0%C2%A0%C2%A0%C2%A0void%20addEdge(int%20v%2C%20int%20w)%0A%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0adj%5Bv%5D.add(w)%3B%C2%A0%20%2F%2F%20Add%20w%20to%20v’s%20list.%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0adj%5Bw%5D.add(v)%3B%C2%A0%20%2F%2FAdd%20v%20to%20w’s%20list%0A%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20A%20recursive%20function%20that%20find%20articulation%20points%20using%20DFS%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20u%20–%3E%20The%20vertex%20to%20be%20visited%20next%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20visited%5B%5D%20–%3E%20keeps%20tract%20of%20visited%20vertices%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20disc%5B%5D%20–%3E%20Stores%20discovery%20times%20of%20visited%20vertices%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20parent%5B%5D%20–%3E%20Stores%20parent%20vertices%20in%20DFS%20tree%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20ap%5B%5D%20–%3E%20Store%20articulation%20points%0A%C2%A0%C2%A0%C2%A0%C2%A0void%20APUtil(int%20u%2C%20boolean%20visited%5B%5D%2C%20int%20disc%5B%5D%2C%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0int%20low%5B%5D%2C%20int%20parent%5B%5D%2C%20boolean%20ap%5B%5D)%0A%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Count%20of%20children%20in%20DFS%20Tree%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0int%20children%20%3D%200%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Mark%20the%20current%20node%20as%20visited%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0visited%5Bu%5D%20%3D%20true%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Initialize%20discovery%20time%20and%20low%20value%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0disc%5Bu%5D%20%3D%20low%5Bu%5D%20%3D%20%2B%2Btime%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Go%20through%20all%20vertices%20aadjacent%20to%20this%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0Iterator%3CInteger%3E%20i%20%3D%20adj%5Bu%5D.iterator()%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0while%20(i.hasNext())%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0int%20v%20%3D%20i.next()%3B%C2%A0%20%2F%2F%20v%20is%20current%20adjacent%20of%20u%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20If%20v%20is%20not%20visited%20yet%2C%20then%20make%20it%20a%20child%20of%20u%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20in%20DFS%20tree%20and%20recur%20for%20it%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0if%20(!visited%5Bv%5D)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0children%2B%2B%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0parent%5Bv%5D%20%3D%20u%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0APUtil(v%2C%20visited%2C%20disc%2C%20low%2C%20parent%2C%20ap)%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Check%20if%20the%20subtree%20rooted%20with%20v%20has%20a%20connection%20to%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20one%20of%20the%20ancestors%20of%20u%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0low%5Bu%5D%C2%A0%20%3D%20Math.min(low%5Bu%5D%2C%20low%5Bv%5D)%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20u%20is%20an%20articulation%20point%20in%20following%20cases%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20(1)%20u%20is%20root%20of%20DFS%20tree%20and%20has%20two%20or%20more%20chilren.%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0if%20(parent%5Bu%5D%20%3D%3D%20NIL%20%26%26%20children%20%3E%201)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0ap%5Bu%5D%20%3D%20true%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20(2)%20If%20u%20is%20not%20root%20and%20low%20value%20of%20one%20of%20its%20child%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20is%20more%20than%20discovery%20value%20of%20u.%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0if%20(parent%5Bu%5D%20!%3D%20NIL%20%26%26%20low%5Bv%5D%20%3E%3D%20disc%5Bu%5D)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0ap%5Bu%5D%20%3D%20true%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Update%20low%20value%20of%20u%20for%20parent%20function%20calls.%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0else%20if%20(v%20!%3D%20parent%5Bu%5D)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0low%5Bu%5D%C2%A0%20%3D%20Math.min(low%5Bu%5D%2C%20disc%5Bv%5D)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20The%20function%20to%20do%20DFS%20traversal.%20It%20uses%20recursive%20function%20APUtil()%0A%C2%A0%C2%A0%C2%A0%C2%A0void%20AP()%0A%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Mark%20all%20the%20vertices%20as%20not%20visited%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0boolean%20visited%5B%5D%20%3D%20new%20boolean%5BV%5D%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0int%20disc%5B%5D%20%3D%20new%20int%5BV%5D%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0int%20low%5B%5D%20%3D%20new%20int%5BV%5D%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0int%20parent%5B%5D%20%3D%20new%20int%5BV%5D%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0boolean%20ap%5B%5D%20%3D%20new%20boolean%5BV%5D%3B%20%2F%2F%20To%20store%20articulation%20points%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Initialize%20parent%20and%20visited%2C%20and%20ap(articulation%20point)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20arrays%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0for%20(int%20i%20%3D%200%3B%20i%20%3C%20V%3B%20i%2B%2B)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0parent%5Bi%5D%20%3D%20NIL%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0visited%5Bi%5D%20%3D%20false%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0ap%5Bi%5D%20%3D%20false%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Call%20the%20recursive%20helper%20function%20to%20find%20articulation%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20points%20in%20DFS%20tree%20rooted%20with%20vertex%20’i’%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0for%20(int%20i%20%3D%200%3B%20i%20%3C%20V%3B%20i%2B%2B)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0if%20(visited%5Bi%5D%20%3D%3D%20false)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0APUtil(i%2C%20visited%2C%20disc%2C%20low%2C%20parent%2C%20ap)%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Now%20ap%5B%5D%20contains%20articulation%20points%2C%20print%20them%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0for%20(int%20i%20%3D%200%3B%20i%20%3C%20V%3B%20i%2B%2B)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0if%20(ap%5Bi%5D%20%3D%3D%20true)%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0System.out.print(i%2B%22%20%22)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Driver%20method%0A%C2%A0%C2%A0%C2%A0%C2%A0public%20static%20void%20main(String%20args%5B%5D)%0A%C2%A0%C2%A0%C2%A0%C2%A0%7B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%2F%2F%20Create%20graphs%20given%20in%20above%20diagrams%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0System.out.println(%22Articulation%20points%20in%20first%20graph%20%22)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0Graph%20g1%20%3D%20new%20Graph(5)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g1.addEdge(1%2C%200)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g1.addEdge(0%2C%202)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g1.addEdge(2%2C%201)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g1.addEdge(0%2C%203)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g1.addEdge(3%2C%204)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g1.AP()%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0System.out.println()%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0System.out.println(%22Articulation%20points%20in%20Second%20graph%22)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0Graph%20g2%20%3D%20new%20Graph(4)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g2.addEdge(0%2C%201)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g2.addEdge(1%2C%202)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g2.addEdge(2%2C%203)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g2.AP()%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0System.out.println()%3B%0A%C2%A0%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0System.out.println(%22Articulation%20points%20in%20Third%20graph%20%22)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0Graph%20g3%20%3D%20new%20Graph(7)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(0%2C%201)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(1%2C%202)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(2%2C%200)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(1%2C%203)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(1%2C%204)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(1%2C%206)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(3%2C%205)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.addEdge(4%2C%205)%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0g3.AP()%3B%0A%C2%A0%C2%A0%C2%A0%C2%A0%7D%0A%7D” message=”” highlight=”” provider=”manual”/]

 

[ad type=”banner”]Output:

Articulation points in first graph
0 3
Articulation points in second graph
1 2
Articulation points in third graph
1