0
0
DSA Typescriptprogramming~5 mins

Bridges in Graph Tarjan's Algorithm in DSA Typescript - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a bridge in a graph?
A bridge is an edge in a graph that, if removed, increases the number of connected components. It means the edge is critical for keeping the graph connected.
Click to reveal answer
intermediate
What is the main idea behind Tarjan's algorithm for finding bridges?
Tarjan's algorithm uses a depth-first search (DFS) to assign discovery times and low values to each vertex. An edge is a bridge if the low value of the connected vertex is greater than the discovery time of the current vertex.
Click to reveal answer
intermediate
In Tarjan's algorithm, what does the 'low' value represent?
The 'low' value of a vertex is the earliest discovery time reachable from that vertex or its descendants by following zero or more tree edges and then possibly one back edge.
Click to reveal answer
advanced
Why do we compare low[v] > disc[u] to find a bridge between u and v?
If low[v] > disc[u], it means vertex v and its descendants cannot reach any ancestor of u without using the edge (u, v). So, removing (u, v) disconnects the graph, making it a bridge.
Click to reveal answer
beginner
What is the time complexity of Tarjan's algorithm for finding bridges?
The time complexity is O(V + E), where V is the number of vertices and E is the number of edges, because it performs a single DFS traversal.
Click to reveal answer
What does a bridge in a graph do?
AConnects two disconnected graphs
BDecreases the number of connected components if removed
CHas no effect on connectivity
DIncreases the number of connected components if removed
In Tarjan's algorithm, what is the purpose of the discovery time array?
ATo count the number of edges
BTo store the degree of each vertex
CTo store the order in which vertices are visited in DFS
DTo mark visited vertices
What does it mean if low[v] <= disc[u] in Tarjan's algorithm?
AEdge (u, v) is not a bridge
BEdge (u, v) is a bridge
CVertex v is not reachable
DVertex u is a leaf
Which traversal method does Tarjan's algorithm use?
ADepth-first search
BDijkstra's algorithm
CBreadth-first search
DPrim's algorithm
What is the time complexity of Tarjan's algorithm for bridges?
AO(E^2)
BO(V + E)
CO(V^2)
DO(log V)
Explain how Tarjan's algorithm finds bridges in a graph using discovery and low values.
Think about how DFS helps track back edges and earliest reachable ancestors.
You got /5 concepts.
    Describe why an edge is considered a bridge in terms of graph connectivity and Tarjan's algorithm.
    Focus on the meaning of low and discovery times in connectivity.
    You got /4 concepts.