Critical Connections
Application of Tarjan's Algorithm to find Bridges in Undirected Graphs
-
Algorithms and Data Structures: TheAlgorist.com
-
System Design: DistributedComputing.dev
-
Low Level Design: LowLevelDesign.io
-
Frontend Engineering: FrontendEngineering.io
Problem Statment: We have network of servers which are connected by bidirectional server-to-server connections forming a network. Any server can reach any other server directly or indirectly through other servers.
A critical connection is a connection that will make some server unable to reach some other servers if the connection is removed.
Return all critical connections in the network in any order.
Example:
2 /| / | / | 1 | | \ | | \| | 0 | 3
Input: Total number of servers = 4, connections = [[0,1],[1,2],[1,3],[2,0]]
Output: [[1,3]] OR [[3,1]]
Solution:
Algorithm:
This is a Premium content.
Please subscribe to the Algorithms course to access the detailed Algorithm discussion.
Java code:
This is a Premium content.
Please subscribe to Algorithms course to access the code.
Python code:
This is a Premium content.
Please subscribe to Algorithms course to access the code.
Don't forget to take a look at other interesting Graph Problems:
- How to Send Message to Entire Social Network
- Disconnected Network
- Minimal Vertices
- Course Scheduling
Instructor:
If you have any feedback, please use this form: https://thealgorists.com/Feedback.


