CSA Beta Round Cycle Tree

题目

A cycle tree is a connected undirected graph that respects one of the following:
It’s an elementary cycle of length greater than or equal to 3.
It’s a graph resulted by attaching an elementary cycle to another cycle tree. Attaching a cycle means choosing two edges, one from the cycle and the other one from the cycle tree, and merging them and their incident nodes:
这里写图片描述
You are give a cycle tree, compute its maximum independent set.
1<=n<=50000,1<=m<=100000

解法

找到一个度数为2的点,然后删掉它以及相连的两条边,并在它的两个邻居之间连一条虚边(如果不存在实边),接着重复以上过程直到最后只剩下一条边
删掉一个点的时候,我们称它相连的两条边是它邻居之间的那条边的子边
那么边的关系就变成了一棵树
然后就可以DP了,设f[edge][flag1][flag2]表示对于一条边(可能是虚边也可能是实边)表示左边点和右边点分别选不选的最大独立集大小
转移的时候就只用考虑三个点的关系就好了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值