private void addNodes() { for (CyNode node : nodeList) { PRNode prNode = new PRNode(node); graph.addVertex(prNode); idToNode.put(node.getSUID(), prNode); } }
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); } }
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)); } } } }