Ejemplo n.º 1
0
  private void insertScores(List<NodeCluster> clusters, PageRank<PRNode, PREdge> pageRank) {
    for (PRNode node : graph.getVertices()) {
      node.setPRScore(pageRank.getVertexScore(node));

      for (NodeCluster cluster : clusters) {
        if (cluster.getNodeScores().containsKey(node.getCyNode().getSUID())) {
          cluster.addScoreToAvg(pageRank.getVertexScore(node));
        }
      }
    }
  }
Ejemplo n.º 2
0
 private PageRank<PRNode, PREdge> performPageRank() {
   PageRank<PRNode, PREdge> pageRank = new PageRank<>(graph, transformEdge(), context.getAlpha());
   pageRank.setMaxIterations(1000);
   pageRank.evaluate();
   return pageRank;
 }