de.cesr.more.measures.network.supply.algos
Class MClusteringCoefficient

java.lang.Object
  extended by de.cesr.more.measures.network.supply.algos.MClusteringCoefficient

public class MClusteringCoefficient
extends Object

RS_SoNetA

Date:
12.04.2010

Constructor Summary
MClusteringCoefficient()
           
 
Method Summary
static
<V,E> double
getClusteringCoefficientOverallRatio(Graph<V,E> graph)
          Calculates the clustering coefficient (also known as transitivity) for the given graph.
static
<V,E> double
getClusteringCoefficientPerNode(Graph<V,E> graph)
          Calculates the clustering coefficient (also known as transitivity) for the given graph.
static
<V,E> double
getClusteringCoefficientPerNodeWithNeighbors(Graph<V,E> graph)
          Calculates the clustering coefficient (also known as transitivity) for the given graph.
static
<V,E> double
getClusteringCoefficientRlike(Graph<V,E> graph)
          Calculates the clustering coefficient (also known as transitivity) for the given graph.
static
<V,E> double
getClusteringCoefficientWeightedRatio(Graph<V,E> graph)
          Calculates the clustering coefficient (also known as transitivity) for the given graph.
static
<V,E> double
getClusteringCoefficientWS(Graph<V,E> graph)
          Does not consider the ego itself...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MClusteringCoefficient

public MClusteringCoefficient()
Method Detail

getClusteringCoefficientPerNode

public static <V,E> double getClusteringCoefficientPerNode(Graph<V,E> graph)
Calculates the clustering coefficient (also known as transitivity) for the given graph. Vertices with less than two neighbours contribute 0.0. See, for instance, Vega-Redondo2007, p. 33

Type Parameters:
V -
E -
Parameters:
graph -
Returns:
the clustering coefficient Created by Sascha Holzhauer on 12.04.2010

getClusteringCoefficientPerNodeWithNeighbors

public static <V,E> double getClusteringCoefficientPerNodeWithNeighbors(Graph<V,E> graph)
Calculates the clustering coefficient (also known as transitivity) for the given graph. Vertices with less than two neighbours contribute not at all. See, for instance, Vega-Redondo2007, p. 33

Type Parameters:
V -
E -
Parameters:
graph -
Returns:
the clustering coefficient Created by Sascha Holzhauer on 12.04.2010

getClusteringCoefficientOverallRatio

public static <V,E> double getClusteringCoefficientOverallRatio(Graph<V,E> graph)
Calculates the clustering coefficient (also known as transitivity) for the given graph. TODO check why this leads to different results than R implementation! > the formula in Vega-Rodondo2007 seems to be wrong! The ration of all triples and all triangles - gives more weight to high-degree nodes. Straight implementation of e.g. Vega-Rodondo2007 p. 34 (Vertices with less than two neighbours contribute not at all.)

Type Parameters:
V -
E -
Parameters:
graph -
Returns:
the clustering coefficient Created by Sascha Holzhauer on 12.04.2010

getClusteringCoefficientRlike

public static <V,E> double getClusteringCoefficientRlike(Graph<V,E> graph)
Calculates the clustering coefficient (also known as transitivity) for the given graph. The algorithm conforms the one implemented in igraph (R library). It counts the overall number of triples and calculated the ratio of triples and triangles.

Type Parameters:
V -
E -
Parameters:
graph -
Returns:
the clustering coefficient Created by Sascha Holzhauer on 12.04.2010

getClusteringCoefficientWeightedRatio

public static <V,E> double getClusteringCoefficientWeightedRatio(Graph<V,E> graph)
Calculates the clustering coefficient (also known as transitivity) for the given graph. The ration of all triples and all triangles - gives more weight to high-degree nodes. Straight forward according to Goyal2009 p. 19 (Vertices with less than two neighbours contribute not at all.) Corresponds to R implementation.

Type Parameters:
V -
E -
Parameters:
graph -
Returns:
the clustering coefficient Created by Sascha Holzhauer on 12.04.2010

getClusteringCoefficientWS

public static <V,E> double getClusteringCoefficientWS(Graph<V,E> graph)
Does not consider the ego itself... As described e.g. in Watts1998, corresponds to Vega-Rodondo2007 (less efficient) (Vertices with less than two neighbours contribute 0.0.)

Type Parameters:
V -
E -
Parameters:
graph -
Returns:
Created by Sascha Holzhauer on 06.05.2010