【问题标题】:Is there any implementation of degree distribution in JUNG2 API?JUNG2 API中是否有学位分配的实现?
【发布时间】:2026-02-14 07:00:01
【问题描述】:

我试图查看版本 2 的文档,但我没有找到任何东西。

【问题讨论】:

    标签: java graph-theory jung jung2


    【解决方案1】:

    不,没有,但是循环遍历图中的顶点并建立度数分布的表示非常简单,例如:

    int[] degreeCounts = new int[graph.getVertexCount()];
    for (V v : graph.getVertices()) {
      degreeCounts[graph.getDegree(v)]++;
    }
    

    根据需要替换适当的度函数(入度、出度)。

    【讨论】: