全部最小生成树的实现

编程入门 行业动态 更新时间:2024-10-27 00:34:06
本文介绍了全部最小生成树的实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在寻找一个实现(我使用 networkx 库),将发现所有的最小生成树( MST)无向加权图的。

I've been looking for an implementation (I'm using networkx library.) that will find all the minimum spanning trees (MST) of an undirected weighted graph.

我只能找到的实现Kruskal算法和Prim算法两者都将只返回一个MST。

I can only find implementations for Kruskal's Algorithm and Prim's Algorithm both of which will only return a single MST.

我已经看到了解决这一问题的文件(如重新presenting所有最小生成树与应用程序进行计数和代),但我的头往往通过冥思苦想如何将其转化为code好歹爆炸。

I've seen papers that address this problem (such as Representing all minimum spanning trees with applications to counting and generation) but my head tends to explode someway through trying to think how to translate it to code.

其实我一直没能找到任何语言的实现!

In fact i've not been able to find an implementation in any language!

推荐答案

Rubys给出了一个很好的一般的答案。但是,编写有效的code生成图的所有生成树是一个挑战,一个野兽。

Rubys gives a good general answer. But writing efficient code to generate all spanning trees of a graph is a beast of a challenge.

半路此页面,在2003年左右十二月,你会发现一个CWEB实现Knuth的算法查找给定图的所有生成树。

Half way down this page, at around Dec 2003, you'll find an CWEB implementation of Knuth's algorithm that finds all spanning trees of a given graph.

更多推荐

全部最小生成树的实现

本文发布于:2023-11-30 21:20:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1651500.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最小

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!