So, I'm trying to implement a program that calculates the degree of separation between 2 actors, for example if they both starred in the same movie then the degree of separation between them is 1. The problem is not how to calculate the degree of separation as I was able to demonstrate it, my problem is now I'm required to show all different shortest paths between these 2 actors, so if they starred in movie 0, movie 1, movie 7 together then the path should be movie 0 or movie 1 or movie 7. The problem is when I implemented my class I implemented it as an adjacency list (i.e ActorA : its neighbors ActorB, ActorC, ActorD) so when I implemented it I didn't include the movies. So, I did some research and I stumbled upon the concept of Bipartite Graphs but my question is how to represent it as an adjacency list? like from I gathered is that I'm supposed to make vertices for the actors and vertices for the movies so does that mean it's represented as this?
ActorA : Movie0, Movie1, Movie7
Movie0 : ActorA, ActorB , ActorC
ActorB : Movie0, Movie1, Movie2
.... etc