边割集

同点割集没有什么区别,明白了点割集,这个就好办了

 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 \n", cur, i);
19             }
20             else if (i != father)
21                 low[cur] = min(low[cur], num[i]);
22     }
23 }

 

相关文章:

  • 2021-08-02
  • 2021-09-06
  • 2022-01-13
  • 2021-07-16
  • 2021-12-14
  • 2021-06-30
猜你喜欢
  • 2021-07-28
  • 2021-10-31
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
相关资源
相似解决方案