图论-最小生成树
文章平均质量分 52
szjezoimzy
这个作者很懒,什么都没留下…
展开
-
最小生成树--prim算法(poj 2485)
2016.12.28prim算法是求解最小生成树的一种算法,基本思路是贪心。从已知集合出发(初始已知集合是1个点),每次查找所能到达的点的最短路径,将与这条路径连接的点加入已知集合,同时更新所能到达的点的最短路径。【题目简述】 The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public原创 2016-12-28 19:11:09 · 237 阅读 · 0 评论 -
POJ 1789 Truck History
2016.12.28【题目描述】 Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing原创 2016-12-28 19:56:47 · 236 阅读 · 0 评论 -
POJ 3026 Borg Maze
2016.12.29【题目描述】 The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Bor原创 2016-12-29 23:35:10 · 256 阅读 · 0 评论 -
最小生成树--kruskal算法
2016.12.30算法思想: 先将边按照权值排序,从权值最小的边开始枚举,如果当前边连接的两个点不属于同一集合,就将这两个点连起来(用到的数据结构是并查集) 一直到枚举完所有的边,此时生成的就是最小生成树#include <iostream> #include <stdio.h> #include <algorithm> #include <string.h>using nam原创 2016-12-30 15:01:06 · 201 阅读 · 0 评论 -
POJ 2349 Arctic Network
2016.12.30【题目简述】 The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the原创 2016-12-30 20:17:41 · 239 阅读 · 0 评论