Exemplo n.º 1
0
 private void addNodes() {
   for (CyNode node : nodeList) {
     PRNode prNode = new PRNode(node);
     graph.addVertex(prNode);
     idToNode.put(node.getSUID(), prNode);
   }
 }
Exemplo n.º 2
0
 private void addEdges() {
   for (CyEdge edge : edgeList) {
     PRNode sourceNode = idToNode.get(edge.getSource().getSUID());
     PRNode targetNode = idToNode.get(edge.getTarget().getSUID());
     PREdge prEdge = new PREdge(edge);
     insertEdgeScore(prEdge, edgeTable, edgeAttributes);
     graph.addEdge(prEdge, new Pair<>(sourceNode, targetNode), EdgeType.DIRECTED);
   }
 }
Exemplo n.º 3
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));
        }
      }
    }
  }