public class PageRankWithPriors extends PageRank
Note: This algorithm uses the same key as PageRank for storing rank sccores
A simple example of usage is:
PageRankWithPriors ranker = new PageRankWithPriors(someGraph,0.3,1,rootSet,null); ranker.evaluate(); ranker.printRankings();
Running time: O(|E|*I) where |E| is the number of edges and I is the number of iterations until convergence
PRIOR_KEYDEFAULT_EDGE_WEIGHT_KEY| Constructor and Description |
|---|
PageRankWithPriors(DirectedGraph graph,
double beta,
java.util.Set priors,
java.lang.String edgeWeightKeyName)
Constructs an instance of the ranker.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
initializePriorWeights() |
protected void |
reinitialize() |
evaluateIteration, getRankScoreKey, initialize, initializeRankings, updateRankingsfinalizeIterations, getPriorRankScore, getPriorRankScoreKey, getPriors, setPriorRankScore, setPriorsassignDefaultEdgeTransitionWeights, getEdgeWeight, getEdgeWeightKeyName, getGraph, getRankings, getRankScore, getRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, setEdgeWeight, setNormalizeRankings, setRankScore, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKeyevaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterationspublic PageRankWithPriors(DirectedGraph graph, double beta, java.util.Set priors, java.lang.String edgeWeightKeyName)
graph - the graph whose nodes are being rankedbeta - the prior weight to put on the root nodespriors - the set of root nodesedgeWeightKeyName - the user datum key associated with any user-defined weights. If there are none,
null should be passed in.protected void initializePriorWeights()
protected void reinitialize()
reinitialize in class PageRank