Clustering coefficient (source code)

= Clustering coefficient
{title2=$C_i=2e_i/[k_i(k_i-1)]$}

For a <vertex> with $k_i\geq2$ neighbours in a <simple graph>, its local <clustering coefficient> is $C_i=e_i/\binom{k_i}{2}$, where $e_i$ counts <edges> among those neighbours. It is the fraction of possible neighbour-neighbour edges that are present. A common network summary averages these local coefficients, setting them to zero for degrees below two; this differs from weighting by the number of neighbour pairs.