最小生成树

所属分类:数据结构
开发工具:C/C++
文件大小:232KB
下载次数:1
上传日期:2020-12-25 15:03:41
上 传 者Layman俗人
说明:  问题描述:给定一个地区的n个城市间的距离网,用Prim算法或Kruskal算法建立最小生成树,并计算得到的最小生成树的代价。 基本要求: 1、城市间的距离网采用邻接矩阵表示,邻接矩阵的存储结构定义采用课本中给出的定义,若两个城市之间不存在道路,则将相应边的权值设为自己定义的无穷大值。要求在屏幕上显示得到的最小生成树中包括了哪些城市间的道路,并显示得到的最小生成树的代价。 2、表示城市间距离网的邻接矩阵(要求至少6个城市,10条边) 3、最小生成树中包括的边及其权值,并显示得到的最小生成树的代价。
(Problem Description: given the distance network between n cities in a region, the minimum spanning tree is established by prim algorithm or Kruskal algorithm, and the cost of the minimum spanning tree is calculated. Basic requirements: 1. The distance network between cities is represented by adjacency matrix, and the definition of adjacency matrix storage structure is given in the textbook. If there is no road between two cities, the weight of the corresponding edge is set to its own infinite value. It is required to display the roads between cities in the minimum spanning tree and the cost of the minimum spanning tree. 2. Adjacency matrix representing distance network between cities (at least 6 cities and 10 edges are required) 3. The minimum spanning tree includes the edges and their weights, and shows the cost of the minimum spanning tree.)

文件列表:
软件B192李辰朝 201907044208最小生成树.docx (240832, 2020-06-21)

近期下载者

相关文件


收藏者