Not with cypher currently. Then check out this: http://docs.neo4j.org/chunked/stable/rest-api-graph-algos.html#rest-api-execute-a-dijkstra-algorithm-and-get-a-single-path With a weight property as cost property.
If you're running in the JVM you can also use GraphAlgoFactory directly. Cheers Michael On Sat, Jan 25, 2014 at 3:43 PM, Shantaram Waingankar < [email protected]> wrote: > I need to find the shortest path between two nodes, but instead of > shortest path in terms of no of hops, i want it in terms of sum of a > property on the relationship. > > Sample > assume i have cities A,B,C > if a route exists between 2 cities, a relationship is created and the > distance between the two is stored as a property distance on the > relationship > > A-B distance is 100miles > A-C is 20miles, C-B is 20miles > > Using shortestPath in cypher gives me A-B as the shortest path, > but logically i want A-C-B since if we total distances A-B is 100 > and A-C is 20+20=40 > > Is there anyway to do this with cypher ? > > > -- > Thanks & Regards, > > Shantaram Waingankar > > Mumbai, India > Cell +91 9969035764 > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
