metrics\]Let $\mathcal{G}$ be a simple graph. Denote by $e$, $\Delta $, $Q$ and $\Pi $ the total number of edges, triangles, quadrangles and pentagons in $\mathcal{G}$, respectively. Define $W_{2}=%
\sum_{i=1}^{n}d_{i}^{2}$ and $\mathcal{C}_{dt}=\sum_{i}d_{i}t_{i}$, where $%
t_{i}$ is the number of triangles touching node $i$. Then,$$\begin{aligned}
m_{4}\left( A_{\mathcal{G}}\right) &=&\frac{1}{n}\left[ 8Q+2W_{2}-e\right] ,
\label{Fourth Moment Subgraphs} \\
m_{5}\left( A_{\mathcal{G}}\right) &=&\frac{1}{n}\left[ 10\Pi +10\mathcal{C}%
_{dt}-30\Delta \right] .  \label{Fifth Moment Subgraphs}\end{aligned}$$

Observe how, as we increase the order of the moments, more complicated structural features appear in the expressions. In the following example, we illustrate how to use our expressions to compute the spectral moments of an online social network from empirical structural data.

![image](Fig7C.jpg){width="100.00000%"}

In this example, we study a subgraph of Facebook obtained by exploring the online social network around a particular node, as follows. From a particular starting node, we crawl the network (using a breadth-first search) until we discover the set of all nodes that are within a radius $2$ from the starting node. Using this set of nodes, and their interconnections (friendships), we construct a social subgraph $\mathcal{F}$ that has $2,404$ nodes and $22,786$ edges. Using this real dataset, we compute the degrees $%
d_{i}$, the number of triangles $t_{i}$, quadrangles $q_{i}$, 