![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最小生成树
h2017010687
这个作者很懒,什么都没留下…
展开
-
最小生成树 MST
1) prim算法 对点进行贪心操作。(适合稠密图) const int M =1005; int vis[M]; //表示该i点是否被选择 vis[i]=0 还未被选择 int map[M][M]; //map[i][j] 表示i到j的距离 int dis[M]; // 1到i的距离和 void prim(){ memset(vis,0,sizeof(vis)) ; for(...原创 2019-08-27 20:23:52 · 165 阅读 · 0 评论 -
Networking (kruskal算法)
Networking You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may conn...原创 2019-08-27 20:32:37 · 150 阅读 · 0 评论 -
Highways
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has already constructed a numb...原创 2019-08-27 20:37:35 · 100 阅读 · 0 评论 -
The Unique MST
Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of...原创 2019-08-27 20:38:54 · 103 阅读 · 0 评论