Hi I am experimenting with routing using neo4j but I am struggling with adapting apoc.algo.dijkstra. I don’t just want to go from A to B, but actually go from A to B via C, whilst taking into account a weighting on the link.
The A-B query is...
MATCH (startNode:road_node {id:'59030214550942348742a27d'}), (endNode:road_node {id:'59030215550942348742a610'})
call apoc.algo.dijkstra(startNode, endNode, 'ROADLINK', 'min_travel_time') YIELD path, weight
return path, weight/60
I tried a few ways of including a via c but can't get it to work... for example
MATCH (startNode:road_node {id:'59030214550942348742a27d'}), (endNode:road_node {id:'59030215550942348742a610'})
call apoc.algo.dijkstra(startNode, endNode, 'ROADLINK', 'min_travel_time')
with path, weight
MATCH (startNode)-[*]-(via:road_node {id:'59030215550942348742a666'})-[*]-(endNode)
return path, weight
Any ideas or suggestions on how to route from A to B via C, whilst taking into a count a weighting on the links, would be very helpful.