Class ClusteringCoefficient<U>

java.lang.Object
es.uam.eps.ir.relison.sna.metrics.graph.ClusteringCoefficient<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
GraphMetric<U>

public class ClusteringCoefficient<U>
extends java.lang.Object
implements GraphMetric<U>
Computes the global clustering coefficient of a graph.

Reference: M.E.J. Newman. Networks: an introduction (2010)

  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int triangles
    Number of triangles in the graph.
    private int triplets
    Number of triplets in the graph.
    private EdgeOrientation vSel
    Orientation for selecting the neighbours of the studied node.
    private EdgeOrientation wSel
    Orientation for selecting the neighbours of the studied node.
  • Constructor Summary

    Constructors 
    Constructor Description
    ClusteringCoefficient()
    Constructor.
    ClusteringCoefficient​(EdgeOrientation vSel, EdgeOrientation wSel)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    double compute​(Graph<U> graph)
    Computes the value.

    Methods inherited from class java.lang.Object

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

    • vSel

      private final EdgeOrientation vSel
      Orientation for selecting the neighbours of the studied node.
    • wSel

      private final EdgeOrientation wSel
      Orientation for selecting the neighbours of the studied node.
    • triangles

      private int triangles
      Number of triangles in the graph.
    • triplets

      private int triplets
      Number of triplets in the graph.
  • Constructor Details

    • ClusteringCoefficient

      public ClusteringCoefficient()
      Constructor. Applies the usual directed clustering coefficient of a graph.
    • ClusteringCoefficient

      public ClusteringCoefficient​(EdgeOrientation vSel, EdgeOrientation wSel)
      Constructor. This constructor allows to specify the direction of the clustering coefficient metrics.
      Parameters:
      vSel - First selection of nodes.
      wSel - Second selection of nodes.
  • Method Details

    • compute

      public double compute​(Graph<U> graph)
      Description copied from interface: GraphMetric
      Computes the value.
      Specified by:
      compute in interface GraphMetric<U>
      Parameters:
      graph - graph metric.
      Returns:
      the value of the metric.