Skip to content

This is an Java implementation of the backend for a service that computes Six Degrees of Kevin Bacon.This problem can be restated as finding the shortest path between Kevin Bacon and a given actor (via shared movies).

Notifications You must be signed in to change notification settings

HaoLiangPao/-Six-Degrees-of-Kevin-Bacon-

Repository files navigation

Backend for Six Degrees of Kevin Bacon

Keywords: Java backend, NoSQL (Neo4j), REST API, Maven

1. Descriptions

This is an Java implementation of the backend for a service that computes Six Degrees of Kevin Bacon.This problem can be restated as finding the shortest path between Kevin Bacon and a given actor (via shared movies).

  • The backend is running on port 8080.
  • Neo4j Username: neo4j;
  • Password: 1234;

2. Examples

  • Consider the actor George Clooney:
    • George Clooney acted in “Good Night, and Good Luck” with Patricia Clarkson
    • Patricia Clarkson acted in “Beyond All Boundaries” Kevin Bacon

So we would say that George Clooney has a “Bacon number” of 2.

  • Consider the actor Bud Collyer:
  • Bud Collyer was in “Secret Agent” with Jackson Beck
  • Jackson Beck was in “Hysterical History” with Mae Questel
  • Mae Questel was in “Who Framed Roger Rabbit” with Frank Welker
  • Frank Welker was in “Balto” with Kevin Bacon

So we would say that Bud Collyer has a “Bacon number” of 4.


3. Project/IDE Setup

  • Command Line:
    • Install maven
    • To compile your code simply run mvn compile in the root directory (the folder that has pom.xml)
    • To run your code run mvn exec:java
  • Eclipse:
    • File → Import → Maven → Existing Maven Projects
    • Navigate to the project location
    • Right click the project → Maven Build…
    • Input compile exec:java in the Goals input box
    • Click apply then run/close
    • You can now run the project by pressing the green play button
  • Intellij:
    • Import project
    • Navigate to the project location
    • Import project from external model → Maven
    • Next → Next → Next → Finish
    • Add Configuration → + Button → Maven
    • Name the configuration and input exec:java in the Command Line box
    • Apply → Ok
    • You can now run the project by pressing the green play button

4. Node/Relationship Property

  • Actor:

    • node label actor
    • node properties: id, Name
  • Movie:

    • node label movie
    • node properties: id, Name
  • Relationship:

    • relationship label ACTED_IN

5. Testing

About

This is an Java implementation of the backend for a service that computes Six Degrees of Kevin Bacon.This problem can be restated as finding the shortest path between Kevin Bacon and a given actor (via shared movies).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages