# Math Insight

### Clustering coefficient definition

The clustering coefficient1 of an undirected graph is a measure of the number of triangles in a graph.

The clustering coefficient of a graph is based on a local clustering coefficient for each node \begin{gather*} C_i = \frac{\text{number of triangles connected to node $i$}}{\text{number of triples centered around node $i$}}, \end{gather*} where a triple centered around node $i$ is a set of two edges connected to node $i$. (If the degree of node $i$ is 0 or 1, we which gives us $C_i=0/0$, we can set $C_i=0$.)

The clustering coefficient for the whole graph is the average of the local values $C_i$ \begin{gather*} C= \frac{1}{n}\sum_{i=1}^n C_i, \end{gather*} where $n$ is the number of nodes in the network.

By definition $0 \le C_i \le 1$ and $0 \le C \le 1$.

The clustering coefficient of a graph is closely related to the transitivity of a graph, as both measure the relative frequency of triangles.
{"ft_lang_label":"__label__en","ft_lang_prob":0.84359354,"math_prob":0.9993259,"size":942,"snap":"2020-34-2020-40","text_gpt3_token_len":258,"char_repetition_ratio":0.15245202,"word_repetition_ratio":0.039473683,"special_character_ratio":0.27070063,"punctuation_ratio":0.06010929,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.999984,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-29T17:42:29Z\",\"WARC-Record-ID\":\"<urn:uuid:98e76b6b-2ba7-4f50-a7e2-19ec8d0493a3>\",\"Content-Length\":\"11839\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ae58ce93-1455-4428-9d24-7ecdfce63bd6>\",\"WARC-Concurrent-To\":\"<urn:uuid:f67ce4c2-ba67-4b7d-8e33-7fbc1ffda11d>\",\"WARC-IP-Address\":\"128.101.96.136\",\"WARC-Target-URI\":\"https://mathinsight.org/definition/clustering_coefficient\",\"WARC-Payload-Digest\":\"sha1:Y6TIIDH24VBWG3DDNGYKBFCI24XLJ2Z4\",\"WARC-Block-Digest\":\"sha1:BSQOG5B7YCAQUBFU7NVVQHG2O333QX2S\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400202418.22_warc_CC-MAIN-20200929154729-20200929184729-00193.warc.gz\"}"}