求无向图中的割边(桥)
1 inline void tarjan(int x,int edge) { 2 int v; 3 dfn[x] = low[x] = ++tot; 4 for(int i = head[x];i != -1; i = e[i].next) { 5 v = e[i].to; 6 if(!dfn[v]) { 7 tarjan(v,i); 8 low[x] = min(low[x],low[v]); 9 if(low[v] > dfn[x]) 10 bridge[i] = bridge[i^1] = true; 11 } 12 else if(i != edge) 13 low[x] = min(low[x],dfn[v]); 14 } 15 }