// This is just an example of how to read a graph from a file. public class Sample { public static void main(String args[]) { if (args.length != 1) { System.out.println("please use exactly one argument, the name of the file which contains the graph to be read"); return; } GraphInfo g = ReadGraph.readGraph(args[0]); if (g != null) { // At this point, g.name is the name of the graph, // g.nNodes is the number of nodes, g.nEdges is // the number of edges, and g.edges[i].u and // g.edges[i].v are the labels for the vertices // on edge i. System.out.print(g); } else { System.out.println("couldn't read the graph from " + args[0]); } } }