[Solved]Discussed Moviestxt File Last Class Along Java Code Developed Representing Building Queryi Q37268665
We discussed the movies.txt file last class, along with someJava code we developed for representing, building, and querying anundirected graph. You will easily understand what to do for thisassignment and be able to get something going code-wise quickly,but longer execution times may have you going back to the drawingboard. If you want to work with a friend in class, you are welcometo. I would further encourage mutual discussions between all of youto get this done correctly and efficiently. But the codecollaboration needs to be confined to a maximum of two team membersfor each submission. So again, class-wide conversations are ok butnot code collaboration.
Here is what needs to be done and there is flexibility in yourcoding choices.
1. The vertex set will consist of all people (names) who arefeatured in the movies (the cast ) and the names of the movies(with the year). The edges will go between the cast members and themovies in the sense that if a person (actor ) is featured in amovie then there is an edge between the two. Obviously therefore,there will not be any edge present between the actors OR betweenthe movies.
2. Each line of the text file is to be read as a String withnextLine() and then separated out using the split(“/”) method. Thefirst one in the separated out array is always the movie name andthe rest are all people names. We already have developed code forthis part that you can use.
3. It is recommended that as you read the movies file intomemory, you will generate for each line of the file, the verticesand the edges for that line right away. Basically, you will firstcall addVertex() before calling addEdge() between a pair ofpreviously created vertices.
4. It is a good idea to find and use a mechanism (some datastructure or attributes) to distinguish the two types of verticesin the graph, the movies vs the cast.
5. Do not add any code to the Graph class with regard to movietext file information. The Graph class is a general purpose utilitythat can used to build a graph for any type of appropriate data.This means that you will create separate Java class file(s) fordoing this assignment.
6. Feel free to use as many data structures as needed (subjectto your computer’s memory limits) to make the codetime-efficient.
7. The first goal is to build the graph of movies and castmembers featured in the movie. And in that process, build auxiliarydata structures to answer questions efficiently.
8. You will then build code to answer the following questions(via suitable methods).
9. How many unique movies are there?
10. How many unique cast members are there? You can assume thattwo people with identical names are the same people – which we willagree as a bit of oversimplification.
11. How many edges are there?
12. Given a cast member, print the list of movies in which thecast member is featured in.
13. Write a method public void coCast (int minMovies) that whenprovided with a threshold minimum number of movies, lists all pairsof cast members that are featured together in at least minMoviesalong with the titles of such movies. For instance, coCast(5) willproduce a list of pairs of cast members which are featured togetherin at least 5 movies.
14. In particular, run the method for minMovies =13 and producethe listing. It should give you nine pairs of cast members. Yourmethod should not take more than 2 to 3 minutes to run. You mustmeet the runtime performance.
15. Also find the pair of cast members who have featured in themost number of movies together. Yes, there is only one and producethe movie title along with the names of the two cast members. Ofcourse, if you solved question 15 above, you got this one aswell.
Expert Answer
Answer to We discussed the movies.txt file last class, along with some Java code we developed for representing, building, and quer… . . .
OR

