
最小生成树
饮酒在风里
这个作者很懒,什么都没留下…
展开
-
HDU 4081 Qin Shi Huang's National Road System (次小生成树)prim
During the Warring States Period of ancient China(476 BC to 221 BC), there were seven kingdoms in China ---- they were Qi, Chu, Yan, Han, Zhao, Wei and Qin. Ying Zheng was the king of the kingdom Qin....原创 2019-07-07 20:58:06 · 286 阅读 · 0 评论 -
最小生成树两大常用模板
稠密图: PRIM给定一个n个点m条边的无向图,图中可能存在重边和自环,边权可能为负数。求最小生成树的树边权重之和,如果最小生成树不存在则输出impossible。给定一张边带权的无向图G=(V, E),其中V表示图中点的集合,E表示图中边的集合,n=|V|,m=|E|。由V中的全部n个顶点和E中n-1条边构成的无向连通子图被称为G的一棵生成树,其中边的权值之和最小的生成树被称为无...原创 2019-09-27 18:09:24 · 541 阅读 · 0 评论