Graph Theory37 sections · 1633 units
Open in Course

Bridge Algorithm Walkthrough

(Step-by-step execution)

Graph: 0−10-1, 1−21-2, 0−20-2, 1−31-3. Start DFS at 00. Visit 00: disc[0]=0, low[0]=0. Visit 11: disc[1]=1, low[1]=1. Visit 22: disc[2]=2, low[2]=2. Back edge 2−02-0: low[2]=min(2,0)=0. Backtrack to 11: low[1]=min(1,0)=0.

Visit 33: disc[3]=3, low[3]=3. Backtrack to 11: check low[3]=3 > disc[1]=1, so edge 1−31-3 is a bridge. Final bridges: {1−3}\{1-3\}. All other edges are part of the cycle 0−1−2−00-1-2-0.