Triangle count (source code)

= Triangle count
{title2=$T(G)$}

The triangle count of a finite simple <graph> is the number of unordered triples of <vertices> inducing a <triangle in a graph>. In a <tripartite graph> with parts $X,Y,Z$ and adjacency <indicator functions> $g_{XY},g_{YZ},g_{XZ}$, it equals $|X||Y||Z|\mathbb E_{x,y,z}g_{XY}(x,y)g_{YZ}(y,z)g_{XZ}(x,z)$, using uniform <expectations> on nonempty parts.