Question: The number of all triangles of a graph

Let G be an undirected graph having the vertices V={1,...,n}. A subset {i,j,k} is said to be a triangle of G if the complete graph with these vertices is a subgraph of G.
How to find the number of all triangles of G in an optimal way? The code should work with RandomGraph(400,1000).

Please Wait...