Compute graph transitivity, the fraction of all possible triangles present in G.
Possible triangles are identified by the number of “triads” (two edges with a shared vertex).
The transitivity is
Parameters: G (graph) – Returns: out – Transitivity Return type: float
>>> G = nx.complete_graph(5) >>> print(nx.transitivity(G)) 1.0