private void writeVertices() throws IOException { /* * Start indexing with 1 since 0 is returned if no mapping is found. */ vertexIdx = 1; for (Vertex v : graph.getVertices()) { vertexTmpIds.put(v, vertexIdx); writeStartTag(GraphML.NODE_TAG, getVertexAttributes(v), true); vertexIdx++; } }
private void writeEdges() throws IOException { for (Edge e : graph.getEdges()) { writeStartTag(GraphML.EDGE_TAG, getEdgeAttributes(e), true); } }
/** * Creates a colorizer which color spectrum is scaled to the degree distribution of * <tt>graph</tt>. * * @param graph a graph */ public VertexDegreeColorizer(Graph graph) { Degree degree = Degree.getInstance(); DescriptiveStatistics distr = degree.statistics(graph.getVertices()); k_min = (int) distr.getMin(); k_max = (int) distr.getMax(); }