ó žÃÒYc@sVddlZddlmZdgZdjddgƒZedƒdd „ƒZdS( iÿÿÿÿN(tnot_implemented_fortaverage_clusterings s)Fred Morstatter s%Jordi Torrents tdirectedièc CsÇt|ƒ}d}t|ƒ}x˜gt|ƒD]}ttjƒ|ƒ^q.D]g}t|||ƒ}t|ƒdkr€qNntj|dƒ\}}|||krN|d7}qNqNW|t|ƒS(s�Estimates the average clustering coefficient of G. The local clustering of each node in `G` is the fraction of triangles that actually exist over all possible triangles in its neighborhood. The average clustering coefficient of a graph `G` is the mean of local clusterings. This function finds an approximate average clustering coefficient for G by repeating `n` times (defined in `trials`) the following experiment: choose a node at random, choose two of its neighbors at random, and check if they are connected. The approximate coefficient is the fraction of triangles found over the number of trials [1]_. Parameters ---------- G : NetworkX graph trials : integer Number of trials to perform (default 1000). Returns ------- c : float Approximated average clustering coefficient. References ---------- .. [1] Schank, Thomas, and Dorothea Wagner. Approximating clustering coefficient and transitivity. Universität Karlsruhe, Fakultät für Informatik, 2004. http://www.emis.ams.org/journals/JGAA/accepted/2005/SchankWagner2005.9.2.pdf iii(tlentlisttrangetinttrandomtsampletfloat( tGttrialstnt trianglestnodestitnbrstutv((sŽ/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/approximation/clustering_coefficient.pyRs$  6(Rtnetworkx.utilsRt__all__tjoint __author__R(((sŽ/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/algorithms/approximation/clustering_coefficient.pyts