I am trying to obtain the node and edge ids for the shortest path between two nodes in my neo4j graph database.
If I do not specify which nodes I want, the code runs somehow and returns a path:
import py2neo
graph.run("MATCH (start:Point)-[:SOURCE_POINT]->(r:Road)-[:TARGET_POINT]->(end:Point) \
CALL apoc.algo.dijkstraWithDefaultWeight(start, end, 'Road', 'length', 10.0) \
YIELD path as path, weight as weight \
UNWIND nodes(path) as n \
RETURN DISTINCT { id : id(n), labels : labels(n), data: n} as node").to_table()
But when I run the same code and specify which nodes I want, it returns empty:
graph.run("MATCH (start:Point {id: '4984061949'})-[:SOURCE_POINT]->(r:Road)-[:TARGET_POINT]->(end:Point {id: '4984061963'}) \
...
If I simply try to match those node id's, it returns them ok - so I know they are in the db.
I'm thinking it could be because my 'cost' is a string. But I'm not sure how to cast it to float before it goes through the dijkstraWithDefaultWeight function.