edu.uci.ics.jung.statistics
Class GraphStatistics

java.lang.Object
  extended byedu.uci.ics.jung.statistics.GraphStatistics

public class GraphStatistics
extends java.lang.Object

A set of statistical measures for structural properties of a graph

Author:
Scott White

Constructor Summary
GraphStatistics()
           
 
Method Summary
static cern.colt.list.DoubleArrayList averageDistances(Graph graph)
          The set of average shortest path distances for each vertex.
static cern.colt.list.DoubleArrayList clusteringCoefficients(UndirectedGraph graph)
          For each vertex, the net fraction of edges that actually exist in the neighborhood of distance 1 around each vertex vs all possible edges that could exist are computed The clustering coefficient measures the degree to which a node's neighbors are neighbors with each other Note: You can use cern.jet.stat.Descriptive to compute various statistics from the DoubleArrayList
static Histogram createHistogram(cern.colt.list.DoubleArrayList values, double min, int numBins, double binWidth)
          Creates a histogram from a sequence of doubles
static int diameter(Graph g)
          Computes the diameter (maximum shortest path length between any vertex pair) of the graph, ignoring edge weights.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphStatistics

public GraphStatistics()
Method Detail

clusteringCoefficients

public static cern.colt.list.DoubleArrayList clusteringCoefficients(UndirectedGraph graph)
For each vertex, the net fraction of edges that actually exist in the neighborhood of distance 1 around each vertex vs all possible edges that could exist are computed The clustering coefficient measures the degree to which a node's neighbors are neighbors with each other Note: You can use cern.jet.stat.Descriptive to compute various statistics from the DoubleArrayList

Parameters:
graph - the graph for which the clustering coefficients are to be computed
Returns:
the set of clustering coefficients for each vertex

averageDistances

public static cern.colt.list.DoubleArrayList averageDistances(Graph graph)
The set of average shortest path distances for each vertex. For each vertex, the shortest path distance to every other vertex is measured and the average is computed. Note: You can use cern.jet.stat.Descriptive to compute various statistics from the DoubleArrayList

Parameters:
graph - the graph whose average distances are to be computed
Returns:
the set of average shortest path distances for each vertex (to every other vertex); However, if the graph is not strongly connected null will be returned since the graph diameter is infinite

diameter

public static int diameter(Graph g)
Computes the diameter (maximum shortest path length between any vertex pair) of the graph, ignoring edge weights.

Parameters:
g - the graph
Returns:
the diameter

createHistogram

public static Histogram createHistogram(cern.colt.list.DoubleArrayList values,
                                        double min,
                                        int numBins,
                                        double binWidth)
Creates a histogram from a sequence of doubles

Parameters:
values - the sequence of doubles
min - the minimum value to bin off of
numBins - the number of bins
binWidth - the width of the bin
Returns:
a histogram