edu.uci.ics.jung.algorithms.importance
Class HITSWithPriors

java.lang.Object
  extended byedu.uci.ics.jung.algorithms.IterativeProcess
      extended byedu.uci.ics.jung.algorithms.importance.AbstractRanker
          extended byedu.uci.ics.jung.algorithms.importance.RelativeAuthorityRanker
              extended byedu.uci.ics.jung.algorithms.importance.HITSWithPriors

public class HITSWithPriors
extends RelativeAuthorityRanker

Algorithm that extends the HITS algorithm by incorporating root nodes (priors). Whereas in HITS the importance of a node is implicitly computed relative to all nodes in the graph, now importance is computed relative to the specified root nodes.

A simple example of usage is:

 HITSWithPriors ranker = new HITSWithPriors(someGraph,0.3,rootSet);
 ranker.evaluate();
 ranker.printRankings();
 

Running time: O(|V|*I) where |V| is the number of vertices and I is the number of iterations until convergence

Author:
Scott White
See Also:
"Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"

Field Summary
 
Fields inherited from class edu.uci.ics.jung.algorithms.importance.RelativeAuthorityRanker
PRIOR_KEY
 
Fields inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker
DEFAULT_EDGE_WEIGHT_KEY
 
Constructor Summary
HITSWithPriors(Graph graph, boolean useAuthorityForRanking, double bias, java.util.Set priors, java.lang.String edgeWeightKey)
          More specialized constructor where the type of importance can be specified.
HITSWithPriors(Graph graph, double bias, java.util.Set priors)
          Constructs an instance of the ranker where the type of importance that is associated with the rank score is the node's importance as an authority.
 
Method Summary
 double getRankScore(UserDataContainer v)
          Given a node, returns the corresponding rank score.
 java.lang.String getRankScoreKey()
          the user datum key used to store the rank scores
 void setUseAuthorityForRanking(boolean useAuthorityForRanking)
          If evaluate() has not already been called, the user can override the type of importance.
 
Methods inherited from class edu.uci.ics.jung.algorithms.importance.RelativeAuthorityRanker
setPriorRankScore
 
Methods inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker
getEdgeWeightKeyName, getRankings, getRankScores, isRankingNodes, printRankings, setNormalizeRankings, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKey
 
Methods inherited from class edu.uci.ics.jung.algorithms.IterativeProcess
evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, relativePrecision, setDesiredPrecision, setMaximumIterations
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HITSWithPriors

public HITSWithPriors(Graph graph,
                      double bias,
                      java.util.Set priors)
Constructs an instance of the ranker where the type of importance that is associated with the rank score is the node's importance as an authority.

Parameters:
graph - the graph whose nodes are to be ranked
bias - the weight that should be placed on the root nodes (between 0 and 1)
priors - the set of root nodes

HITSWithPriors

public HITSWithPriors(Graph graph,
                      boolean useAuthorityForRanking,
                      double bias,
                      java.util.Set priors,
                      java.lang.String edgeWeightKey)
More specialized constructor where the type of importance can be specified.

Parameters:
graph - the graph whose nodes are to be ranked
useAuthorityForRanking -
bias - the weight that should be placed on the root nodes (between 0 and 1)
priors - the set of root nodes
Method Detail

getRankScoreKey

public java.lang.String getRankScoreKey()
the user datum key used to store the rank scores

Specified by:
getRankScoreKey in class AbstractRanker
Returns:
the key

getRankScore

public double getRankScore(UserDataContainer v)
Given a node, returns the corresponding rank score. This implementation of getRankScore assumes the decoration representing the rank score is of type MutableDouble.

Overrides:
getRankScore in class AbstractRanker
Returns:
the rank score for this node

setUseAuthorityForRanking

public void setUseAuthorityForRanking(boolean useAuthorityForRanking)
If evaluate() has not already been called, the user can override the type of importance. (hub or authority) that should be associated with the rank score.

Parameters:
useAuthorityForRanking - if true, authority is used; if false, hub is used