简体   繁体   English

使用欧氏距离实现 Prim 算法

[英]Implementing Prim's algorithm with eucledian distance

Let me straight forward put what i need.让我直接提出我需要的东西。 I have an array(first representing node and second representing some value): [[1,10],[2,8],[3,9]] .我有一个数组(第一个代表节点,第二个代表某个值): [[1,10],[2,8],[3,9]] I made another array of euclidean distance between the nodes as follows:我在节点之间制作了另一个欧氏距离数组,如下所示:

[[0,2,1],[2,0,1],[1,1,0]]

Now I need to implement prim's algorithm for the nodes using the euclidean matrix as the weight of edges.现在我需要使用欧几里德矩阵作为边的权重为节点实现 prim 算法。 Please help me.请帮我。

If you haven't written any line of code yet, you might as well be considering what a Google search would yield for "python prim algorithm":如果您还没有编写任何代码行,您不妨考虑一下 Google 搜索会为“python prim algorithm”产生什么结果:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM