Class BetweennessCentrality<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality<V,E>
- All Implemented Interfaces:
EdgeScorer<E,,Double> VertexScorer<V,Double>
public class BetweennessCentrality<V,E>
extends Object
implements VertexScorer<V,Double>, EdgeScorer<E,Double>
Computes betweenness centrality for each vertex and edge in the graph.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<V, BetweennessCentrality<V, E>.edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData> -
Constructor Summary
ConstructorsConstructorDescriptionBetweennessCentrality(Graph<V, E> graph) Calculates betweenness scores based on the all-pairs unweighted shortest paths in the graph.BetweennessCentrality(Graph<V, E> graph, com.google.common.base.Function<? super E, ? extends Number> edge_weights) Calculates betweenness scores based on the all-pairs weighted shortest paths in the graph. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcomputeBetweenness(Queue<V> queue, com.google.common.base.Function<? super E, ? extends Number> edge_weights) getEdgeScore(E e) getVertexScore(V v) protected voidinitialize(Graph<V, E> graph)
-
Field Details
-
graph
-
vertex_scores
-
edge_scores
-
vertex_data
protected Map<V,BetweennessCentrality<V, vertex_dataE>.edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData>
-
-
Constructor Details
-
BetweennessCentrality
Calculates betweenness scores based on the all-pairs unweighted shortest paths in the graph.- Parameters:
graph- the graph for which the scores are to be calculated
-
BetweennessCentrality
public BetweennessCentrality(Graph<V, E> graph, com.google.common.base.Function<? super E, ? extends Number> edge_weights) Calculates betweenness scores based on the all-pairs weighted shortest paths in the graph.NOTE: This version of the algorithm may not work correctly on all graphs; we're still working out the bugs. Use at your own risk.
- Parameters:
graph- the graph for which the scores are to be calculatededge_weights- the edge weights to be used in the path length calculations
-
-
Method Details
-
initialize
-
computeBetweenness
-
getVertexScore
- Specified by:
getVertexScorein interfaceVertexScorer<V,E> - Parameters:
v- the vertex whose score is requested- Returns:
- the algorithm's score for this vertex
-
getEdgeScore
- Specified by:
getEdgeScorein interfaceEdgeScorer<V,E> - Parameters:
e- the edge whose score is requested- Returns:
- the algorithm's score for this edge
-