コード例 #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++;
   }
 }
コード例 #2
0
 private void writeEdges() throws IOException {
   for (Edge e : graph.getEdges()) {
     writeStartTag(GraphML.EDGE_TAG, getEdgeAttributes(e), true);
   }
 }
コード例 #3
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();
 }