Class DegreeGini<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.graph.DegreeGini<U>
- Type Parameters:
U
- Type of the users.
- All Implemented Interfaces:
GraphMetric<U>
public class DegreeGini<U> extends java.lang.Object implements GraphMetric<U>
Computes the Gini metric between the different nodes in the graph (auto-nodes are
not taken into account). This metric tries to see how equally the degree is
distributed between the different nodes.
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientation
orientation
Orientation of the edges. -
Constructor Summary
Constructors Constructor Description DegreeGini(EdgeOrientation orientation)
Constructor. -
Method Summary
Modifier and Type Method Description double
compute(Graph<U> graph)
Computes the degree Gini.private double
computeDirected(DirectedGraph<U> graph)
Computes the Degree Gini for the directed graph case.private double
computeUndirected(UndirectedGraph<U> graph)
Computes the Degree Gini for the undirected graph case.
-
Field Details
-
orientation
Orientation of the edges.
-
-
Constructor Details
-
DegreeGini
Constructor.- Parameters:
orientation
- Orientation of the edges.
-
-
Method Details
-
compute
Computes the degree Gini. It is computed only if there is, at least, two nodes. If not, NaN is returned. If there is no edges, then, the value is equal to 1.0 (every node has the same degree).- Specified by:
compute
in interfaceGraphMetric<U>
- Parameters:
graph
- the graph.- Returns:
- the computed value.
-
computeDirected
Computes the Degree Gini for the directed graph case.- Parameters:
graph
- The directed graph.- Returns:
- The value of the metric.
-
computeUndirected
Computes the Degree Gini for the undirected graph case.- Parameters:
graph
- The undirected graph.- Returns:
- The value of the metric.
-