Class PageRank.Algorithm

  • Type Parameters:
    V - the graph type
    E - the edge type
    Enclosing class:
    PageRank<V,​E>

    private class PageRank.Algorithm
    extends java.lang.Object
    The actual implementation.

    We use this pattern with the inner class in order to be able to cache the result but also allow the garbage collector to acquire all auxiliary memory used during the execution of the algorithm.

    • Field Detail

      • totalVertices

        private int totalVertices
      • isWeighted

        private boolean isWeighted
      • vertexIndexMap

        private java.util.Map<V,​java.lang.Integer> vertexIndexMap
      • vertexMap

        private V[] vertexMap
      • weightSum

        private double[] weightSum
      • curScore

        private double[] curScore
      • nextScore

        private double[] nextScore
      • outDegree

        private int[] outDegree
      • adjList

        private java.util.ArrayList<int[]> adjList
      • weightsList

        private java.util.ArrayList<double[]> weightsList
    • Constructor Detail

      • Algorithm

        public Algorithm()
    • Method Detail

      • getScores

        public java.util.Map<V,​java.lang.Double> getScores()
      • run

        private void run()
      • runWeighted

        private void runWeighted()
      • teleProp

        private double teleProp()
      • swapScores

        private void swapScores()