Home | Trees | Indices | Help |
---|
|
Compute clustering coefficients and transitivity of graphs.
For each node find the fraction of possible triangles that are triangles, c_i = triangles_i / (k_i*(k_i-1)/2) where k_i is the degree of node i.
A coefficient for the whole graph is the average C = avg(c_i)
Find the fraction of all possible triangles which are in fact triangles. Possible triangles are identified by the number of "triads" (two edges with a shared vertex)
T = 3*triangles/triads
Date: $Date: 2005-06-14 12:48:10 -0600 (Tue, 14 Jun 2005) $
Author: Aric Hagberg (hagberg@lanl.gov) Pieter Swart (swart@lanl.gov) Dan Schult (dschult@colgate.edu)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__credits__ =
|
|||
__revision__ =
|
|
Return number of triangles for nbunch of nodes. If nbunch is None, then return triangles for every node. If with_labels is True, return a dict keyed by node. Note: Each triangle is counted three times: once at each vertex. |
Average clustering coefficient for a graph. Note: this is a space saving routine; It might be faster to use clustering to get a list and then take average. |
Clustering coefficient for each node in nbunch. If with_labels is True, return a dict keyed by node. If both with_labels and weights are True, return both a clustering coefficient dict keyed by node and a dict of weights based on degree. The weights are the fraction of connected triples in the graph which include the keyed node. Ths is useful in moving from transitivity for clustering coefficient and back. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Sun Aug 17 12:04:43 2008 | http://epydoc.sourceforge.net |