Please zip your entire directory and submit it via moodle by Monday 4/23 at 11:59pm.
In this assignment, you will implement a basic directed graph data structure and support DFS and BFS traversals.
I would encourage you to try to write your code based only on what is described on this page.
That being said, you may wish to have some hints along the way. Within each part, you will find links from interface/class/method names to HINTS that provide starting code. If you don't want hints for a certain interface/class/method, don't click the links :)
Implement a basic graph data structure that supports generics.
You should have
((0,1,2,3),(0->1,1->2,1->3,2->3,3->0,3->1))
and vertex 1 should print as
(1,{key1:value1,...},(2,3))
g1
g2
Modify your interfaces from Part 1 to include the following traversals:
public List<GraphVertex> depthFirst( int ID )
public List<GraphVertex> breadthFirst( int ID )
Update your graph implementation to produce DFS (recursive) and BFS (iterative) traversals; the methods should return a List of vertex objects in the traversal order.
Create a JUnit tester that creates several test Graphs and prints both the depth-first and breadth-first traversals. This is where it important to have canonical representations and also where your toString methods will be important/helpful.
Choose demonstrative examples that emphasize the difference between the two traversals and include images of your graphs. You may make the images in OmniGraffle (on the CS lab machines) and save as a PDF, jpg, png or gif; or draw them and upload a picture.
You must have at least 1 new graph with at least 4 vertices where you test a DF and BF traversal. Please post your tests to Piazza, but you may only earn late days for additional graph/traversal tests.