How do we count the numbers of traingles (i.e., different triads of vertex $u,v,w$ such that edges $u-v,v-w,w-u \in E$ ) in a given graph $G$?It is obvious that it can be done in $O(N^2)$: is there anything better?
Number of triangles in an undirected graph
graphs;graph theory