public class NewmanBetweennessCentrality extends AbstractRanker
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,true); ranker.evaluate(); ranker.printRankings();Running time is: O(mn)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CENTRALITY |
DEFAULT_EDGE_WEIGHT_KEY
Constructor and Description |
---|
NewmanBetweennessCentrality(Graph g,
boolean rankNodes,
boolean rankEdges)
Constructor which initializes the algorithm
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeBetweenness(Graph graph) |
protected double |
evaluateIteration()
Evaluate the result of the current interation.
|
java.lang.String |
getRankScoreKey()
The user datum key used to store the rank scores.
|
assignDefaultEdgeTransitionWeights, finalizeIterations, getEdgeWeight, getEdgeWeightKeyName, getGraph, getRankings, getRankScore, getRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, reinitialize, setEdgeWeight, setNormalizeRankings, setRankScore, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKey
evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations
public static final java.lang.String CENTRALITY
public NewmanBetweennessCentrality(Graph g, boolean rankNodes, boolean rankEdges)
g
- graph whose nodes are to be analysedrankNodes
- if true, computes node betweenness centrality; if false, computed edge betweenness centralityprotected void computeBetweenness(Graph graph)
public java.lang.String getRankScoreKey()
getRankScoreKey
in class AbstractRanker
protected double evaluateIteration()
IterativeProcess
evaluateIteration
in class IterativeProcess