Package it.unimi.dsi.law.big.rank
Class PageRank
java.lang.Object
it.unimi.dsi.law.big.rank.SpectralRanking
it.unimi.dsi.law.big.rank.PageRank
- Direct Known Subclasses:
PageRankParallelGaussSeidel
public abstract class PageRank extends SpectralRanking
A big version of
PageRank
.- See Also:
PageRank
,SpectralRanking
-
Nested Class Summary
Nested classes/interfaces inherited from class it.unimi.dsi.law.big.rank.SpectralRanking
SpectralRanking.IterationNumberStoppingCriterion, SpectralRanking.NormStoppingCriterion, SpectralRanking.StoppingCriterion
-
Field Summary
Fields Modifier and Type Field Description double
alpha
The damping factor.LongArrayBitVector
buckets
If notnull
, the set of buckets ofSpectralRanking.graph
.DoubleBigList
danglingNodeDistribution
The vector used used to patch null rows of the adjacency matrix (u in the general formula).static double
DEFAULT_ALPHA
The default damping factor.DoubleBigList
preference
The preference vector to be used (ornull
if the uniform preference vector should be used).boolean
stronglyPreferential
Decides whether we use the strongly or weakly (the default) preferential algorithm.Fields inherited from class it.unimi.dsi.law.big.rank.SpectralRanking
DEFAULT_MAX_ITER, DEFAULT_NORM, DEFAULT_THRESHOLD, graph, iteration, logger, n, rank, STOCHASTIC_TOLERANCE
-
Constructor Summary
Constructors Constructor Description PageRank(ImmutableGraph g, Logger logger)
Creates a new instance. -
Method Summary
Modifier and Type Method Description Properties
buildProperties(String graphBasename, String preferenceFilename, String danglingFilename)
Returns aProperties
object that contains all the parameters used by the computation.void
init()
Basic initialization: we log the damping factor, check that the preference vector is correctly sized and stochastic, fillSpectralRanking.rank
with the preference vector and set the dangling-node distribution depending on the value ofstronglyPreferential
.Methods inherited from class it.unimi.dsi.law.big.rank.SpectralRanking
and, approximateNormVector, buildProperties, clear, isStochastic, normDelta, or, step, stepUntil
-
Field Details
-
DEFAULT_ALPHA
public static final double DEFAULT_ALPHAThe default damping factor.- See Also:
- Constant Field Values
-
alpha
public double alphaThe damping factor. In the random surfer interpretation, this is the probability that the surfer will follow a link in the current page. -
preference
The preference vector to be used (ornull
if the uniform preference vector should be used). -
danglingNodeDistribution
The vector used used to patch null rows of the adjacency matrix (u in the general formula). It coincides with the preference vector ifstronglyPreferential
is true. Ifnull
, the uniform distribution will be used. -
buckets
If notnull
, the set of buckets ofSpectralRanking.graph
. -
stronglyPreferential
public boolean stronglyPreferentialDecides whether we use the strongly or weakly (the default) preferential algorithm.
-
-
Constructor Details
-
PageRank
Creates a new instance.- Parameters:
g
- the graph.logger
- a logger.
-
-
Method Details
-
buildProperties
public Properties buildProperties(String graphBasename, String preferenceFilename, String danglingFilename)Returns aProperties
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 benull
.danglingFilename
- the filename of dangling-node distribution. It can benull
.- Returns:
- a properties object that represent all the parameters used to calculate the rank.
-
init
Basic initialization: we log the damping factor, check that the preference vector is correctly sized and stochastic, fillSpectralRanking.rank
with the preference vector and set the dangling-node distribution depending on the value ofstronglyPreferential
.- Overrides:
init
in classSpectralRanking
- Throws:
IOException
-