I created a map of city in Neo4j using OpenStreetMap and OpenAddresses data. I want to find the shortest path from one address to another. The problem is that, when I'm using function apoc.algo.aStarConfig,I'm getting a path without consideration about direction of a relationship.
MATCH (a:Address)-[:NEAREST_INTERSECTION]->(source:Intersection)
WHERE a.full_address CONTAINS "410 E 5TH AVE SAN MATEO, CA"
MATCH (poi:Address)-[:NEAREST_INTERSECTION]->(dest:Intersection)
WHERE poi.full_address CONTAINS "39 GRAND BLVD SAN MATEO, CA"
CALL apoc.algo.aStarConfig(source, dest, "ROAD_SEGMENT",
{pointPropName: "location", weight: "length"})
YIELD weight, path
RETURN *
So my question is if there is a possibility to find the shortest path from one path to another not consider upstream relathionships?
If you want to only find paths where the relationships are in one direction e.g. outbound, you can either prepend
<to the relationship type for inbound, or append>for outbound.To only follow outbound
ROAD_SEGMENTrelationships, your query would become: