Determining the number of trinities in a graph

71 Views Asked by At

Based on the following adjacency matrix and the formula trace(A³)/6:

enter image description here

How can I use Mathematica to determine the number of trinitys? (also known as triangles or 3-cliques)

1

There are 1 best solutions below

5
On BEST ANSWER

The following command does the job:

Trace[MatrixPower[A,3]]/6