// Sets the vertices and edges of the graph from the info in the file, // which should be in a simple Pajek-like format: // *Vertices # where # is the number of vertices // id1 label1 where id is a number and label a string, in double quotes if it has a space // id2 label2 // ... // id# label# // *Edges // ida1 idb1 where the ids are those of the connected vertices // ida2 idb2 // ... void readPajek(Graph g, String filename) { Vertex[] vertices = null; int[] ids = null; // keep track of vertex ids, for lookup (parallels vertices) Edge[] edges = null; int vn=0, en=0; // vertex and edge numbers, so far String[] lines = loadStrings(filename); int mode=0; // 0: before vertices; 1: vertices; 2: edges for (int i=0; i