Class Coreness<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.vertex.Coreness<U>
- Type Parameters:
U
- type of the users.
References:- Seidman, S.B. Network structure and minimum degree. Social Networks 5(3), pp. 269-287 (1983)
- Batagelj, V., Zaversnik. An O(m) Algorithm for Cores Decomposition of networks. arXiv (2003)
- All Implemented Interfaces:
VertexMetric<U>
public class Coreness<U> extends java.lang.Object implements VertexMetric<U>
Computes the coreness (or core number) of the nodes. A k-core of a graph is the maximal
subgraph such that each vertex in the subgraph has, at least, degree k. The coreness of a
node is k if and only if it belongs to the k-core, but not to the (k+1)-core.
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientation
orient
The orientation to choose for the edges. -
Constructor Summary
Constructors Constructor Description Coreness(EdgeOrientation orient)
Constructor. -
Method Summary
Modifier and Type Method Description java.util.Map<U,java.lang.Double>
compute(Graph<U> graph)
Computes the value of the metric for all the users in the graph.java.util.Map<U,java.lang.Double>
compute(Graph<U> graph, java.util.stream.Stream<U> users)
Computes the value of the metric for a subset of the users in the graph.double
compute(Graph<U> graph, U user)
Computes the value of the metric for a single user.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, averageValue
-
Field Details
-
orient
The orientation to choose for the edges.
-
-
Constructor Details
-
Coreness
Constructor.- Parameters:
orient
- the orientation to choose for the 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
public java.util.Map<U,java.lang.Double> compute(Graph<U> graph, java.util.stream.Stream<U> users)Description copied from interface:VertexMetric
Computes the value of the metric for a subset of the users in the graph.- Specified by:
compute
in interfaceVertexMetric<U>
- Parameters:
graph
- the graph.users
- the stream of users.- Returns:
- a map relating users with the values of the metric. Nodes not in the graph will not be included in the map.
-
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.
-