# 6Degrees

## Team Members
- Jorge Raad jar2356
- Casey Olsen ceo2132

## Introduction

Inspired by the popular game, “Six Degrees of Kevin Bacon,” our team plans to implement an algorithm that finds the minimum number of degrees (i.e. the shortest path) separating two actors, where actors who have appeared in the same movie are one degree apart from each other. The game claims that there is a maximum of six degrees of separation between any actor and Kevin Bacon, who has appeared in over 60 movies and co-starred with over 3,000 actors. We plan on implementing an algorithm that finds the minimum degrees of separation between any two actors, which would be a generalization of this game.

We are currently planning to use a dataset from IMDB consisting of movies and actors that appear in them, but we plan on making our code general so that we can substitute the dataset in the case that we run into issues. In this case, we could substitute the individuals (in this case actors) and the groups to which they belong (in this case movies), or we could be even more general and have no distinction between these two entities (e.g. for movies vs. actors, you can imagine the sets of movies and actors as bipartite subgraphs of the same graph). This would allow us to model “degrees of separations” through other relationships like friendships.


## Data

We are planning on using free, public, IMDb datasets with over 12 million actors and the movies they are famous for. The dataset does include other movie industry individuals such as directors, cinematographers, etc, that we will filter out for our project. Additionally, the movies are currently stored using generated ids, rather than title, so we will need to do a join with an additional table to get the name of the movies. Our program will read in these tables to construct a graph with actor and movie nodes, that we will traverse with our shortest path algorithm.

## Introduction

How to build:
```
stack build
```


How to run:
```
stack run data/movie_subset Pete Postlethwaite" "Alicia Silverstone"
```

How to run with a specified number of threads
```
${PATH TO BFS-EXE} data/movie_subset "Pete Postlethwaite" "Alicia Silverstone" +RTS -ls -N4
```

For example on our machines:
```
./.stack-work/dist/aarch64-osx/Cabal-3.6.3.0/build/bfs-exe/bfs-exe data/movie_subset "Pete Postlethwaite" "Alicia Silverstone" +RTS -ls -N4
```

See threadscope graphs
```
threadscope bfs-exe.eventlog
```
