A Python implementation of the Degrees of Separation problem using graph search algorithms. This project explores the shortest connection path between actors using Breadth-First Search (BFS) and A Search (A-Star Algorithm)*.
✅ Finds the shortest connection path between two actors.
✅ Implements BFS for simple shortest path searches.
✅ Implements A* for optimized pathfinding using heuristic estimation.
✅ Works with large actor-movie datasets.
- Clone the repository:
git clone https://github.com/Omm2005/degrees.git cd degrees - Install dependencies (if required):
pip install -r requirements.txt
Run the script and enter the names of two actors to find their degree of separation:
python degrees.pyEnter source actor: Tom Hanks
Enter target actor: Emma Watson
Tom Hanks → Saving Mr. Banks → Paul Giamatti
Paul Giamatti → The Nanny Diaries → Scarlett Johansson
Scarlett Johansson → The Island → Ewan McGregor
Ewan McGregor → Beauty and the Beast → Emma Watson
Degrees of separation: 3
If you want to contribute:
- Fork the repository.
- Create a new branch (
feature-branch). - Commit your changes.
- Submit a Pull Request (PR).
All contributions are welcome, from bug fixes to performance improvements.
For Explanation, go to https://github.com/Omm2005/degrees/blob/main/explanation.md
This project is licensed under the MIT License.
- CS50 AI: Inspiration for the project structure.
- Graph Theory & Pathfinding Algorithms: Core concepts used in implementation.
- IMDb Dataset: Source of actor-movie relationships.