如何使用Neo4j查找最小生成树? [英] How to use Neo4j for finding Minimum Spanning Tree?

查看:312
本文介绍了如何使用Neo4j查找最小生成树?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用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查找最小生成树?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆