Intro

A bland story, but Friday night I was browsing Reddit looking for ideas for BrickHack when I found a post about the Kevin Bacon separation degree so we decided to do that. You input the two stars who you want the relationship between and it will find out how they are related

Tools used

Python and TMDb database. We tried to make a web app out of it so you could enter the info online but weren't able to figure it out.

Problems

TMDb database only allows 40 requests per 10 seconds which became a problem if the two stars were directly related. The second hardest part was implementing the search algorithm, which is basically just a heavily modified breadth-first search. The hardest part was trying to make it a web app. Neither of us had any web experience besides some HTML and CSS so making an interactive webpage was incredibly challenging. So challenging in fact we weren't able to do it at all. It's super late right now so web dev is another thing for me to learn in the future.

Solutions

Not sure how proud of it we are but to solve the problem of too many API requests we made another account and got 2 API keys and just switch them out. The problem then is sometimes we still make too many requests. To solve that we literally had to slow the program down so it wouldn't search too fast. We had to call time.sleep() multiple times for the program to pace itself. This can cause the search to be pretty slow, but its better than not working at all. The search algorithm is also pretty cool. How it basically works is we have a list of movies with Kevin Bacon in them, and we check if the chosen actor/actress has any movies in common. If they don't we take their top 5 movies and get the top 5 cast members for each movie, and then find if they have any movies in common with the target. If they don't we repeat that process again until we find the connection. It's basically a modified breadth-first search.

What we learned

Web dev is hard and spend more time thinking about ideas

What's next for The Bacon Connection

Maybe getting the web app to work

Built With

Share this project:

Updates