public class PageRank<V,E> extends PageRankWithPriors<V,E>
PageRank is an eigenvector-based algorithm. The score for a given vertex may be thought of as the fraction of time spent 'visiting' that vertex (measured over all time) in a random walk over the vertices (following outgoing edges from each vertex). PageRank modifies this random walk by adding to the model a probability (specified as 'alpha' in the constructor) of jumping to any vertex. If alpha is 0, this is equivalent to the eigenvector centrality algorithm; if alpha is 1, all vertices will receive the same score (1/|V|). Thus, alpha acts as a sort of score smoothing parameter.
The original algorithm assumed that, for a given vertex, the probability of following any outgoing edge was the same; this is the default if edge weights are not specified. This implementation generalizes the original by permitting the user to specify edge weights; in order to maintain the original semantics, however, the weights on the outgoing edges for a given vertex must represent transition probabilities; that is, they must sum to 1.
If a vertex has no outgoing edges, then the probability of taking a random jump from that
vertex is (by default) effectively 1. If the user wishes to instead throw an exception when this happens,
call acceptDisconnectedGraph(false)
on this instance.
Typical values for alpha (according to the original paper) are in the range [0.1, 0.2] but may be any value between 0 and 1 inclusive.
disappearing_potential
alpha, vertex_priors
edge_weights, graph, hyperedges_are_self_loops, max_delta, max_iterations, output_reversed, tolerance, total_iterations
Constructor and Description |
---|
PageRank(Hypergraph<V,E> graph,
double alpha)
Creates an instance for the specified graph and random jump probability; the probability
of following any outgoing edge from a given vertex is the same.
|
PageRank(Hypergraph<V,E> graph,
com.google.common.base.Function<E,? extends Number> edge_weight,
double alpha)
Creates an instance for the specified graph, edge weights, and random jump probability.
|
afterStep, collectDisappearingPotential, update
getAlpha, getVertexPrior, getVertexPriors, initialize
acceptDisconnectedGraph, done, evaluate, getAdjustedIncidentCount, getCurrentValue, getEdgeWeight, getEdgeWeights, getIterations, getMaxIterations, getOutputValue, getTolerance, getVertexScore, isDisconnectedGraphOK, setCurrentValue, setEdgeWeights, setHyperedgesAreSelfLoops, setMaxIterations, setOutputValue, setTolerance, step, swapOutputForCurrent, updateMaxDelta
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getVertexScore
public PageRank(Hypergraph<V,E> graph, com.google.common.base.Function<E,? extends Number> edge_weight, double alpha)
graph
- the input graphedge_weight
- the edge weights (transition probabilities)alpha
- the probability of taking a random jump to an arbitrary vertexpublic PageRank(Hypergraph<V,E> graph, double alpha)
graph
- the input graphalpha
- the probability of taking a random jump to an arbitrary vertexCopyright © 2015. All rights reserved.