Can one relationship be prioritized over another in Memgraph?

50 Views Asked by At

I'm looking to solve a problem that I have with finding the right ways to do something in Memgraph. I use mappings like "Route 66", "Route 55", etc., for supply chain logistics. My graph model includes cities as nodes and roads as edges. I often have multiple routes between cities, but I aim to use a single route as much as possible for efficiency, even if other routes might be slightly shorter.

City1--Route66--City2--Route66--City3--Route66--City4
City4--Route77--City5--Route77--City6--Route77--City7
City7--Route88--City8--Route88--City9--Route88--City10
City10--Route55--City1--Route55--City2--Route55--City3

How can I make Memgraph prioritize the continuity of a single road, like staying on "Route 66" for as long as possible, over switching to shorter but multiple different routes? I've looked into basic shortest path algorithms, but they seem to prioritize distance or time, not the continuity of a specific road route. How can I adjust my graph query or algorithm in Memgraph to prioritize using a single road route for as long as possible, even with slightly shorter alternatives involving multiple routes?

0

There are 0 best solutions below