Articulation Points (Cut Vertices)
Find vertices whose removal increases the number of connected components in an undirected graph. Also known as cut vertices, these are critical nodes in network analysis. Uses DFS with discovery time and low values to identify in O(V+E) time.
Visualization
Interactive visualization for Articulation Points (Cut Vertices)
Interactive visualization with step-by-step execution
Implementation
1function findArticulationPoints(graph: Map<number, number[]>, V: number): number[] {
2 const disc = new Map<number, number>();
3 const low = new Map<number, number>();
4 const parent = new Map<number, number | null>();
5 const ap = new Set<number>();
6 let time = 0;
7
8 function dfsAP(u: number): void {
9 let children = 0;
10 disc.set(u, time);
11 low.set(u, time);
12 time++;
13
14 for (const v of graph.get(u) || []) {
15 if (!disc.has(v)) {
16 children++;
17 parent.set(v, u);
18 dfsAP(v);
19
20 low.set(u, Math.min(low.get(u)!, low.get(v)!));
21
22 // Check articulation point condition
23 if (parent.get(u) === null && children > 1) {
24 ap.add(u);
25 }
26 if (parent.get(u) !== null && low.get(v)! >= disc.get(u)!) {
27 ap.add(u);
28 }
29 } else if (v !== parent.get(u)) {
30 low.set(u, Math.min(low.get(u)!, disc.get(v)!));
31 }
32 }
33 }
34
35 for (let i = 0; i < V; i++) {
36 if (!disc.has(i)) {
37 parent.set(i, null);
38 dfsAP(i);
39 }
40 }
41
42 return Array.from(ap);
43}Deep Dive
Theoretical Foundation
A vertex v is an articulation point if: (1) v is root of DFS tree with 2+ children, or (2) v is not root and has child w where no back edge from w's subtree goes to v's ancestors. Low[w] >= Disc[v] indicates w's subtree can't reach ancestors without v.
Complexity
Time
O(V + E)
O(V + E)
O(V + E)
Space
O(V)
Applications
Industry Use
Network infrastructure reliability analysis
Social network critical user identification
Transportation system bottleneck detection
Circuit design fault tolerance analysis
Internet backbone vulnerability assessment
Supply chain critical node identification
Communication network resilience planning
Use Cases
Related Algorithms
Depth-First Search (DFS)
Graph traversal exploring as deep as possible before backtracking. DFS is a fundamental algorithm that uses a stack (either implicitly through recursion or explicitly) to explore graph vertices. It's essential for cycle detection, topological sorting, and pathfinding problems.
Breadth-First Search (BFS)
Level-by-level graph traversal guaranteeing shortest paths in unweighted graphs. BFS uses a queue to explore vertices level by level, making it optimal for finding shortest paths and solving problems that require exploring nearest neighbors first.
Dijkstra's Algorithm
Finds shortest path from source to all vertices in weighted graph with non-negative edges. Uses greedy approach with priority queue.
Floyd-Warshall Algorithm
Floyd-Warshall is an all-pairs shortest path algorithm that finds shortest distances between every pair of vertices in a weighted graph. Unlike Dijkstra (single-source), it computes shortest paths from all vertices to all other vertices simultaneously. The algorithm can handle negative edge weights but not negative cycles. Developed independently by Robert Floyd, Bernard Roy, and Stephen Warshall in the early 1960s.