neo4j-contrib / neo4j-graph-algorithms

Efficient Graph Algorithms for Neo4j
https://github.com/neo4j/graph-data-science/
GNU General Public License v3.0
770 stars 194 forks source link

BFS and SSSP in Neo4j #767

Open zhuang29 opened 5 years ago

zhuang29 commented 5 years ago

Is there an implemented BFS in graph algorithms?

What I want to do: For every vertex, determines the minimum number of hops required to reach the vertex from a given source vertex.

Now I am using the 2 SSSP algorithms as BFS by making weight=1.0 for all edges: algo.shortestPath.deltaStepping works but runs very slow. algo.shortestPaths is not working and returns "Infinity" for all distance.

Since my graphs are undirected graphs without weight or without negative weights, I use DIRECTION="BOTH" for the SSSP algorithms. Is is the reason that makes it runs slow? Do you have other available algorithms for BFS?