edu.uci.ics.jung.algorithms.importance
Class DegreeDistributionRanker
java.lang.Object
edu.uci.ics.jung.algorithms.IterativeProcess
edu.uci.ics.jung.algorithms.importance.AbstractRanker
edu.uci.ics.jung.algorithms.importance.DegreeDistributionRanker
public class DegreeDistributionRanker
- extends AbstractRanker
A simple node importance ranker based on the degree of the node. The user can specify whether s/he wants
to use the indegree or the outdegree as the metric. If the graph is undirected this option is effectively
ignored. So for example, if the graph is directed and the user chooses to use in-degree, nodes with the highest
in-degree will be ranked highest and similarly nodes with the lowest in-degree will be ranked lowest.
A simple example of usage is:
DegreeDistributionRanker ranker = new DegreeDistributionRanker(someGraph);
ranker.evaluate();
ranker.printRankings();
- Author:
- Scott White
Methods inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker |
assignDefaultEdgeTransitionWeights, finalizeIterations, getEdgeWeight, getEdgeWeightKeyName, getGraph, getRankings, getRankScore, getRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, reinitialize, setEdgeWeight, setNormalizeRankings, setRankScore, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKey |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY
public static final String KEY
- See Also:
- Constant Field Values
DegreeDistributionRanker
public DegreeDistributionRanker(Graph graph)
- Default constructor which assumes if the graph is directed the indegree is to be used.
- Parameters:
graph
- the graph whose nodes are to be ranked based on indegree
DegreeDistributionRanker
public DegreeDistributionRanker(Graph graph,
boolean useInDegree)
- This constructor allows you to specify whether to use indegree or outdegree.
- Parameters:
graph
- the graph whose nodes are to be ranked baseduseInDegree
- if true
, indicates indegree is to be used, if false
outdegree
evaluateIteration
protected double evaluateIteration()
- Description copied from class:
IterativeProcess
- Evaluate the result of the current interation.
- Specified by:
evaluateIteration
in class IterativeProcess
- Returns:
- the estimated precision of the result.
getRankScoreKey
public String getRankScoreKey()
- Description copied from class:
AbstractRanker
- The user datum key used to store the rank score.
- Specified by:
getRankScoreKey
in class AbstractRanker
- Returns:
- the key