Find a link between Actor A and Kevin Bacon
inspired from following site and paper
The db and script uses a breadth-first search (BFS) to find the shortest path between pairs of actors
The link can be find using python cli or site
For python run queries.py
with actor name which returns a list of actors and movies forming the link.
python3 queries.py <Actor Name>
python3 queries.py Robert Downey Jr.
[{'type': 'actor', 'name': 'Robert Downey Jr.', 'year': 1965, 'id': 'p375'}, {'type': 'movie', 'name': 'Iron Man 2', 'year': 2010, 'id': 'mv1228705'}, {'type': 'actor', 'name': 'Mickey Rourke', 'year': 1952, 'id': 'p620'}, {'type': 'movie', 'name': 'Diner', 'year': 1982, 'id': 'mv83833'}, {'type': 'actor', 'name': 'Kevin Bacon', 'year': 1958, 'id': 'p102'}]
You could also simply open index.html on your browser while running the flask server and type the actor name to get path.
- clone the repository
- download movies.db from imdb
- run universal.py and edges.py to represent a graph
- install flask