澳洲国立大学作业题,大牛们给点意见啊

szp895 2013-10-15 06:55:59
替朋友发的,关于Kruskal算法题目,各位大大们,能否给点意见,不需要能把代码写出来(当然能给出感激不尽,嘿嘿)能给个思路或者伪代码也行,谢谢了!题目和翻译如下:
A complete graph is an undirected graph with an edge between each pair of vertices.
A randomly weighted complete graph is a complete graph in which each edge is assigned a weight which is a random real number uniformly distributed between 0 and 1. Let L(n) be the expected (average) weight sum of the edges in a minimum spanning tree of a randomly weighted complete graph with n vertices.

Your tasks are to (i) estimate L(n) and the running time of Kruskal's algorithm (22 points) when n = 10; 100; 150; 200; (ii) Observe the changing trend of the value of L(n) with the growth of n. Justify why this happens (3 points).

More precisely, write code using one language such as C, C++, Java, or Python program that does this: For each size of n = 10; 100; 150; 200, generate 50 randomly weighted complete graphs with n vertices and determine the weighted sum of the edges in the minimum spanning trees of the graphs as well as the running times of Kruskal's algorithm (the graph generation time will not be taken into account). Print (i) the average of the weighted sum of the 50 MSTs and the average running time of Kruskal's algorithm for nding the 50 weights; (ii) Explain the changing trend of the value of L(n) with the growth of n.

Your program should have the following properties.
1. Do not read any input, Write one line of output for each n, and at most 5 extra lines of explanatory output.
2. Store the graph as a symmetric matrix containing the edge weights.
3. Implement Kruskal's algorithm, using subroutines of Quick Sort and Directed Forest for disjoint sets, you need to implement both of these two subroutines, rather than calling them from the program language library.


随机加权完全图的是一个完整的图,其中每个边缘分配重量是0和1之间的均匀分布的随机实数。
设L(n)为最小生成树里顶点总和的权重,n为边的数量。

任务是
1. 用C,C++,JAVA或者Python编写,估算下当n=10,100,150,200的时候生成50个随机加权完成图,估算下最小生成树在Kruskal算法的运行时间。
2. 观察随着n的变化,L(n)的变化趋势。并证明原因。

你的程序需要满足下面几点要求。
1. 为每一个n写一行单独的输出,和最多5行的解释。
2. 把这个图保存为对称矩阵,包括所有顶点权重。
3. 使用快速排序和Direct Forest的子程序实现Kruskal算法,不能直接调用库里的方法。


再一次感谢了!
...全文
234 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
kosora曹 2013-10-16
  • 打赏
  • 举报
回复
同一楼,Kruscal说到底就是一个并查集,国外称为Union/Find。
teemai 2013-10-15
  • 打赏
  • 举报
回复
建议发到【数据结构与算法】版去。 CSDN > CSDN论坛 > 高性能开发 > 数据结构与算法
内容概要:本文研究了一种应用于太阳能发电系统的多级逆变器,旨在通过采用正弦脉宽调制(SPWM)技术有效降低输出电压的总谐波失真(THD),从而提升电能质量。研究基于Simulink平台构建了完整的仿真模型,系统地实现了SPWM信号生成、驱动逻辑控制以及多电平输出波形合成等关键环节,验证了该多级逆变器在不同运行工况下具备优异的动态响应能力和稳定性。仿真结果表明,所设计的逆变器能够输出接近理想正弦波的电压波形,显著抑制高次谐波,满足可再生能源并网对电能质量的严苛要求,体现出多级逆变拓扑在光伏发电系统中的技术先进性与工程应用价值。; 适合人群:电气工程、自动化、新能源科学与工程及相关专业的本科生、研究生,以及从事光伏逆变器设计、电力电子变换技术和可再生能源并网系统研发的工程技术人员。; 使用场景及目标:①深入理解多级逆变器的工作原理及其在太阳能发电系统中的关键作用;②掌握SPWM调制技术的理论基础与实现方法,并分析其对改善THD的核心机制;③借助Simulink仿真平台开展电力电子电路的建模、参数调试与性能评估,服务于课程设计、毕业设计、科研课题或实际工程项目开发。; 阅读建议:建议读者结合提供的Simulink仿真模型进行同步操作与验证,细致调整调制比、载波频率等关键参数,观察其对输出波形和THD指标的影响,以深化对系统动态特性的理解,并尝试优化控制策略以进一步提升系统性能。

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧