Head's Up! Site maintenance this Wednesday, February 1. Disruptions expected as we migrate the forums.
β11-28-2018 07:13 AM
Facing Problem in Finding K-shortest path in neo4j among 2M+ nodes,2M+ relationships, I have indexed data on node id and name.
Query :
MATCH p = (s:Test)-[:to*1..5]->(e:Test) WHERE s.name = 'ABC' RETURN *, relationships(p),sum(reduce(sum=0,x in relationships(p) |sum+x.count)) as tt ORDER BY tt desc limit 4
Tried to find top-4 paths based on cost with at max 5 level and starting node is given.
This query is taking too much time.is there any other better way to achieve this ?
β12-08-2018 10:38 AM
Try Return to be a path, not use *.
β12-08-2018 01:26 PM
You may want to try using K-shortest paths from the graph algorithms library.
β08-07-2019 01:20 AM
@andrew.bowman I am using Yen's K-shortest paths algorithm. I want to get the relationship id's involved in the connection between the two nodes as well how should I do it.
All the sessions of the conference are now available online