Class ComplementaryLocalClusteringCoefficient<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.complementary.vertex.ComplementaryLocalClusteringCoefficient<U>
- Type Parameters:
U
- type of the users.
- All Implemented Interfaces:
VertexMetric<U>
public class ComplementaryLocalClusteringCoefficient<U> extends java.lang.Object implements VertexMetric<U>
Computes the local clustering coefficient of a node in the complementary graph.
-
Field Summary
Fields Modifier and Type Field Description private long
autoloops
Number of autoloops in the graph.private java.util.Map<EdgeOrientation,java.util.Map<U,java.lang.Double>>
degrees
The degrees of each node.private java.util.Map<EdgeOrientation,java.util.Map<U,java.lang.Double>>
degreesNoAutoloops
The degrees of each node without autoloops.private Graph<U>
lastGraph
The last graph.private EdgeOrientation
vSel
Selection of the direction of the edge from the studied node to the first node in the triadsprivate EdgeOrientation
wSel
Selection of the direction of the edge from the studied node to the last node in the triads -
Constructor Summary
Constructors Constructor Description ComplementaryLocalClusteringCoefficient()
Default constructor.ComplementaryLocalClusteringCoefficient(EdgeOrientation vSel, EdgeOrientation wSel)
Constructor. -
Method Summary
Modifier and Type Method Description double
averageValue(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.double
compute(Graph<U> graph, U user)
Computes the value of the metric for a single user.private void
initialize(Graph<U> graph)
Initializes all the necessary data to compute the local clustering.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.relison.sna.metrics.VertexMetric
averageValue, compute
-
Field Details
-
vSel
Selection of the direction of the edge from the studied node to the first node in the triads -
wSel
Selection of the direction of the edge from the studied node to the last node in the triads -
autoloops
private long autoloopsNumber of autoloops in the graph. -
lastGraph
The last graph. -
degrees
The degrees of each node. -
degreesNoAutoloops
The degrees of each node without autoloops.
-
-
Constructor Details
-
ComplementaryLocalClusteringCoefficient
public ComplementaryLocalClusteringCoefficient()Default constructor. Relates the incoming neighbourhood and the outgoing one. -
ComplementaryLocalClusteringCoefficient
Constructor.- Parameters:
vSel
- Selection of the direction of the first edges.wSel
- Selection of the direction of the second edges.
-
-
Method Details
-
compute
Description copied from interface:VertexMetric
Computes the value of the metric for a single user.- Specified by:
compute
in interfaceVertexMetric<U>
- Parameters:
graph
- The graph.user
- The user to compute.- Returns:
- the value of the metric.
-
compute
Description copied from interface:VertexMetric
Computes the value of the metric for all the users in the graph.- Specified by:
compute
in interfaceVertexMetric<U>
- Parameters:
graph
- The graph.- Returns:
- A map relating the users with the values of the metric.
-
initialize
Initializes all the necessary data to compute the local clustering. coefficient in the complementary graph.- Parameters:
graph
- the graph.
-
averageValue
Description copied from interface:VertexMetric
Computes the average value of the metric in the graph.- Specified by:
averageValue
in interfaceVertexMetric<U>
- Parameters:
graph
- The graph.- Returns:
- the average value of the metric.
-