edu.uci.ics.jung.algorithms.importance
Class BetweennessCentrality<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.util.IterativeProcess
-
- edu.uci.ics.jung.algorithms.importance.AbstractRanker<V,E>
-
- edu.uci.ics.jung.algorithms.importance.BetweennessCentrality<V,E>
-
- All Implemented Interfaces:
- IterativeContext
public class BetweennessCentrality<V,E> extends AbstractRanker<V,E>
Computes betweenness centrality for each vertex and edge in the graph. The result is that each vertex and edge has a UserData element of type MutableDouble whose key is 'centrality.BetweennessCentrality'. Note: Many social network researchers like to normalize the betweenness values by dividing the values by (n-1)(n-2)/2. The values given here are unnormalized.A simple example of usage is:
BetweennessCentrality ranker = new BetweennessCentrality(someGraph); ranker.evaluate(); ranker.printRankings();
Running time is: O(n^2 + nm).- See Also:
- "Ulrik Brandes: A Faster Algorithm for Betweenness Centrality. Journal of Mathematical Sociology 25(2):163-177, 2001."
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringCENTRALITY
-
Constructor Summary
Constructors Constructor and Description BetweennessCentrality(Graph<V,E> g)Constructor which initializes the algorithmBetweennessCentrality(Graph<V,E> g, boolean rankNodes)BetweennessCentrality(Graph<V,E> g, boolean rankNodes, boolean rankEdges)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetRankScoreKey()the user datum key used to store the rank scoresvoidstep()Evaluate the result of the current iteration.-
Methods inherited from class edu.uci.ics.jung.algorithms.importance.AbstractRanker
getEdgeRankScore, getEdgeRankScore, getEdgeRankScores, getEdgeRankScores, getEdgeWeights, getRankings, getRankScores, getVertexRankScore, getVertexRankScore, getVertexRankScores, getVertexRankScores, isRankingEdges, isRankingNodes, printRankings, reset, setEdgeWeights, setNormalizeRankings, setRemoveRankScoresOnFinalize
-
Methods inherited from class edu.uci.ics.jung.algorithms.util.IterativeProcess
done, evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, relativePrecision, setDesiredPrecision, setMaximumIterations, setPrecision
-
-
-
-
Field Detail
-
CENTRALITY
public static final java.lang.String CENTRALITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BetweennessCentrality
public BetweennessCentrality(Graph<V,E> g)
Constructor which initializes the algorithm- Parameters:
g- the graph whose nodes are to be analyzed
-
-
Method Detail
-
getRankScoreKey
public java.lang.String getRankScoreKey()
the user datum key used to store the rank scores- Specified by:
getRankScoreKeyin classAbstractRanker<V,E>- Returns:
- the key
-
step
public void step()
Description copied from class:IterativeProcessEvaluate the result of the current iteration.- Specified by:
stepin interfaceIterativeContext- Specified by:
stepin classIterativeProcess
-
-
DataMelt 3.0 © DataMelt by jWork.ORG