Page 292 Exercise 14
Listing the bridges, rather than the biconnected components of a graph, is a much easier programming task. We no longer need a stack to hold all of the connected components. We simply change bicon() to print out only those edges whose low value is greater than their dfn value. The code appears below:
void bridges(int u, int v)
{/* Find the bridges */
node_pointer ptr;
int w,x,y;
dfn[u] = low[u] = num++;
for (ptr = graph[u]; ptr; ptr = ptr->link) {
w = ptr->vertex;
if (dfn[w] < 0) {
/*if †the node has not been examined then call bridges with it*/
bridges(w,u);
low[u] = MIN2(low[u],low[w]);
if (low[w] > dfn[u])
/*if the low value of node w is greater than the depth
first search value of u, then |