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

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.IterativeProcess
      extended by edu.uci.ics.jung.algorithms.importance.AbstractRanker
          extended by 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

Field Summary
static String KEY
           
 
Fields inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker
DEFAULT_EDGE_WEIGHT_KEY
 
Constructor Summary
DegreeDistributionRanker(Graph graph)
          Default constructor which assumes if the graph is directed the indegree is to be used.
DegreeDistributionRanker(Graph graph, boolean useInDegree)
          This constructor allows you to specify whether to use indegree or outdegree.
 
Method Summary
protected  double evaluateIteration()
          Evaluate the result of the current interation.
 String getRankScoreKey()
          The user datum key used to store the rank score.
 
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 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

KEY

public static final String KEY
See Also:
Constant Field Values
Constructor Detail

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 based
useInDegree - if true, indicates indegree is to be used, if false outdegree
Method Detail

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