板子:
luogu3388割点
#include <cstdio>
#include <cstring>
#include <iostream>
#define N 100005
using namespace std;
struct hh{
int x,y;}bri[N];
int tot,point[N],nxt[N*2],v[N*2],nn,dfn[N],low[N],cnt,num;
bool vis[N],iscut[N];
void addline(int x,int y)
{
++tot; nxt[tot]=point[x]; point[x]=tot; v[tot]=y;
++tot; nxt[tot]=point[y]; point[y]=tot; v[tot]=x;
}
void tarjan(int now,int fa)
{
dfn[now]=low[now]=++nn;
int size=0;
for (int i=point[now];i;i=nxt[i])

本文介绍了图论中的割点与桥概念,包括割点的定义(去掉该节点后子图不连通)和桥的定义(去掉该边后子图不连通)。并提供了luogu3388割点和POJ3177桥的题目作为实践案例。还讲解了如何判断割点(考虑树根特殊情况和low[v]>=dfn[u]条件)以及桥(dfn(u) < low(v)条件)。最后提到了双连通分量的概念,即无割点无桥的图。
最低0.47元/天 解锁文章
2273

被折叠的 条评论
为什么被折叠?



