Class EdgeGini<U>

java.lang.Object
es.uam.eps.ir.relison.sna.metrics.graph.EdgeGini<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
GraphMetric<U>
Direct Known Subclasses:
CompleteEdgeGini, InterEdgeGini, SemiCompleteEdgeGini

public class EdgeGini<U>
extends java.lang.Object
implements GraphMetric<U>
Computes the value for Gini for the different pairs of nodes.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private EdgeGiniMode mode  
  • Constructor Summary

    Constructors 
    Constructor Description
    EdgeGini​(EdgeGiniMode mode)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    double compute​(Graph<U> graph)
    Computes the Pair Gini of the nodes (how equally distributed are links between two different nodes)
    private double computeDirected​(DirectedMultiGraph<U> graph)
    Computes the Pair Gini index for the directed graph case.
    private double computeUndirected​(UndirectedMultiGraph<U> graph)
    Computes the Pair Gini index 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

    • EdgeGini

      public EdgeGini​(EdgeGiniMode mode)
      Constructor.
      Parameters:
      mode - Execution mode. If the mode is COMPLETE, iterates over each pair of vertices in the graph. If the mode is SEMICOMPLETE, iterates over each pair, but autoloops are contained in a single category. If the mode is INTERLINKS, only links between different edges are applied.
  • Method Details

    • compute

      public double compute​(Graph<U> graph)
      Computes the Pair Gini of the nodes (how equally distributed are links between two different nodes)
      Specified by:
      compute in interface GraphMetric<U>
      Parameters:
      graph - the graph.
      Returns:
      if it is not a multigraph, then, the value is equals to NaN (it does not make sense, since it depends on the density of the graph).
    • computeDirected

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

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