How to use Neo4j for finding Minimum Spanning Tree?

核能气质少年 提交于 2020-01-14 03:42:06

问题


I am wondering how to use Neo4j to find the MST? Most examplesI found was using Hadoop to find it.


回答1:


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).

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.

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.

Let us know what you come up with!



来源:https://stackoverflow.com/questions/25609717/how-to-use-neo4j-for-finding-minimum-spanning-tree

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!