|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.algorithms.IterativeProcess
edu.uci.ics.jung.algorithms.importance.AbstractRanker
edu.uci.ics.jung.algorithms.importance.HITS
public class HITS
Calculates the "hubs-and-authorities" importance measures for each node in a graph. These measures are defined recursively as follows:
Note: This algorithm uses the same key as HITSWithPriors for storing rank sccores.
A simple example of usage is:
HITS ranker = new HITS(someGraph); 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
Field Summary | |
---|---|
protected static String |
AUTHORITY_KEY
|
protected static String |
HUB_KEY
|
Fields inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker |
---|
DEFAULT_EDGE_WEIGHT_KEY |
Constructor Summary | |
---|---|
HITS(Graph graph)
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. |
|
HITS(Graph graph,
boolean useAuthorityForRanking)
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 | |
---|---|
protected double |
evaluateIteration()
Evaluate the result of the current interation. |
protected void |
finalizeIterations()
Perform eventual clean-up operations (must be implement by subclass when needed). |
protected double |
getPreviousAuthorityScore(Element v)
|
protected double |
getPreviousHubScore(Element v)
|
double |
getRankScore(Element v)
Given a node, returns the corresponding rank score. |
protected double |
getRankScore(Element v,
String key)
Given a node and a key, returns the corresponding rank score. |
String |
getRankScoreKey()
the user datum key used to store the rank scores |
protected void |
initialize(Graph g)
|
protected void |
setRankScore(Element v,
double rankValue)
|
protected void |
setRankScore(Element v,
double rankValue,
String key)
|
void |
setUseAuthorityForRanking(boolean useAuthorityForRanking)
If evaluate() has not already been called, the user can override the type of importance. |
protected void |
updateAuthorityRankings()
|
protected void |
updateHubRankings()
|
protected void |
updatePreviousScores()
|
Methods inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker |
---|
assignDefaultEdgeTransitionWeights, getEdgeWeight, getEdgeWeightKeyName, getGraph, getRankings, getRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, reinitialize, setEdgeWeight, setNormalizeRankings, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKey |
Methods inherited from class edu.uci.ics.jung.algorithms.IterativeProcess |
---|
evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String AUTHORITY_KEY
protected static final String HUB_KEY
Constructor Detail |
---|
public HITS(Graph graph, boolean useAuthorityForRanking)
graph
- the graph whose nodes are to be rankeduseAuthorityForRanking
- public HITS(Graph graph)
graph
- the graph whose nodes are to be rankedMethod Detail |
---|
protected void initialize(Graph g)
protected void finalizeIterations()
IterativeProcess
finalizeIterations
in class AbstractRanker
public String getRankScoreKey()
getRankScoreKey
in class AbstractRanker
public double getRankScore(Element v)
getRankScore
assumes
the decoration representing the rank score is of type MutableDouble
.
getRankScore
in class AbstractRanker
protected double getRankScore(Element v, String key)
MutableDouble
.
v
- the node in questionkey
- the user datum key that indexes the rank score value
protected double getPreviousAuthorityScore(Element v)
protected double getPreviousHubScore(Element v)
protected void setRankScore(Element v, double rankValue, String key)
protected void setRankScore(Element v, double rankValue)
setRankScore
in class AbstractRanker
protected double evaluateIteration()
IterativeProcess
evaluateIteration
in class IterativeProcess
public void setUseAuthorityForRanking(boolean useAuthorityForRanking)
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.
useAuthorityForRanking
- if true
, authority is used; if false
, hub is usedprotected void updateAuthorityRankings()
protected void updateHubRankings()
protected void updatePreviousScores()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |