Class ClusteringCoefficient<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.graph.ClusteringCoefficient<U>
- Type Parameters:
U
- Type of the users.
- All Implemented Interfaces:
GraphMetric<U>
public class ClusteringCoefficient<U> extends java.lang.Object implements GraphMetric<U>
Computes the global clustering coefficient of a graph.
Reference: M.E.J. Newman. Networks: an introduction (2010)
-
Field Summary
Fields Modifier and Type Field Description private int
triangles
Number of triangles in the graph.private int
triplets
Number of triplets in the graph.private EdgeOrientation
vSel
Orientation for selecting the neighbours of the studied node.private EdgeOrientation
wSel
Orientation for selecting the neighbours of the studied node. -
Constructor Summary
Constructors Constructor Description ClusteringCoefficient()
Constructor.ClusteringCoefficient(EdgeOrientation vSel, EdgeOrientation wSel)
Constructor. -
Method Summary
-
Field Details
-
Constructor Details
-
ClusteringCoefficient
public ClusteringCoefficient()Constructor. Applies the usual directed clustering coefficient of a graph. -
ClusteringCoefficient
Constructor. This constructor allows to specify the direction of the clustering coefficient metrics.- Parameters:
vSel
- First selection of nodes.wSel
- Second selection of nodes.
-
-
Method Details
-
compute
Description copied from interface:GraphMetric
Computes the value.- Specified by:
compute
in interfaceGraphMetric<U>
- Parameters:
graph
- graph metric.- Returns:
- the value of the metric.
-