I have a model in Graph theory of Movies and Actors. The relation between the two is "requires". The graph is shown below. A and B are Movies. 1,2,3,4,5,6 are actors. Movie A requires 1,2,3,4 actors. Movie B requires 4,5,6 actors. We can see that 4 is shared among both movies.
Current Query:
MATCH (m :Movie) -[r :require]-> (a :actor)
RETURN m,r,a;
Current Output
Expected Output
I want to display something as below. Here actor 4 is shown once for each movie. Can someone help me fix this ?