-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestPrim.java
More file actions
23 lines (21 loc) · 731 Bytes
/
Copy pathTestPrim.java
File metadata and controls
23 lines (21 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.IOException;
public class TestPrim {
public static void main(String [] args) {
String vertexFile = args[0];
String edgeFile = args[1];
String start = args[2];
MapReader myReader = new MapReader(vertexFile, edgeFile);
//try/catch block for IOExceptions
try {
@SuppressWarnings("static-access")
Graph myGraph = myReader.readGraph(vertexFile, edgeFile);
myGraph.computeEuclideanCosts();
Graph spanningTree = myGraph.getMinimumSpanningTree(start);
DisplayGraph display = new DisplayGraph(spanningTree);
display.setVisible(true);
} catch (IOException e) {
System.out.println("Sorry, I couldn't find one or both of those files.");
e.printStackTrace();
}
}
}