As the picture below shows we have nodes with relations but with different properties. how can I find shortest path between node A and node E with condition that relations in the path should have common property? for example here it only should give THE PATH with property "a" from node A to node B because a here is common.
Edit I want to find shortest path between node a and e based on available relations between a and next node (here relation properties are a, b and c) how can I find shortest path between a and e in which relations property is same(here property a) for example it should return only the path with property a (and the path would be a>b>d>e)
I found the answer and the answer was:
Match (a:node)-[r1]->()
with collect(r1.property) as m
MATCH p=shortestPath( (a:node)-[:r1*]->(e:node) )
AND ALL(x in relationships(p) WHERE x.propery in m)
RETURN p