Jason Ram

Greenhorn
+ Follow
since Mar 04, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jason Ram

The tips you just gave for breaking code up is more than I have been given in 2 semesters (one of python and now the 2nd with java). Thank you.

The comments like that are required specifically for this assignment only.

I have managed to implement everything in a way that works. I will work on trying to make it have better form next.
8 years ago
I just want to thank everyone again for the help.
I managed to use some concepts I learned while researching pairing to help give me ideas on how to do this program.

The way I have implemented it so far may not be the best way to implement it, but so far it all seems to be working just how I need it to work.
8 years ago
I agree with how the input file is annoying, it was given to us so nothing I can do.

I have been working on it for a while. Ended up restarting once. I just need to figure out how to get the print for a connection working.
This can be seen by my comment at the end of the code
an example of what it will print:
Enter first actor name (two case-sensitive words): Josh Brolin
Enter second actor name (two case-sensitive words): Ian McKellen
Josh Brolin was in HollowMan
with Kevin Bacon who was in Apollo13
with Tom Hanks who was in DaVinciCode
with Ian McKellen.


8 years ago
So I am still kind of confused. I was wondering if anyone else had any tips for me or if I could get some pseudo code for this.

Thanks for the help so far everyone
8 years ago
here is a slightly larger test file


Apollo13 Kevin Bacon Tom Hanks Gary Sinise
HollowMan Elisabeth Shue Kevin Bacon Josh Brolin
AFewGoodMen Tom Cruise Demi Moore Jack Nicholson Kevin Bacon
OneCrazySummer John Cusack Demi Moore
DaVinciCode Tom Hanks Ian McKellen Audrey Tautou
ForestGump Tom Hanks Gary Sinise Robin Wright
TheMartian Matt Damon Jessica Chastain Jeff Daniels Michael Pena
Inception Leonardo Dicaprio Tom Hardy Ellen Page
TheRevenant Leonardo Dicaprio Tom Hardy Will Poulter
StarWarsTheForceAwakens Harrison Ford Adam Driver Daisy Ridley
JurassicWorld Chris Pratt Bryce Howard Jeff Goldblum
8 years ago
Carey Brown, I do not have a bigger input file at this time. These are something I have to make and I haven't gotten around to making a bigger one. I will start working on one and get it posted in an hour or two.

How did you go about implementing the class to find the connections?
8 years ago
The final class I need to write is going to be called ThreeDegrees.
It will do the following:
Find the chain of no more than three links connecting actors/actresses in various movies and asks for an input movie file and the two actors being connected.
Run the ThreeDegrees program which searches for a three or less chain link between two actors using the movies they have been in.

Now, where I am struggling is when it comes to finding out the best way to do that.

I figure I need to start with a setup of something like this

8 years ago
I have done some work, and using nodes is the way to go after talking to an assistant professor.
I have a Node class and a Graph Class. Both classes are below.

NODE


GRAPH


So I confirmed that these are both on the right track. I need to write another class that will actually do the work for finding the link.
I have an idea of what needs to be done and I will post it in the next reply
8 years ago
Yes Winston, that sounds like what I need.

I haven't really learned about pairings yet but from your description they seem like they will work.
I'll give it a go after one or two more tries on something with nodes that I'm trying to do.

Thanks for the help so far
8 years ago
As far as searching goes, it was recommended to use breadth first search.

Winston, I'll give what you said a try.
I may end up going slightly out of the guidelines, but that is okay.
8 years ago
Junilu Lacar, thank you for the reply. I guess my biggest issue is finding the relation in the actors. I will explain more below.

I have made the following to add provided data to a Graph

I remember being suggested to turn the graph data into a string so I did the following for that (I could use some verification on if this is a decent way to do so)


So I guess it is best to say that I am having the most trouble with figuring out exactly how to compare everything and find the shortest way to connect actors.
8 years ago
I am working on something for CS and am having a lot of trouble figuring it all out.
The program I need to do has a concept of "Six Degrees of Separation" or "Six Degrees of Kevin Bacon." The idea is that any actor in any movie can be linked to Kevin Bacon through a series of actors that appeared in a movie together.

For example, Ian McKellen, who played Gandalf in the "Lord of the Rings" trilogy, was in "The DaVinci Code" with Tom Hanks, who was in "Apollo 13" with Kevin Bacon. This is a two movie link 'chain' connecting Ian McKellen and Kevin Bacon. Supposedly all actors can be linked back to Kevin Bacon in no more than six links.
The solution program will read a file whose content is a list of movies and a list of sets of actors that appeared in those movies. You need to find a chain of no more than three links that connect two given names (not only Kevin Bacon). We use three rather than six to keep input files of a reasonable size. Also, the current Facebook research shows that maybe the legend should be amended down to three; see the research link above.

This program will connect the actors/actresses in less than three links.

I have this for my to do and requirements set for myself:
My main program, ThreeDegrees.java, is a Java implementation that:
  • Prompts the user for the name of an input file.
  • Reads the file contents into a graph data structure.
  • Prints the graph data structure.
  • Prompts the user for two names to try connecting.
  • Performs the search and either will print the shortest chain linking the two names in a chain of maximum length three, or prints a message that reports no chain was found. (See the examples for the text your program should print.)
  • If either the first or second name is the empty string (the user hit enter giving no name), then the program should end.
  • If either name is not found in the graph, then the program should print a message to that effect, and request two new names for the next search.


  • Here is an example file of movie-actor relationships. (The program will read the file and process search queries):
    *The title will always be one word and all names will be two words.
    Apollo13 Kevin Bacon Tom Hanks Gary Sinise
    HollowMan Elisabeth Shue Kevin Bacon Josh Brolin
    AFewGoodMen Tom Cruise Demi Moore Jack Nicholson Kevin Bacon
    OneCrazySummer John Cusack Demi Moore
    DaVinciCode Tom Hanks Ian McKellen Audrey Tautou


    Any and all help would be appreciated. Thanks in advance
    8 years ago
    Here are the other 3 classes I have that were supplied to me.\





    8 years ago
    Hi, I will post the other 3 classes that I am using in my project when I get back to my desktop in an hour or two. thank you for the input so far.
    8 years ago
    Hi I have the following code that I have written but I want to optimize it if possible, or change it up a little. A friend helped me with some of the concepts behind it and I would like to see other ways it an be implemented as well. Thanks
    Here is the code with the doc strings left in

    8 years ago