The Movie Vizualization Graph project allows users to explore relationships between movies (from 2020 or earlier) based on shared actors. It implements two algorithms: Breadth-First Search (BFS) and Dijkstra's algorithm, to find paths between movies and analyze their connections.
- Find connections between movies: Use BFS to find a path from one movie to another based on shared actors.
- Shortest path calculation: Use Dijkstra's algorithm to find the shortest path between two movies, considering edge weights.
- Visualization: Visualize the graph and the paths between movies.
- Python 3.x
- Required libraries:
pandas
networkx
plotly
heapq
ast
json
- Clone the repository:
git clone https://github.com/c-schutz/DSAProject3.git cd movie-graph
- Install Required Libraries:
pip install pandas networkx plotly
- Prepare the Data Files:
Make sure that bothmovies_metadata.csv
andcredits.csv
are in the repo
If you encounter issues, your package versions may be incorrect.
Make sure that they match what we used below (in white).
- Run the script:
Executeapp.py
to start the applicationpython app.py
- Open the website:
After a few minutes(if running for the first time) a website link will appear.
Looks something like thishttp://127.0.0.1:5000
. Click it. - Use the website:
Once the website loads your website should look something like this: - Different features:
-Graph Visaulization:
To use theGraph Visualization
type in a movie next toEnter Movie Title
You can then choose the number of connections that the graph will show (starting is 15), but can go as high as you like.
Then clickVisualize
and watch the magic happen
-Breadth-First Search:
To useBreadth-First Search
go toChoose a Feature
in the top left and selectBreadth-First Serach
Enter the start movie title and target movie title and then clickFind Kevin Bacon Number
and watch the magic happen
-Dijkstra Search:
To useDijkstra Search
go toChoose a Feature
in the top left and selectDijkstra Search
Enter the start movie title and target movie title and then clickFind Kevin Bacon Number
and as always watch the magic happen
-Add Second Movie:
If you would like to see two movies and all the connections at a certain distance click theAdd Second Movie
button
Then Enter both Movie Title and Second Movie Title. To change the distance that the BFS will look to connect Movies increase or decreaseMax Distance
Finally clickVisualize Two Movies
and watch the magic happen. If the Movies do not share a movie connection this will not work however
-Add more data:
If you would like to see some different movie data such asDate Released
orRevenue
click on the big button in the top middle titledChoose one or more options
Choose as few or as many of the different options as you would like. Then choose the method you would like to look at the movies from and as always watch the magic happen