Home | Trees | Index | Help |
|
---|
Package networkx :: Module cluster |
|
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
Function Summary | |
---|---|
Average clustering coefficient for a graph. | |
Clustering coefficient for each node in nbunch | |
Transitivity (fraction of transitive triangles) for a graph | |
Return number of triangles for nbunch of nodes. |
Variable Summary | |
---|---|
str |
__author__ = 'Aric Hagberg (hagberg@lanl.gov)\nPieter Sw...
|
str |
__credits__ = ''
|
str |
__date__ = '$Date: 2005-06-14 12:48:10 -0600 (Tue, 14 Ju...
|
str |
__revision__ = '$Revision: 1012 $'
|
Function Details |
---|
average_clustering(G)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(G, nbunch=None, **kwds)Clustering coefficient for each node in nbunch |
transitivity(G)Transitivity (fraction of transitive triangles) for a graph |
triangles(G, nbunch=None, **kwds)Return number of triangles for nbunch of nodes. If nbunch is None, then return triangles for every node. Note: Each triangle is counted three times: once at each vertex. |
Variable Details |
---|
__author__
|
__credits__
|
__date__
|
__revision__
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Aug 21 08:06:58 2005 | http://epydoc.sf.net |