Hi,
Please I need a query/procedure that returns all possible routes between two nodes "those are not mandatory to be directly interconnected" in a meshy telecommunications network. The relationship is called an OTS and the order of routes should be based on the Distance/Sum Of Distance of OTS(s). I tried several queries, but they take too much time as far as the network is becoming bigger.
ex.
query = (f"""MATCH (from{{nodeName:"{srcNode}"}}),(to{{nodeName:"{dstNode}"}}),path=(from)-[:ots*1..{hops}]-(to)
WHERE NONE (n IN nodes(path) WHERE size([x IN nodes(path) WHERE n = x]) > 1 )
AND NOT NONE (n IN nodes(path) WHERE n.nodeName IN {includes})
AND NONE (n IN nodes(path) WHERE n.nodeName IN {excludes})
RETURN DISTINCT path AS shortestPath,
reduce(distance = 0, r in relationships(path) | distance + toInteger(r.distance)) AS totalDistance
ORDER BY totalDistance ASC LIMIT {limit}""")