public class BetweennessCentrality<V,E> extends Object implements VertexScorer<V,Double>, EdgeScorer<E,Double>
Modifier and Type | Field and Description |
---|---|
protected Map<E,Double> |
edge_scores |
protected Graph<V,E> |
graph |
protected Map<V,edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData> |
vertex_data |
protected Map<V,Double> |
vertex_scores |
Constructor and Description |
---|
BetweennessCentrality(Graph<V,E> graph)
Calculates betweenness scores based on the all-pairs unweighted shortest paths
in the graph.
|
BetweennessCentrality(Graph<V,E> graph,
org.apache.commons.collections4.Transformer<E,? extends Number> edge_weights)
Calculates betweenness scores based on the all-pairs weighted shortest paths in the
graph.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeBetweenness(Queue<V> queue,
org.apache.commons.collections4.Transformer<E,? extends Number> edge_weights) |
Double |
getEdgeScore(E e)
Returns the algorithm's score for this edge.
|
Double |
getVertexScore(V v)
Returns the algorithm's score for this vertex.
|
protected void |
initialize(Graph<V,E> graph) |
public BetweennessCentrality(Graph<V,E> graph)
graph
- the graph for which the scores are to be calculatedpublic BetweennessCentrality(Graph<V,E> graph, org.apache.commons.collections4.Transformer<E,? extends Number> edge_weights)
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.
graph
- the graph for which the scores are to be calculatededge_weights
- the edge weights to be used in the path length calculationsprotected void computeBetweenness(Queue<V> queue, org.apache.commons.collections4.Transformer<E,? extends Number> edge_weights)
public Double getVertexScore(V v)
VertexScorer
getVertexScore
in interface VertexScorer<V,Double>
public Double getEdgeScore(E e)
EdgeScorer
getEdgeScore
in interface EdgeScorer<E,Double>
Copyright © 2015. All rights reserved.