The next step is to compute the clustering coefficient, which quantifies the tendency for the nodes to form cliques. If a node has fewer than 2 neighbors, the clustering coefficient is undefined, so w...The next step is to compute the clustering coefficient, which quantifies the tendency for the nodes to form cliques. If a node has fewer than 2 neighbors, the clustering coefficient is undefined, so we return np.nan, which is a special value that indicates “Not a Number”. Otherwise we compute the number of possible edges among the neighbors, count the number of those edges that actually exist, and return the fraction that exist.