if (esize != enums.length) {
System.err.println("FATAL. Numbering error.");
System.exit(0);
}
SimpleGraph sg = new SimpleGraph();
SimpleVertex[] sv = new SimpleVertex[vsize];
SimpleEdge[] se = new SimpleEdge[esize];
for (int i = 0; i < sv.length; i++) {
sv[i] = new SimpleVertex();
if (vnums != null) {
sv[i].setOrthX(vnums[i][0]);
sv[i].setOrthY(vnums[i][1]);
}
}
for (int i = 0; i < se.length; i++) {
se[i] = new SimpleEdge(sv[enums[i][0]], sv[enums[i][1]]);
}
sg.addEdges(Arrays.asList(se));
sg.addVertices(Arrays.asList(sv));
return sg;
}