Question: Learn how to build and manipulate graph data structures Getting Started Create a project called P9 and import GraphManipulation-starter.jar http://www.cs.colostate.edu/~cs165/.Spring18/assignments/P9/archive/GraphManipulation-starter.jar Your directory should now look
Learn how to build and manipulate graph data structures
Getting Started
Create a project called P9 and import GraphManipulation-starter.jar
http://www.cs.colostate.edu/~cs165/.Spring18/assignments/P9/archive/GraphManipulation-starter.jar
Your directory should now look like this:
P9/ ??? resources ? ??? MileagesLarge.csv ? ??? MileagesSmall.csv ??? src ??? GraphAbstract.java ??? GraphImplementation.java
Part One
Implement the readGraph() method
http://www.cs.colostate.edu/~cs165/.Spring18/assignments/P9/doc/javadoc/GraphImplementation.html#readGraph-java.lang.String-
Implement the writeGraph() method
http://www.cs.colostate.edu/~cs165/.Spring18/assignments/P9/doc/javadoc/GraphImplementation.html#writeGraph-java.lang.String-
Testing
Enter an input mileages file and an output graph file in your run configurations, such as below:
resources/MileagesSmall.csv MileageSmall.dot
Here is the output you should see from your program, when it is working correctly:
digraph BST { ratio = 1.0; node [style=filled] node [fillcolor=darkslateblue] node [fixedsize=true] node [shape=oval] node [width=6] node [height=4] node [fontname=Arial] node [fontsize=60] node [fontcolor=white] edge [dir=none] edge [penwidth=24] edge [fontname=Arial] edge [fontsize=110] Node0 [label="Aspen"]; Node1 [label="Boulder"]; Node2 [label="Breckenridge"]; Node3 [label="Craig"]; Node4 [label="Denver"]; Node5 [label="Durango"]; Node6 [label="Fort Collins"]; Node7 [label="Pueblo"]; Node8 [label="Snowmass"]; Node9 [label="Telluride"]; Node0 -> Node8 [label="8" color="green"] Node1 -> Node4 [label="28" color="green"] Node1 -> Node6 [label="55" color="green"] Node4 -> Node6 [label="64" color="green"] Node2 -> Node4 [label="81" color="green"] Node1 -> Node2 [label="99" color="green"] Node4 -> Node7 [label="112" color="blue"] Node5 -> Node9 [label="120" color="blue"] Node2 -> Node8 [label="136" color="blue"] Node1 -> Node7 [label="146" color="blue"] Node3 -> Node8 [label="156" color="blue"] Node0 -> Node3 [label="158" color="blue"] Node2 -> Node7 [label="190" color="blue"] Node3 -> Node4 [label="198" color="blue"] Node0 -> Node9 [label="248" color="magenta"] }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
