我想知道如何使用Neo4j查找MST?我发现的大多数示例都是使用Hadoop进行查找的.
I am wondering how to use Neo4j to find the MST? Most examplesI found was using Hadoop to find it.
推荐答案考虑到当前算法是如何确定MST的,我认为在Cypher中这是不可能的(如果我错了,我很乐意知道).
I don't think that this is possible in Cypher, given how current algorithms determine an MST (if I'm wrong on this, I'd love to know).
相反,我建议您实施一种用于确定MST的算法,例如普里姆算法.这很简单,并且在堆和邻接表的帮助下,性能相对较高.
Instead, I'd recommend implementing one of the algorithms used for determining an MST, e.g. Prim's Algorithm. It's quite straight forward and, with the help of heaps and adjacency lists, is relatively performant.
快速搜索该算法将打开许多链接.
A quick search for the algorithm will turn up many links.
我敢肯定,利用Neo4j的Core API或Traversal API甚至可以帮助事情进行更紧密的集成,而无需先将整个图形表示为邻接表.当然,您可以在嵌入式模式下使用Neo4j进行操作,或者在服务器模式下运行Neo4j时将其转换为服务器插件.
I'm sure leveraging Neo4j's Core API or Traversal API might even help things integrate even more closely, possibly without needing to represent the entire graph as an adjacency list first. And of course you can do that with Neo4j in Embedded Mode or turn it into a Server Plugin in case you're running Neo4j in Server Mode.
让我们知道您的想法!
更多推荐
如何使用Neo4j查找最小生成树?
发布评论