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,
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.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeBetweenness(Queue<V> queue,
com.google.common.base.Function<? super E,? extends Number> edge_weights) |
Double |
getEdgeScore(E e) |
Double |
getVertexScore(V v) |
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, com.google.common.base.Function<? super 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, com.google.common.base.Function<? super E,? extends Number> edge_weights)
public Double getVertexScore(V v)
getVertexScore in interface VertexScorer<V,Double>v - the vertex whose score is requestedpublic Double getEdgeScore(E e)
getEdgeScore in interface EdgeScorer<E,Double>e - the edge whose score is requestedCopyright © 2016. All rights reserved.