Ejemplo n.º 1
0
 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++;
   }
 }
Ejemplo n.º 2
0
 /**
  * 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();
 }