![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论---最小生成树
文章平均质量分 91
yuanS7
编程菜鸟,求大神带飞
展开
-
次小生成树
1.先生成最小生成树,长度为MinLen,并求出点i到点j的最大边(Max[i][j]).2.再枚举每一条不在树上的边,将该边L[i][j]添加到树中,此时构成了一个环,然后删除该环上(除L[i][j]外)的最大权值边Max[i][j],生成了一颗新的树,len = MinLen + L[i][j] - Max[i][j] ,再算出所有新树中的最小len,即为次小生成树的最小len。例原创 2017-03-15 21:11:57 · 282 阅读 · 0 评论 -
poj1679—The Unique MST(次小生成树)
题目链接:传送门The Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31839 Accepted: 11504DescriptionGiven a connected undirected graph, tell i原创 2017-08-26 16:47:41 · 216 阅读 · 0 评论 -
csu1965—Message(斯坦纳树)
题目链接:传送门1965: MessageSubmit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 68 Solved: 7 DescriptionYou are a boss who has N employe原创 2017-07-24 09:11:57 · 332 阅读 · 0 评论 -
poj1655—Balancing Act(树的重心)
题目链接:传送门Balancing ActTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14208 Accepted: 6008DescriptionConsider a tree T with N (1 <= N <= 20,000)原创 2017-07-29 16:34:10 · 222 阅读 · 0 评论 -
hdu4607—Park Visit(树的直径)
题目链接:传送门Park VisitTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3743 Accepted Submission(s): 1679Problem DescriptionC原创 2017-07-29 17:09:41 · 185 阅读 · 0 评论 -
LA3887—Slim Span
题目链接: 传送门题目大意:给出一个n(2 <= n <= 100)个结点的无向图,找一颗苗条度(最大边减最小边)最小的生成树。图中不包含自环和重边。解题思路:枚举树上的最小边,从这条最小边开始构建MST,此时这棵树是以该边为最小边的苗条度最小的生成树。因为构建MST时会使最大边最小。代码:#include <iostream>#include <stack>...原创 2018-05-05 16:19:05 · 160 阅读 · 0 评论 -
csu2097—There is No Alternative (最小生成树)
题目链接:传送门DescriptionICPC (Isles of Coral Park City) consist of several beautiful islands.The citizens requested construction of bridges between islands to resolve inconveniences of using boats between ...原创 2018-05-07 11:44:09 · 264 阅读 · 0 评论