Skip to content

Conversation

@iampratik13
Copy link
Contributor

This PR introduces a complete implementation of the Bridge Detection Algorithm (also known as critical edge detection) in R using Tarjan’s algorithm. The algorithm identifies all edges in an undirected graph whose removal increases the number of connected components. These edges are also referred to as bridges.

Algorithm Complexity:
• Time Complexity: O(V + E) — DFS traversal over all vertices and edges
• Space Complexity: O(V) — arrays for visited, discovery, low-link, and parent information

Use Cases:
• Network reliability analysis (finding critical connections)
• Graph connectivity analysis
• Educational demonstrations for graph algorithms in R

File added: bridge_detector.r

@siriak siriak requested a review from Copilot October 12, 2025 09:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a bridge detection algorithm implementation using Tarjan's method to identify critical edges in undirected graphs. The algorithm finds edges whose removal would increase the number of connected components in the graph.

  • Implements Tarjan's bridge detection algorithm with O(V + E) time complexity
  • Provides comprehensive examples demonstrating various graph topologies
  • Includes edge case handling for empty graphs and disconnected components

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit e6c0b52 into TheAlgorithms:master Oct 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants