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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • DegreeGini

      public DegreeGini​(EdgeOrientation orientation)
      Constructor.
      Parameters:
      orientation - Orientation of the edges.
  • Method Details

    • compute

      public double compute​(Graph<U> graph)
      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 interface GraphMetric<U>
      Parameters:
      graph - the graph.
      Returns:
      the computed value.
    • computeDirected

      private double computeDirected​(DirectedGraph<U> graph)
      Computes the Degree Gini for the directed graph case.
      Parameters:
      graph - The directed graph.
      Returns:
      The value of the metric.
    • computeUndirected

      private double computeUndirected​(UndirectedGraph<U> graph)
      Computes the Degree Gini for the undirected graph case.
      Parameters:
      graph - The undirected graph.
      Returns:
      The value of the metric.