Class PageRankWithPriors<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer<V,E,Double>
edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorerWithPriors<V,E,Double>
edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors<V,E>
- All Implemented Interfaces:
VertexScorer<V,
,Double> IterativeContext
- Direct Known Subclasses:
KStepMarkov
,PageRank
A generalization of PageRank that permits non-uniformly-distributed random jumps.
The 'vertex_priors' (that is, prior probabilities for each vertex) may be
thought of as the fraction of the total 'potential' that is assigned to that
vertex at each step out of the portion that is assigned according
to random jumps (this portion is specified by 'alpha').
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
Maintains the amount of potential associated with vertices with no out-edges.Fields inherited from class edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorerWithPriors
alpha, vertex_priors
Fields inherited from class edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer
edge_weights, graph, hyperedges_are_self_loops, max_delta, max_iterations, output_reversed, tolerance, total_iterations
-
Constructor Summary
ConstructorsConstructorDescriptionPageRankWithPriors
(Hypergraph<V, E> graph, com.google.common.base.Function<E, ? extends Number> edge_weights, com.google.common.base.Function<V, Double> vertex_priors, double alpha) Creates an instance with the specified graph, edge weights, vertex priors, and 'random jump' probability (alpha).PageRankWithPriors
(Hypergraph<V, E> graph, com.google.common.base.Function<V, Double> vertex_priors, double alpha) Creates an instance with the specified graph, vertex priors, and 'random jump' probability (alpha). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Cleans up after each step.protected void
Collects the "disappearing potential" associated with vertices that have no outgoing edges.double
Updates the value for this vertex.Methods inherited from class edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorerWithPriors
getAlpha, getVertexPrior, getVertexPriors, initialize
Methods inherited from class edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer
acceptDisconnectedGraph, done, evaluate, getAdjustedIncidentCount, getCurrentValue, getEdgeWeight, getEdgeWeights, getIterations, getMaxIterations, getOutputValue, getTolerance, getVertexScore, isDisconnectedGraphOK, setCurrentValue, setEdgeWeights, setHyperedgesAreSelfLoops, setMaxIterations, setOutputValue, setTolerance, step, swapOutputForCurrent, updateMaxDelta
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.uci.ics.jung.algorithms.scoring.VertexScorer
getVertexScore
-
Field Details
-
disappearing_potential
protected double disappearing_potentialMaintains the amount of potential associated with vertices with no out-edges.
-
-
Constructor Details
-
PageRankWithPriors
public PageRankWithPriors(Hypergraph<V, E> graph, com.google.common.base.Function<E, ? extends Number> edge_weights, com.google.common.base.Function<V, Double> vertex_priors, double alpha) Creates an instance with the specified graph, edge weights, vertex priors, and 'random jump' probability (alpha).- Parameters:
graph
- the input graphedge_weights
- the edge weights, denoting transition probabilities from source to destinationvertex_priors
- the prior probabilities for each vertexalpha
- the probability of executing a 'random jump' at each step
-
PageRankWithPriors
public PageRankWithPriors(Hypergraph<V, E> graph, com.google.common.base.Function<V, Double> vertex_priors, double alpha) Creates an instance with the specified graph, vertex priors, and 'random jump' probability (alpha). The outgoing edge weights for each vertex will be equal and sum to 1.- Parameters:
graph
- the input graphvertex_priors
- the prior probabilities for each vertexalpha
- the probability of executing a 'random jump' at each step
-
-
Method Details
-
update
Updates the value for this vertex. Called bystep()
.- Specified by:
update
in classAbstractIterativeScorer<V,
E, Double> - Parameters:
v
- the vertex whose value is to be updated- Returns:
- the updated value
-
afterStep
protected void afterStep()Cleans up after each step. In this case that involves allocating the disappearing potential (thus maintaining normalization of the scores) according to the vertex probability priors, and then callingsuper.afterStep
.- Overrides:
afterStep
in classAbstractIterativeScorer<V,
E, Double>
-
collectDisappearingPotential
Collects the "disappearing potential" associated with vertices that have no outgoing edges. Vertices that have no outgoing edges do not directly contribute to the scores of other vertices. These values are collected at each step and then distributed across all vertices as a part of the normalization process.- Overrides:
collectDisappearingPotential
in classAbstractIterativeScorer<V,
E, Double> - Parameters:
v
- the vertex whose potential is being collected
-