You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Bridges": "An edge in an undirected connected graph is a bridge iff removing it disconnects the graph. A naive solution to finding bridges in a graph is to:<br />1.Delete an edge E<br />2.Perform DFS Exploration to check if the Graph is still connected<br />3.Restore Edge E. E is a bridge only if DFS exploration determines that the graph is disconnected without E",
2
+
"Bridges": "An edge in an undirected connected graph is a bridge iff removing it disconnects the graph. A naive solution to finding bridges in a graph is to:<br />1.Delete an edge E<br />2.Perform DFS Exploration to check if the Graph is still connected<br />3.Restore Edge E. E is a bridge only if DFS exploration determines that the graph is disconnected without E. An efficient solution also exists, which uses the idea that edge U-V (U is parent) is a bridge if no subtree rooted at V has a back edge to U or one of its ancestors.",
3
3
"Applications": [
4
4
"Finding vulnerabilities in Graphs and Electrical Circuits"
logger._print('NOTE: call to util () follows pattern: util (nodeToVisit, visited, disc, low, parent). See code for clarity');
84
+
logger._print('');
85
+
86
+
logger._print('Starting the main for loop (for each node)');
87
+
for(varv=0;v<graph.length;v++){
88
+
if(!visited[v]){
89
+
logger._print(v+' has not been visited yet. Calling util ('+v+', ['+visited+'], ['+disc+'], ['+low+'], ['+parent+']) from the for loop');
90
+
util(v,visited,disc,low,parent);
91
+
logger._print('Returned in for loop after util ('+v+', ['+visited+'], ['+disc+'], ['+low+'], ['+parent+'])');
92
+
}
93
+
}
94
+
})(G);
95
+
96
+
logger._print('There are '+bridges.length+' bridges in the Graph');
97
+
for(vari=0;i<bridges.length;i++){
98
+
logger._print(bridges[i][0]+'-->'+bridges[i][1]);
99
+
}
100
+
logger._print('NOTE: All bridges are both ways (just like in the Naive Algorithm) because the Graph is undirected. So, edge A->B and B->A, both are bridges');
0 commit comments