Class PageRank

Direct Known Subclasses:
PageRankParallelGaussSeidel

public abstract class PageRank
extends SpectralRanking
A big version of PageRank.
See Also:
PageRank, SpectralRanking
  • Field Details

    • DEFAULT_ALPHA

      public static final double DEFAULT_ALPHA
      The default damping factor.
      See Also:
      Constant Field Values
    • alpha

      public double alpha
      The damping factor. In the random surfer interpretation, this is the probability that the surfer will follow a link in the current page.
    • preference

      public DoubleBigList preference
      The preference vector to be used (or null if the uniform preference vector should be used).
    • danglingNodeDistribution

      public DoubleBigList danglingNodeDistribution
      The vector used used to patch null rows of the adjacency matrix (u in the general formula). It coincides with the preference vector if stronglyPreferential is true. If null, the uniform distribution will be used.
    • buckets

      public LongArrayBitVector buckets
      If not null, the set of buckets of SpectralRanking.graph.
    • stronglyPreferential

      public boolean stronglyPreferential
      Decides whether we use the strongly or weakly (the default) preferential algorithm.
  • Constructor Details

    • PageRank

      public PageRank​(ImmutableGraph g, Logger logger)
      Creates a new instance.
      Parameters:
      g - the graph.
      logger - a logger.
  • Method Details

    • buildProperties

      public Properties buildProperties​(String graphBasename, String preferenceFilename, String danglingFilename)
      Returns a Properties object that contains all the parameters used by the computation.
      Parameters:
      graphBasename - the basename of the graph.
      preferenceFilename - the filename of preference vector. It can be null.
      danglingFilename - the filename of dangling-node distribution. It can be null.
      Returns:
      a properties object that represent all the parameters used to calculate the rank.
    • init

      public void init() throws IOException
      Basic initialization: we log the damping factor, check that the preference vector is correctly sized and stochastic, fill SpectralRanking.rank with the preference vector and set the dangling-node distribution depending on the value of stronglyPreferential.
      Overrides:
      init in class SpectralRanking
      Throws:
      IOException