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
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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class AbstractRanker
edgeRankScores, vertexRankScores -
Constructor Summary
ConstructorsConstructorDescriptionBetweennessCentrality(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
Modifier and TypeMethodDescriptionprotected voidcomputeBetweenness(Graph<V, E> graph) the user datum key used to store the rank scoresprivate voidinitializeData(Graph<V, E> g, Map<V, BetweennessCentrality<V, E>.BetweennessData> decorator) voidstep()Evaluate the result of the current iteration.Methods inherited from class AbstractRanker
assignDefaultEdgeTransitionWeights, finalizeIterations, getEdgeRankScore, getEdgeRankScore, getEdgeRankScores, getEdgeRankScores, getEdgeWeight, getEdgeWeights, getGraph, getRankings, getRankScores, getVertexCount, getVertexRankScore, getVertexRankScore, getVertexRankScores, getVertexRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, removeEdgeRankScore, removeEdgeRankScore, removeVertexRankScore, removeVertexRankScore, reset, setEdgeRankScore, setEdgeRankScore, setEdgeWeight, setEdgeWeights, setNormalizeRankings, setRemoveRankScoresOnFinalize, setVertexRankScore, setVertexRankScoreMethods inherited from class IterativeProcess
done, evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations, setPrecision
-
Field Details
-
CENTRALITY
- See Also:
-
-
Constructor Details
-
BetweennessCentrality
-
BetweennessCentrality
-
BetweennessCentrality
-
-
Method Details
-
computeBetweenness
-
initializeData
private void initializeData(Graph<V, E> g, Map<V, BetweennessCentrality<V, E>.BetweennessData> decorator) -
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
-