Critical Connections in a Network
Master this topic with zero to advance depth.
Critical Connections in a Network
An edge in an undirected graph is a critical connection (bridge) if removing it increases the number of connected components. Return all such edges.
Relation to DSU
While standard DSU doesn't easily find bridges (Tarjan's or Kosaraju's are preferred), we can use a specialized 2-Edge-Connected Components algorithm using DSU. Any edge that is part of a cycle is NOT critical. We can use DSU to merge nodes in the same cycle.
Examples
Level II: Brute-Force DFS (Bridge Detection)
Intuition
For each connection , remove it from the graph and check if the graph is still connected using DFS. If it's not, the edge is a critical connection.
Level III: Tarjan's Algorithm (Standard)
Intuition
Use DFS discovery time and 'low-link' values. An edge is a bridge if .
Found an issue or have a suggestion?
Help us improve! Report bugs or suggest new features on our Telegram group.