You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A route's total length must be smaller than X (e.g. 100.000 m).
Given our current model, this is quite difficult to calculate.
MATCH
(route:Route)-[:follows]->(swP1:SwitchPosition)-[:target]->(sw1:Switch),
(route)-[:follows]->(swP2:SwitchPosition)-[:target]->(sw2:Switch)
WHERE sw1.id < sw2.id
MATCH p=(sw1)-[:connectsTo*]-(sw2)
WITH route, nodes(p) AS tes
// only the start and the end of the path are switches
WHERE size(filter(te IN tes WHERE NOT (te:Segment))) = 2
UNWIND tes AS te
RETURN route, sum(te.length) AS length
It seems it's quicker using shortestPath:
MATCH
(route:Route)-[:follows]->(swP1:SwitchPosition)-[:target]->(sw1:Switch),
(route)-[:follows]->(swP2:SwitchPosition)-[:target]->(sw2:Switch)
WHERE sw1.id < sw2.id
MATCH p=shortestPath((sw1)-[:connectsTo*]-(sw2))
WITH route, nodes(p) AS tes
// only the start and the end of the path are switches
WHERE size(filter(te IN tes WHERE NOT (te:Segment))) = 2
UNWIND tes AS te
RETURN route, sum(te.length) AS length
A route's total length must be smaller than X (e.g. 100.000 m).
Given our current model, this is quite difficult to calculate.
It seems it's quicker using
shortestPath
:#101
The text was updated successfully, but these errors were encountered: