Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create FindDegree.go #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

shivramsrivastava
Copy link
Owner

To Run:

go run FindDegree.go person-one person-two

example:

go run FindDegree.go amitabh-bachchan samuel-l-jackson

This program will find the Minimum degree of separation.
It can also print more than one relation path.

Example:

$ time go run FindDegree.go amitabh-bachchan samuel-l-jackson

Degrees of Separation: 2

  1. Movie : Cell
    Actor : Samuel L Jackson
    Executive Producer / Production : Marina Grasic
  2. Movie : Om Shanti Om
    Playback Singer : Marina Grasic
    Special Appearance : Amitabh Bachchan

Failed to fetch the Movie details the-man-from-u-n-c-l-e

Degrees of Separation: 2

  1. Movie : Jurassic Park 3D
    Supporting Actor : Samuel L Jackson
    Supporting Actor : Richard Attenborough
  2. Movie : Shatranj Ke Khilari
    Supporting Actor : Richard Attenborough
    Supporting Actor : Amitabh Bachchan

real 6m58.232s
user 1m23.382s
sys 1m16.303s

Shivram Srivastava added 3 commits March 8, 2015 09:05
To Run:

go run FindDegree.go <person-one> <person-two>

example:

go run FindDegree.go amitabh-bachchan samuel-l-jackson


This program will find the Minimum degree of separation.
It can also print more than one relation path.

Example:

$ time go run FindDegree.go amitabh-bachchan samuel-l-jackson

Degrees of Separation: 2
1. Movie : Cell
Actor : Samuel L Jackson
Executive Producer / Production : Marina Grasic

2. Movie : Om Shanti Om
Playback Singer : Marina Grasic
Special Appearance : Amitabh Bachchan


Failed to fetch the Movie details the-man-from-u-n-c-l-e

Degrees of Separation: 2
1. Movie : Jurassic Park 3D
Supporting Actor : Samuel L Jackson
Supporting Actor : Richard Attenborough

2. Movie : Shatranj Ke Khilari
Supporting Actor : Richard Attenborough
Supporting Actor : Amitabh Bachchan


real	6m58.232s
user	1m23.382s
sys	1m16.303s
Minor change, eliminated the redundant parsing of person object.


Example op:

$ time go run FindDegree.go amitabh-bachchan robert-de-niro

Degrees of Separation: 2
1. Movie : American Hustle
Supporting Actor : Robert De Niro
Supporting Actor : Kevin Cannon

2. Movie : Kabhi Alvida Naa Kehna
Supporting Actor : Kevin Cannon
Supporting Actor : Amitabh Bachchan


real	1m34.594s
user	0m9.939s
sys	0m9.098s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant