Class NodeBetweenness<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.distance.vertex.NodeBetweenness<U>
- Type Parameters:
- U- Type of the users.
- All Implemented Interfaces:
- VertexMetric<U>
public class NodeBetweenness<U> extends java.lang.Object implements VertexMetric<U>
Computes the betweenness of the nodes of a graph.
 
Reference: M.E.J. Newman, M. Girvan. Finding and evaluating community structure in networks. Physical Review E 69(2), pp. 1-16 (2004)
- 
Field SummaryFields Modifier and Type Field Description private DistanceCalculator<U>dcDistance calculator.private booleannormalizeIndicates whether we have to normalize the value of the metric or not.
- 
Constructor SummaryConstructors Constructor Description NodeBetweenness(boolean normalize)Constructor.NodeBetweenness(DistanceCalculator<U> dc, boolean normalize)Constructor.
- 
Method SummaryModifier and Type Method Description doubleaverageValue(Graph<U> graph)Computes the average value of the metric in the graph.java.util.Map<U,java.lang.Double>compute(Graph<U> graph)Computes the value of the metric for all the users in the graph.doublecompute(Graph<U> graph, U user)Computes the value of the metric for a single user.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.sna.metrics.VertexMetricaverageValue, compute
- 
Field Details
- 
Constructor Details- 
NodeBetweennesspublic NodeBetweenness(boolean normalize)Constructor.- Parameters:
- normalize- true if we have to normalize the value of the metric, false otherwise.
 
- 
NodeBetweennessConstructor.- Parameters:
- dc- Distance calculator.
- normalize- true if we have to normalize the value of the metric, false otherwise.
 
 
- 
- 
Method Details- 
computeDescription copied from interface:VertexMetricComputes the value of the metric for a single user.- Specified by:
- computein interface- VertexMetric<U>
- Parameters:
- graph- The graph.
- user- The user to compute.
- Returns:
- the value of the metric.
 
- 
computeDescription copied from interface:VertexMetricComputes the value of the metric for all the users in the graph.- Specified by:
- computein interface- VertexMetric<U>
- Parameters:
- graph- The graph.
- Returns:
- A map relating the users with the values of the metric.
 
- 
averageValueDescription copied from interface:VertexMetricComputes the average value of the metric in the graph.- Specified by:
- averageValuein interface- VertexMetric<U>
- Parameters:
- graph- The graph.
- Returns:
- the average value of the metric.
 
 
-