Class ComplementaryDegree<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.complementary.vertex.ComplementaryDegree<U>
- Type Parameters:
U- Type of the users.
- All Implemented Interfaces:
VertexMetric<U>
public class ComplementaryDegree<U> extends java.lang.Object implements VertexMetric<U>
Computes the degree of a given user in a graph.
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientationorientationThe orientation in which the score is computed. -
Constructor Summary
Constructors Constructor Description ComplementaryDegree(EdgeOrientation orientation)Constructor. -
Method Summary
Modifier 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.private doublecomputeDirected(DirectedGraph<U> directedGraph, U user)Computes the degree of the user in a directed graph.private doublecomputeUndirected(UndirectedGraph<U> undirectedGraph, U user)Computes the degree of the user in an undirected graph.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.sna.metrics.VertexMetric
averageValue, compute
-
Field Details
-
orientation
The orientation in which the score is computed.
-
-
Constructor Details
-
ComplementaryDegree
Constructor.- Parameters:
orientation- The orientation in which to take the value.
-
-
Method Details
-
compute
Description copied from interface:VertexMetricComputes the value of the metric for a single user.- Specified by:
computein interfaceVertexMetric<U>- Parameters:
graph- The graph.user- The user to compute.- Returns:
- the value of the metric.
-
compute
Description copied from interface:VertexMetricComputes the value of the metric for all the users in the graph.- Specified by:
computein interfaceVertexMetric<U>- Parameters:
graph- The graph.- Returns:
- A map relating the users with the values of the metric.
-
averageValue
Description copied from interface:VertexMetricComputes the average value of the metric in the graph.- Specified by:
averageValuein interfaceVertexMetric<U>- Parameters:
graph- The graph.- Returns:
- the average value of the metric.
-
computeDirected
Computes the degree of the user in a directed graph.- Parameters:
directedGraph- The directed graph to take.user- The user.- Returns:
- the corresponding degree value.
-
computeUndirected
Computes the degree of the user in an undirected graph.- Parameters:
undirectedGraph- The undirected graph to take.user- The user.- Returns:
- the degree of the user in that graph.
-