同点割集没有什么区别,明白了点割集,这个就好办了
1 # include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 const int N = 100; 6 int num[N], flag[N], low[N], V, E, index = 0, e[N][N]; 7 8 void dfs(int cur, int father) { 9 index++; 10 num[cur] = index; 11 low[cur] = index; 12 for (int i = 1; i <= V; i++) { 13 if (e[cur][i] == 1) 14 if (num[i] == 0) { 15 dfs(i, cur); 16 low[cur] = min(low[cur], low[i]); 17 if (low[i] > low[cur]) 18 printf("%d - %d ", cur, i); 19 } 20 else if (i != father) 21 low[cur] = min(low[cur], num[i]); 22 } 23 }