Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do not cut and paste method prototypes from the javadoc into Eclipse. Your code may not compile in the submit server. This has to do

Do not cut and paste method prototypes from the javadoc into Eclipse. Your code may not compile in the submit server. This has to do with character sets.
If you see in the submit server the error "missing_component", the problem is that you are missing a required class/method. You can also get this error if you are not defining a generic class correctly. Submit often so you can identify problems immediately.
Feel free to use code we have provided in lecture. 2
If you have a problem with your code and need assistance during office hours, you need to have a stu- dent test(s) that illustrates the problem you are experiencing. See Student Tests for information regarding the implementation of student tests.
This project has two main tasks: implementing a graph representation and implementing the BFS/DF- S/Dijkstras algorithms. The Graph class is a generic class whose type parameter represents the elements of the graph we are defining (e.g., Graph, Graph, etc.). In order to represent the adja- cency properties and the graph data we will use the following maps:
HashMap> adjacencyMap; HashMap dataMap;
TheactualmethodsyouneedtoimplementaredescribedatJavadoc.Youwillfindintheimplementation package an interface named CallBack. A class implementing this interface represents a class that will process a vertex. An example of such a class is PrintCallBack (which you will find in the implementation package). This class is used to generate the string that represents the path we follow when performing a breadth-first search or a depth-first search. Each time we reach a vertex, the implementation of DFS and BFS is expected to call the processVertex method to apply whatever processing needs to be done to the vertex. We have implemented PrintCallBack for you (dont modify it).
ThemethodgetCostreturnsthecostofthedirectededgethatexistbetweenstartVertexandendVertex. You can assume that endVertex is adjacent to startVertex. This method is NOT computing the cost betweenanytwovertices.Forthismethodignorethe@throws IllegalArgumentExceptioninformation provided in the javadoc.
If your doDepthFirstSearch and doBreadthFirstSearch methods work in Eclipse, but not in the submit server, your problem might be that you are defining the callback parameter as PrintCallBack instead of Callback. The submit server expects Callback.
Do not implement DFS using a recursive approach; implement DFS using an explicit stack as described in lecture.
If no path is found while executing Dijkstras algorithm, the ArrayList representing the path will have the entry "None". The doDijkstras method will return -1 in this case.
Process adjacent vertices in alphabetical order. This means that when processing a node you will add adjacent elements to a stack or queue by selecting adjacent nodes in alphabetical order. It does not mean the DFS or BFS result will show the nodes in alphabetical order. For example, if node B has nodes E and D as adjacents, we will add D to the stack/queue first, followed by tt E.
Style will not be graded for this project. Your grade will be based on submit server results.
For this project it could be the case that you pass your tests in Eclipse and not in the submit server due to some class definition. Make sure you submit early and often so you can verify your project works in the submit server. No extensions will be granted because you did not check your project results in the submit server.
Youcanactuallyimplementtheprojectwithoutusingaparticularmaximum.IncaseInteger.MAX_VALUE is not working for you, you can assume an edge cost will not exceed 10000.
Adding private methods is fine.
Do you know you can make a TreeMap out of a HashMap? You can have the efficiency of HashMaps, but when you need to process data in sorted order you can turn a HashMap into a TreeMap by using the TreeMapconstructor(e.g.,new TreeMap(myHashMap)).
When multiple nodes have the same cost choosing any one is fine.
You can use classes we have gone over in class (TreeSet, PriorityQueue, etc.).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

Has your organisation defined its purpose, vision and mission?

Answered: 1 week ago