Articulation point in graph

Graphs Additional Algorithms Hard
  • This problem involves finding "articulation points" or "cut vertices" in a network - which is critical in designing and maintaining efficient and resilient networks
  • For instance, failure of such points in internet networks can cause a complete shutdown of data transfer across different regions
  • Similar scenarios can be seen in social networks and power grids where one failure can lead to the disconnection of entire sections
  • Understanding these points allows for improved network robustness and better disaster recovery strategies

Given an undirected graph with V vertices and adjacency list adj. Find all the vertices removing which (and edges through it) would increase the number of connected components in the graph. The graph may be initially disconnected.. Return the vertices in ascending order. If there are no such vertices then returns a list containing -1.


Note: Indexing is zero-based i.e nodes numbering from (0 to V-1). There might be loops present in the graph.

Examples:


Input: V = 7, adj=[[1,2,3], [0], [0,3,4,5], [2,0], [2,6], [2,6], [4,5]] 

Output: [0, 2]

Explanation: If we remove node 0 or node 2, the graph will be divided into 2 or more components.


Input: V = 5, adj=[[1], [0,4], [3,4], [2,4], [1,2,3]] 

Output: [1, 4]

Explanation: If we remove either node 1 or node 4, the graph breaks into multiple components.

Input: V = 3, adj=[[1,2], [0,2], [0,1]]

Constraints

  • E= Number of Edges
  • 1 ≤ V, E ≤ 104

Hints

  • Perform DFS traversal, tracking discovery time (disc[]) and lowest reachable vertex (low[]) for each node.
  • A vertex u is an articulation point if, It is the root of DFS and has two or more independent children. It is not the root, but some subtree cannot reach an ancestor (i.e., low[v] ≥ disc[u]).

Company Tags

Wayfair MongoDB Philips Healthcare Boston Consulting Group Siemens Healthineers GE Healthcare Morgan Stanley IBM Snowflake Oracle Deloitte Teladoc Health Rakuten OYO Rooms eBay Intel ARM NVIDIA Twilio Cloudflare Seagate Technology Johnson & Johnson Epic Systems Ubisoft Flipkart Google Microsoft Amazon Meta Apple Netflix Adobe