Im simulating a graph where the nodes are places and the edges indicate that you can move from one place to another.
This should be all the routes that you can take from one place to another, and you can go from one place to another in different ways, so I need a query that returns me the shortest path with minimal changes to the route.
For example, I want to go from A to D, I have two possible ways:
(place {name: "A"})-[:FOLLOWS{route:""R1}]->(place{name: "B" })-[:FOLLOWS{route:""R4}]->(place{name:"C"})-[:FOLLOWS{route:""R2}]->(place{name:"D"}) (place {name: "A"})-[:FOLLOWS{route:""R1}]->(place{name: "B" })-[:FOLLOWS{route:""R1}]->(place{name:"F"})-[:FOLLOWS{route:""R2}]->(place{name:"D"})
In the previous two ways, both sizes are the same size, but I would like to get a second that has minimal route changes.
Thanks.
source share