随笔分类 -  连通图

HDU 4738 Caocao's Bridges (2013杭州网络赛1001题,连通图,求桥)
摘要:Caocao's BridgesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 194Accepted Submission(s): 89Problem DescriptionCaocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not 阅读全文

posted @ 2013-09-15 22:38 kuangbin 阅读(3188) 评论(1) 推荐(0)

HDU 4685 Prince and Princess (2013多校8 1010题 二分匹配+强连通)
摘要:Prince and PrincessTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 150Accepted Submission(s): 46Problem DescriptionThere are n princes and m princesses. Princess can marry any prince. But prince can only marry the princess they DO love.For all prin 阅读全文

posted @ 2013-08-16 00:08 kuangbin 阅读(1644) 评论(0) 推荐(0)

HDU 4635 Strongly connected (2013多校4 1004 有向图的强连通分量)
摘要:Strongly connectedTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 53Accepted Submission(s): 15Problem DescriptionGive a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is sti 阅读全文

posted @ 2013-08-01 17:56 kuangbin 阅读(986) 评论(0) 推荐(0)

HDU 4612 Warm up(2013多校2 1002 双连通分量)
摘要:Warm upTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 90Accepted Submission(s): 12Problem Description N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel between any two planet 阅读全文

posted @ 2013-07-25 17:59 kuangbin 阅读(1785) 评论(0) 推荐(0)

2013 ACM/ICPC南京邀请赛B题(求割点扩展)
摘要:题目链接:http://icpc.njust.edu.cn/Contest/194/Problem/BB - TWO NODES时间限制:10000 MS内存限制:65535 KB问题描述Suppose that G is an undirected graph, and the value of stab is defined as follows:Among the expression, G-i,-jis the remainder after removing node i, node j and all edges that are directly relevant to the 阅读全文

posted @ 2013-07-12 22:44 kuangbin 阅读(875) 评论(0) 推荐(0)

POJ 3177 Redundant Paths POJ 3352 Road Construction
摘要:这两题是一样的,代码完全一样。就是给了一个连通图,问加多少条边可以变成边双连通。去掉桥,其余的连通分支就是边双连通分支了。一个有桥的连通图要变成边双连通图的话,把双连通子图收缩为一个点,形成一颗树。需要加的边为(leaf+1)/2 (leaf为叶子结点个数)POJ 3177 给定一个连通的无向图G,至少要添加几条边,才能使其变为双连通图。参考:http://blog.csdn.net/lyy289065406/article/details/6762432http://www.cnblogs.com/kuangbin/p/3184889.html#include #include #inclu 阅读全文

posted @ 2013-07-11 19:13 kuangbin 阅读(537) 评论(0) 推荐(0)

【转】图的割点、桥与双连通分支
摘要:原文地址:https://www.byvoid.com/blog/biconnect图的割点、桥与双连通分支[点连通度与边连通度]在一个无向连通图中,如果有一个顶点集合,删除这个顶点集合,以及这个集合中所有顶点相关联的边以后,原图变成多个连通块,就称这个点集为割点集合。一个图的点连通度的定义为,最小割点集合中的顶点数。类似的,如果有一个边集合,删除这个边集合以后,原图变成多个连通块,就称这个点集为割边集合。一个图的边连通度的定义为,最小割边集合中的边数。[双连通图、割点与桥]如果一个无向连通图的点连通度大于1,则称该图是点双连通的(point biconnected),简称双连通或重连通。一个 阅读全文

posted @ 2013-07-11 19:12 kuangbin 阅读(1423) 评论(0) 推荐(0)

POJ 3694 Network (求桥,边双连通分支缩点,lca)
摘要:NetworkTime Limit:5000MSMemory Limit:65536KTotal Submissions:5619Accepted:1939DescriptionA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive links, so dat 阅读全文

posted @ 2013-07-11 19:06 kuangbin 阅读(1559) 评论(0) 推荐(0)

UVA 796 - Critical Links (求桥)
摘要:Critical LinksIn a computer network a link L, which interconnects two servers, is considered critical if there are at least two servers A and B such that all network interconnection paths between A and B pass through L. Removing a critical link generates two disjoint sub-networks such that any two s 阅读全文

posted @ 2013-07-11 15:42 kuangbin 阅读(1518) 评论(0) 推荐(0)

UVA 315 315 - Network(求割点个数)
摘要:NetworkA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 toN. No two places have the same number. The lines are bidirectional and always connect together two places and in each place the lines end in a telepho 阅读全文

posted @ 2013-07-11 15:40 kuangbin 阅读(2378) 评论(0) 推荐(0)

POJ 1236 Network of Schools (有向图的强连通分量)
摘要:Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9073Accepted:3594DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc 阅读全文

posted @ 2013-07-10 18:07 kuangbin 阅读(1822) 评论(0) 推荐(0)

【转】有向图强连通分量的Tarjan算法
摘要:原文地址:https://www.byvoid.com/blog/scc-tarjan/[有向图强连通分量]在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通,称G是一个强连通图。非强连通图有向图的极大强连通子图,称为强连通分量(strongly connected components)。下图中,子图{1,2,3,4}为一个强连通分量,因为顶点1,2,3,4两两可达。{5},{6}也分别是两个强连通分量。直接根据定义,用双向遍历取交集的方法求强连通分量,时间复杂度为O(N^2+M)。更好的方法是Kosara 阅读全文

posted @ 2013-07-07 16:07 kuangbin 阅读(2735) 评论(0) 推荐(1)

导航

JAVASCRIPT: