随笔分类 -  强连通分量

 
HDU 4635
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4635问:最多加多少条边,使得原图不是强连通图正向考虑有困难,不妨反向思考,既最少去掉几条边使得原图不是强连通。总边数sum=n*(n-1)时肯定是强连通,已经给了m条边,sum-=m这时把已经强连通的部分进行缩点... 阅读全文
posted @ 2014-05-13 23:30 LegendaryAC 阅读(777) 评论(0) 推荐(0)
tarjan
摘要:求强连通分量个数View Code void tarjan(int u){ dfn[u]=low[u]=++idx ; vis[u]=1 ; st[++tp]=u ; int v ; for(int i=head[u];i;i=e[i].next) { ... 阅读全文
posted @ 2012-09-12 19:28 LegendaryAC 阅读(180) 评论(0) 推荐(0)