## 2 Materials and Methods
### Graph Modelling of Functional Brain Networks
#### 2.3.2 Types of Analysis  
Analyses were performed at two levels, always comparing the pre- and post-session RS-EEG recordings: (a) a group level, considering an adjacency matrix describing only the common FC links for all subjects; and (b) the individual level, contemplating the distribution of graph metrics values for each subject.  
The _group level_ analysis considers a group graph\(-G(\rho,r)=\{g_{ij}(\rho,r)\}_{32\times 32}\)--accounting for only the functional connections present for all subjects for a given \((\rho,r)\) pair. Thus, given \(M\) subjects, each element of \(G(\rho,r)\) is defined as:  
\[g_{ij}(\rho,r)=\begin{cases}1,if\ \sum_{S=1}^{M}a_{S,ij}(\rho,r)=M;\\ 0,\text{otherwise.}\end{cases} \tag{5}\]  
Given the relatively small total number of links for \(G(\rho,r)\), only analyses regarding the links themselves were performed (i.e., we considered the group adjacency matrices to be too sparse to yield meaningful graph metrics).  
The _intra-subject analysis_ involved exploring graph metrics' distribution over each electrode during the pre- and post-intervention conditions (since the larger number of links, in turn, complicates a similar analysis approach to the group study). To achieve this, we compared the metrics' distributions, over time, during each condition (i.e., pre- and post-session) and tested for statistically significant differences through a Wilcoxon Sign-Rank test (correcting the \(p\)-value significance threshold of 0.05 with the Bonferroni correction, considering 5 subjects, 4 graph metrics, 32 electrodes and 5 frequency bands). We then explored which regions displayed statistically significant increasing and decreasing trends for each patient. Four metrics were analyzed: (1) the degree, (2) the clustering coefficient, (3) the node path length, and (4) the betweenness centrality. All measures were estimated through the routines of the Graph Connectivity Toolbox for MATLAB, by [PERSON] and [PERSON] (2007). Below we briefly describe the mathematical meaning of these metrics, and their neurophysiological interpretation in our study is left to be discussed in the appropriate section.  
A graph's degree at node \(i\) (\(k_{i}\)) simply expresses the number of connections it makes with the rest of the network, thus being mathematically expressed as the sum of the binarized adjacency matrix's elements:  
\[k_{i}=\sum_{j=1}^{N}a_{ij}. \tag{6}\]  
A node's clustering coefficient (\(CC_{i}\)) considers mainly the connections among its closest neighbors, and can be seen as a measure of how many closed triplets can be formed, in relation to the possible total that could exist, around that node. Thus, a node with high CC has its nearest-neighbors making a large number of connections among themselves, and vice versa. It can be expressed as:  
\[CC_{i}=\frac{2\sum_{j}\sum_{l}a_{ij}a_{il}a_{jl}}{k_{i}(k_{i}-1)}. \tag{7}\]  
The path length between nodes \(i\) and \(j\)- \(l_{ij}\)-, for a binary graph, measures the least amount of edges to be travelled between these two nodes. The average path length for node \(i\), \(l_{i}\), is estimated through averaging \(l_{ij}\).  
Finally, intuitively, the betweenness centrality (BC) measures how often a node acts as a \"bridge\" between any two other nodes in the graph. More formally, the BC for node \(i\) can be defined as the number of shortest path lengths to reach node \(l\), starting from node \(j\), that necessarily pass through node \(i\)--\(\sigma_{jl}(i)\), in relation to the total number of shortest paths between \(j\) and \(l\) (that may not involve \(i\))--\(\sigma_{jl}\):  
\[BC_{i}=\frac{2}{(N-1)(N-2)}\sum_{i\
eq j\
eq l}\frac{\sigma_{jl}(i)}{\sigma_{ jl}}. \tag{8}\]  
The factor \(\frac{2}{(N-1)(N-2)}\) normalizes BC within [0,1].