我有一个随机数据填充的数据库与社会关系,如个人->参加->大学,person1 ->朋友-> person2等。有4种类型的节点。我的数据库大约有3M个节点和1200万条边。
当我尝试使用REST API查询两个随机节点之间的路径时,我在大约3-4秒内得到了shortestPath算法的响应。但是,使用Dijkstra运行相同的查询永远不会返回。
我知道Dijkstra很贵,但我是不是做错了什么?
URL - http://localhost:7474/db/data/node/499052/paths
最短路径的有效载荷
{ "to": "http://localhost:7474/db/data/node/296431", "algorithm": "shortestPath", "max_depth":4 }dijkstra的有效载荷-
{ "to": "http://localhost:7474/db/data/node/296431", "cost_property": "weight", "algorithm": "dijkstra", "max_depth":4 }发布于 2015-06-18 01:39:17
不,你没有做错什么,不幸的是,shortestPath和dijkstra之间的性能差异是如此之大。如果你的权重都是1,那么我绝对推荐使用shortestPath。
https://stackoverflow.com/questions/30893733
复制相似问题