A Route must select a connected component in the graph: all Switches that belong to Switch positions followed by the route must be reachable from each other.
MATCH
(route:Route)-[:follows]->(swP1:SwitchPosition)-[:target]->(sw1:Switch),
(route)-[:follows]->(swP2:SwitchPosition)-[:target]->(sw2:Switch)
WHERE NOT (sw1)-[:connectsTo*]-(sw2)
RETURN route, swP1, sw1, swP2, sw2
A Route must select a connected component in the graph: all Switches that belong to Switch positions followed by the route must be reachable from each other.
101