Balance-energy of resting state network in obsessive-compulsive disorder

Stability of the brain functional network is directly linked to organization of synchronous and anti-synchronous activities. Nevertheless, impact of arrangement of positive and negative links called links topology requires to be well understood. In this study, we investigated how topology of the functional links reduce balance-energy of the brain network in obsessive-compulsive disorder (OCD) and push the network to a more stable state as compared to healthy controls. Therefore, functional associations between the regions were measured using the phase synchrony between the EEG activities. Subsequently, balance-energy of the brain functional network was estimated based on the quality of triadic interactions. Occurrence rates of four different types of triadic interactions including weak and strong balanced, and unbalanced interactions were compared. In addition, impact of the links topology was also investigated by looking at the tendency of positive and negative links to making hubs. Our results showed although the number of positive and negative links were not statistically different between OCD and healthy controls, but positive links in OCDs’ brain networks have more tendency to make hub. Moreover, lower number of unbalanced triads and higher number of strongly balanced triad reduced the balance-energy in OCDs’ brain networks that conceptually has less requirement to change. We hope these findings could shed a light on better understanding of brain functional network in OCD.

Then, considering no significant differences in terms of the total number of positive and negative links between the groups, the effect of the topology of the links was investigated by comparison between the global tendency in the network to make positive and negative hubs introduced as the TMH by Saberi and colleagues 40 . The TMH_n and the TMH_p metrics of OCDs were compared with CONs and results are presented in panels F and G of Fig. 1, and the last two rows of Table 1. As demonstrated, despite no significant differences in terms of the number of negative links, the functional links in the OCD group had more tendency to make hubs of negative links at Beta II (p = 0.02, z = 2.24) and Gamma (p = 0.023, z = 2.28) bands. As presented in Table 1, the tendency for making hub with positive links was also significantly more for OCD patients compared to healthy subjects in most of the studied EEG bands at Theta (p = 0.003, z = 2.98), Alpha II (p = 0.008, z = 2.65), Beta I (p = 8e-4, z = 3. 35), Beta II (p = 0.026, z = 2.21), Beta III (p = 0.011, z = 2.52), Beta IV (p = 4e-5, z = 4.11) and lower Gamma (p = 5e- 6, z = 4.54). The results of the Theta, Alpha II, Beta I, Beta IV, and Gamma band remained significant after correction for multiple comparison effects. As presented in panels F and G of Fig. 1, it seems that positive links in OCDs have more tendency to make hubs. However, it should be noted that the average number of positive links was about 1.5 times the average number of negative links which could potentially lead to an increase in the value of TMH_p compared to the TMH_n. The average values of TMH_p were in the range of 2-3 which are almost 3 times larger than their corresponding TMH_n values.
Subsequently, the number of balanced and unbalanced triads were compared and the structural balanceenergy of the networks in OCD and CON groups were examined. The investigation was performed by analyzing the triadic interactions of four types of triads, i.e., strongly balanced T 3 : (+ + +), weakly balanced T 1 : (+ − −), strongly unbalanced T 2 : (+ + −), and weakly unbalanced T 0 : (− − −). The number of triads |T i | and the balanceenergy Un were two metrics for quantitative comparison between the structural balance of OCDs and CONs functional brain networks. For unbalanced triads, the number of weak (T 0 ) and strong (T 2 ) unbalanced triads are presented in Fig. 1 (panels A and C), respectively. According to Fig. 1A, the average number of T 0 varied approximately between 30 and 50. As presented in Fig. 1C, the average number of the strongly unbalanced triad, |T 2 |, approximately varied between 250 and 300 which is almost six times larger than the number of the weakly unbalanced triad. In all nine EEG bands, the average number of T 2 for CONs was more than the OCDs. The results of the number of the weakly balanced triad, |T 1 |, and strongly balanced triad, |T 3 |, are shown in panels (B) and (D) of Fig. 1, respectively. The average values of |T 1 | were in the range of 200-300. Also, the average number of the weakly balanced triad for the CON group was more than the OCDs in most of the studied EEG bands (except Delta and Beta II bands). The average values of |T 3 | also approximately varied between 200 and 300. It is noteworthy that the brain networks of the OCD and CON groups had opposite behavior in terms of two measures of |T 1 | and |T 3 | in most of the nine frequency bands. In addition, as presented in Fig. 1E, the total energy of triads was negative for both OCD and CON groups in all the EEG bands. While the average values of Un were approximately in the range of − 0.006 to zero. As depicted in panel E, the average values of the Un for OCD group were smaller than the CON subjects in all the nine EEG bands. The results of the statistical comparison between the average number of balanced/unbalanced triads, and their balance-energy are presented in Table 1. www.nature.com/scientificreports/  www.nature.com/scientificreports/ According to Table 1, the numbers of the weakly unbalanced triad for the OCD group were significantly less than the CONs in Alpha I (p = 0.02, z = − 2.2) and Beta IV (p = 0.006, z = − 2.73) bands. Also, the results showed that the numbers of the weakly balanced triad for CONs were significantly more than the OCD group in Alpha I (p = 0.008, z = − 2.6) and Beta I (p = 0.04, z = − 2) bands. The |T 2 | for OCD patients was significantly less than the CON subjects in most of the EEG bands (all p-values < 0.04 and all z-values < − 2.02). The statistical results indicated that the number of strongly balanced triads for OCDs was significantly more than CON subjects in Alpha I (p = 0.02, z = 2.26) and Beta I (p = 0.03, z = 2.14) bands. Examining the statistical z values showed that |T 3 | had opposite behavior in comparison to other triads, including |T 0 |, |T 1 |, and |T 2 |.
In addition, only the triad T 2 was significantly different between OCD and CON groups almost in all frequency bands (except Theta and Alpha I). Hence, one may be interested in knowing which links of T 2 had the highest/lowest occurrence rates for OCDs and simultaneously had the lowest/highest occurrence rate for CONs in the mentioned frequency bands (by considering the definition of "occurrence rate" given in the "Structural balance" section, it can be said that links of T 2 with the highest/lowest occurrence rate are the most/least frequent links in T 2 . In the next lines, it is explained how to find these links). To answer this question, all the T 2 s of both OCD and CON groups in all nine frequency bands were obtained. From these T 2 s, 816 different T 2 s were found (it should be noted that the total number of T 2 s is much more than 816 because each of these 816 T 2 s is seen for many subjects out of 78 subjects or even for a given subject, one T2 is probably seen in more than one frequency band. Thus, the total number of different T 2 s was 816). These T 2 s offered 2448 links (each triad has three links). For each frequency band, these links were investigated separately. These links were sorted based on their times of presence (or occurrence rate) in T 2 s of all subjects of a given group. The sorting process of links (sorting from the highest rate to the lowest times of presence) was carried out for each group and each frequency band, separately. For each band and group, the links in the top 10% / bottom 10% of the sorting list were considered the links with the highest/lowest occurrence rates. The functional links between F8 and P3 in the Delta band, and T5-C3 in the Beta III band had the highest occurrence rates for CONs and the lowest occurrence rates for OCDs. The F8-P3 was seen 231 times in triads T 2 of CONs so that in 74.89% of occurrences had positive values and in 25.11% of occurrences had negative values; while this link occurred 210 times in triads T 2 of OCDs with positive values in 74.28% and negative values in 25.72% of occurrences. The functional link between T5 and C3 was also observed 232 times in triads T 2 of CONs (78.88% positive, and 21.12% negative); while this link was observed 215 times in triads T 2 of OCDs (38.14% positive, 61.86% negative). In contrast, the T3-F3 in Delta band and Fz-Fp2 in Beta II were the only links that had the highest occurrence rates for OCDs and simultaneously the lowest occurrence rates for CONs. The T3-F3 link was observed 257 times in triads T 2 of OCDs (55.25% with positive values, 44.75% with negative values); while this link was seen 189 times in triads T 2 of CONs (50.8% positive, and 49.2% negative). The Fz-Fp2 was also observed 261 times in triads T 2 of OCDs (77.77% positive, and 22.23% negative), while this link was observed 174 times in triads T 2 of CONs (76.44% positive, and 23.56% negative). Having said that, it must be mentioned that only the T5-C3 link showed a significant difference between OCD and CON groups in terms of percentile of appearing as the positive and negative links.
Moreover, the TMH is a global metric and one may be interested to localize the regions based on their degree distributions. It can help to understand which regions play the main role in differentiating the topology of brain functional networks in OCD versus CON. The positive degree of a given electrode was computed by summing the weights of positive links connected to the electrode and likewise for the negative links. In each frequency band and for each group, the positive and negative degrees were computed for each electrode and averaged over the subjects. Then, the z-scored value of each electrode's degree was calculated based on the mean and standard deviation of degree values of all 18 electrodes. Subsequently, the z-score values of positive and negative links of OCD and CON groups were compared using the Wilcoxon rank-sum test. As presented in Fig. 2, degrees of electrodes at the Frontal, Central, and Temporal regions showed significant differences between OCD and CON groups despite the similar pattern of degrees in both groups.
In addition, the balance-energy Un for CON individuals was significantly higher than the OCD patients in all EEG bands (except Alpha I) (all p-values < 0.002 and all z-values < − 2.7). It should be noted that U n showed similar behavior to the triadic metrics except |T 3 | when comparing OCD with CON groups.

Discussion
Previous studies have shown that functional associations between the brain regions are significantly changed in OCD individuals 3,41-43 , which could be a potential biomarker for diagnosis of the OCD. However, the characteristics of the changes still require to be well understood. Undoubtedly, amounts of the negative and the positive links as well as their arrangement in the network (topology) could influence the collective behavior of the network and its stability 40,44 . In addition, looking at the exaggerated form of information processing in the Frontal region in OCD 26 , one may think of the effect of positive feedback provided by the regional synchrony to other parts of the brain. Nevertheless, the positive feedback must be in a form that forces the network to a stable state. Therefore, we hypothesized positive links must have a more tendency to gather together to provide positive feedback, while the arrangement of the negative links leads the network to a more unbalanced state. To investigate the hypothesis, the structural balance theory and metrics of TMH were employed 39,40 . The SBT allowed us to study four types of triadic interactions and balance-energy in the OCD network in comparison to the CON. Moreover, the TMH metrics allowed us to perform a comparison between the topology of positive and negative links in the brain functional networks of OCD and CON groups 40 .
To the best of our knowledge, the current study presents the first application of balance theory using EEG so far. In this study, Heider's balance theory was investigated for OCDs and CONs in different frequency bands of EEG 45 . We aimed to show how the gathering of positive and negative links could influence the balance-energy of the brain functional network in OCDs by over-/under-presenting balanced and unbalanced triads in the network. www.nature.com/scientificreports/ Since the triadic associations are based on both positive and negative links as well as their topology, therefore, amount of positive and negative links and their topology were compared between the OCD and CON groups as explained in the method section. The amount of positive and negative links was not significantly differentiable between OCD and CON groups, except in the Alpha I band. In the Alpha I band, the |P| was significantly greater for OCDs compared to CONs. This means that phase synchrony (resulting in positive links) of brain regions of OCDs is abnormal in this band. We think of such abnormal alpha synchrony could be a reason for the low energy level of the OCD brain, which in turn leads to a more stable state for the OCD brain. The discussions provided in the next paragraphs (about TMH_p and triadic interactions T 2 and T 3 ) offer more evidence for this thinking. Based on the characteristics of OCD disease, we think this stable state is the state providing obsession and compulsive characteristics for OCDs. Positive links individually make their effects on the OCD brain state in the alpha I band. However, if we view positive links through their interactions with positive and negative links (through triadic interactions T 2 and T 3 ) or their arrangement by other positive links (through TMH_p), we could say that positive links play the key roles in many frequency bands for OCD patients in terms of OCD characteristics and keeping the brain in a stable state (we think this state is not appropriate and is related to OCD characteristics). In many frequency bands, the OCDs in comparison to CONs had lower T 1 and T 2 and higher T 3 In the third and sixth columns, the red and blue colors indicate regions with higher and lower degrees for OCDs compared to CONs, respectively. www.nature.com/scientificreports/ and TMH_p. These results show that positive links in OCDs have less tendency to associate with negative links and, oppositely, they tend to integrate with positive links. As we said in this paragraph and we will say in the following paragraphs, the lower T 2 and higher TMH_p and T 3 lead to lower energy levels and consequently prevent state changes in the OCD brain (again, it is said that the mentioned lower and higher behaviors and consequently lower energy level in OCDs' brain have resulted from abnormal tendency of positive links for integrating with positive links and repelling the negative ones). As a result, the neuroplasticity of the OCD brain is decreased. From this point of view, it can be said that phase synchronization among different brain regions of OCDs may be leading to repetitive thoughts and compulsive behaviors. In contrast to |P| and |N|, the arrangement of the links showed significant differences, particularly for the positive links. Based on the TMH results, the topology of the negative links was significantly altered in the OCDs at the networks of Beta II and Gama bands; while the arrangement of the positive links was significantly changed (TMH increased) in the OCDs' networks at all the frequency bands except for Delta and Alpha I. The changes in topology had a larger effect on positive links than those of negative links. Such a tendency to make positive hubs in the OCDs' brain functional networks could influence the network's stability by changes in triadic associations (offering lower T 2 and higher T 3 for OCDs).
Both TMH_n and TMH_p showed negative correlations with Un for both groups. However, the impact of TMH_p (p-values < e-8, r-values < − 0.73) was much more than TMH_n (p-values < 0.01, r-values < − 0.37) for both groups. The TMH_p impact on Un of OCD (p-values < e-14, r-values < − 0.89) was much more than that of CON (p-values < e-8, r-values < − 0.73) in all frequency bands. Also, the results of Table 1 showed much more TMH_p for OCDs than CONs in all frequency bands. Therefore, it can be said that the positive links play the dominant role in the topology alternation of OCDs, which in turn leads to more stability and less dynamism (less energy Un) of the OCD brain network.
The unbalanced triads T 0 and T 2 can change balance-energy and consequently the state of the network by injecting energy into the network. Therefore, although the T 0 and the T 2 are less-presented in the network as compared to the T 1 and the T 3 , they play a key role in the dynamism of the brain functional network 39 . The results of this study also showed that the |T 0 | and particularly |T 2 | were lower for the OCDs compared to the CONs in all the frequency bands (see Table 1). This may introduce fewer requests for a change in the OCD's network and bring the network to a more stable state as presented in Fig. 4 and Table 1.
In addition, based on Eq. (2) and Table 1, it can be said that the higher |T 3 | and lower |T 0 | and |T 2 | resulted in significantly lower Un for OCDs compared to CONs in all frequency bands (except Alpha I). This less energy may be an explanation for a deficiency to move from one state to another (lower neuroplasticity) in the OCD brain.
A detailed analysis of the T 2 revealed that the link T5-C3 significantly differed in terms of positive and negative occurrence between OCD and CON groups. We think of it as less inhibition imposed by the sensory motor area (C3) on the exaggerated information processed by the cortico-striatal-thalamo-cortical pathway in OCD.
On the other hand, a key role of the balanced triads (T 1 and T 3 ) is the network organization through connecting the modules. The T 1 and the T 3 help for integration and segregation in the brain networks by connecting different groups of positively linked nodes with the negative links 39 . Therefore, having higher |T 3 | and consequently more modules (Beta I network) and significantly a smaller number of |T 1 | (Alpha I network) in OCDs could support the idea of less brain functional specialization and disrupted balance between global integration and local specialization in the OCDs.
In this study, the number of dyadic/triadic interactions was reported by (|P|, |N|)/(|T 0 |,|T 1 |,|T 2 |,|T 3 |). Based on the results of |P|, |N|, |T i |s, and TMH metrics, it can be said that although the number of positive and negative links were not statistically different between the brain networks of the OCDs and the CONs, interactions between the links and arrangement of them make a significant difference between the topology of the brain networks of OCDs and healthy subjects. The findings of this study demonstrated that the SBT context and employing higher order interactions (for example, triadic interactions instead of dyadic (individual positive or negative links) ones) as well as topological analysis through hub concept are promising approaches to better understanding the alternations of brain networks in OCDs.
The surprised value S results are represented in Supplementary Fig. S1. These results indicate that most of the triadic interactions for most of the subjects follow Heider's balance theory in all the frequency bands. This means that the number of balanced/unbalanced triads in the brain network is more than those in the random network (more information in the "structural balance" section). However, as presented in Supplementary Table S1, some subjects did not follow Heider's balance theory mainly for the T 0 triads. A similar finding has been reported in the previous studies 39 and some studies of social networks 46,47 that T 0 may be over-presented in some cases.

Limitations and suggestions for future works. Considering the ethical issues, we only recruited OCD
patients under medication in our study. However, the medication could influence the functionality of the brain. Therefore, the results may not be directly extended to all OCD patients. Moreover, this study was only based on the resting-state data and further analysis using task-based data is also suggested for future works. A few metrics out of 9 studied metrics were discriminative between OCDs and CONs in different frequency bands. Some of these metrics may be biomarkers for OCD. However, it needs studying much more subjects and can be a topic for the future.
As we said in the discussion, positive links individually and through their interactions with negative and positive links and through making hub offer a stable (low energy) state for OCDs. As OCD characteristics show this stability is along with obsessive thoughts and compulsive behaviors. We think that a treatment approach should attempt to decrease the positive links (increase the negative links) and consequently decrease the positive hubs and T 3 and increase the T 0 and T 2 . As a result, energy is injected into the brain which consequently increases the plasticity of OCDs' brain and helps the brain to change its state. It can be said that such treatment breaks www.nature.com/scientificreports/ the positive hubs and interactions with positive links and looping thoughts. Looping thoughts are thoughts that are repeated as many as possible in the OCDs' brain and the treatment can break these loops. Studying such a hypothesis can be an interesting topic for future work and the possible treatments can be noninvasive brain stimulation such as transcranial magnetic stimulation (TMS), transcranial direct current stimulation (tDCS), transcranial alternating current stimulation (tACS), random noise stimulation (RNS), transcranial ultrasound stimulation (TUS) 48 . The most commonly used EEG devices in clinics include 19 channels (in this study, the data from 18 channels was available). Thus, it was more reachable for us to go for clinical devices and use the data of clinics in research. In addition, these 18 channels were placed based on the 10-20 system, therefore, they fully covered the brain regions. Maybe the number of channels plays a critical role in our findings or the dependency of our findings on channel numbers may be low. The sensitivity of the topology findings of this study to the channel number can be a very interesting topic for future work. For the future, higher channel numbers such as 32, 64, 128, or even 256 can be investigated.
This work attempted to initiate the topological study of OCD versus CON using SBT and TMH concepts and show their promising perspective for such a study. The final verification of our findings needs much more studies with much more subjects and EEG devices with much more channels (investigating the brain with higher spatial resolution and bigger network size).

Methods
A schematic of the experimental design is presented in Fig. 3.

Participants.
The dataset used in this paper was collected in the psychiatric ward of Farshchian Hospital in Hamadan in 2016 (IRCT2015030321313N1, Grant No. 940125303). In this study, 78 subjects were recruited for EEG data collection. Out of the 78 participants, of whom 39 were OCD patients (avg. 34.76 years, std 10.35 years) with the DMS-5 criteria and 39 were healthy individuals (avg. 34.1 years, std 9.41 years). All the study was approved by the ethical committee of the Hamadan University of Medical Sciences. Informed consent was obtained from all subjects. All experiments were performed in accordance with the relevant guidelines and regulations. The following three conditions were considered for the selection of OCD patients; (1) Subjects who had been diagnosed with OCD by a psychiatrist based on the DSM-5 criteria and whose disease had been confirmed based on a clinical interview, (2) Individuals who scored at least 16 on the Yale-Brown obsessivecompulsive scale (Y-BOCS), and (3) People who were in the age range of 18-60 years. In addition, some other participants who met the following conditions were excluded from the study; (1) Any current mental illness except OCD, (2) History of severe head injuries, (3) History of substance dependence (or abuse), (4) Any severe neurological disorder, (5) intellectual impairment, (6) Any electroconvulsive therapy within one year before the study, (7) Any vision, hearing or speech impairment, paralysis, or amputation, and (8) Any clinical condition that has a significant effect on EEG signals (such as pregnancy). Table 2 summarizes the demographic information of the people along with other parameters. According to this table, p-values are greater than the threshold value of 0.05. Therefore, it can be concluded that these parameters (i.e., gender, right-handed or left-handed, and age) do not change significantly among individuals. As a result, the effect of the mentioned parameters is not considered in the analysis. EEG Dataset. The EEG database was collected from 78 subjects (39 CON cases and 39 OCD patients) using a Cadwell Easy II Amplifier. The scalp electrodes were mounted on the head according to the 10-20 international system. All EEG recordings were collected using 18 Ag-AgCl electrodes. For more details, the positions and names of the electrodes are shown in Fig. 4. All the EEG signals were recorded at a sampling rate of 500 Hz. During the recording, the subjects (with eyes open) were in a resting state. The electrode impedance was less than 5 kΩ during the experiment.
Functional connectivity matrix. Among the neuroimaging techniques, functional connectivity (FC) is one of the most popular frameworks in which researchers examine patterns of communication between timeseries recorded by electrodes. FC matrix is needed to analyze the triadic interactions and topological impact of positive and negative links in the brain. For each subject and in each frequency band, the one-minute signal was divided into six separate segments of nine seconds. Then, the FC matrix was computed for each segment, separately. The final FC matrix was obtained by averaging the six FC matrices. In the following, it is explained how to compute the FC matrix of each segment.
In this study, the topographical profile similarity-based high-order FC (tHOFC), which is a two-step procedure, was used to compute the FC matrix 49 . In the first step, the FC was computed between each pair of electrodes to be formed the low-order FC (LOFC) matrix. By doing so, a vector of FCs was obtained for each electrode. www.nature.com/scientificreports/ This vector represented the LOFC profile of the given electrode. In the second step, tHOFC was computed as the similarity of LOFC profiles between each pair of electrodes. The tHOFC can offer complementary information to the conventional LOFC and introduce more differences between groups 49,50 .
For the first step, the weighted phase lag index (wPLI) was used 51 . The wPLI is very popular in EEG modality due to its better test-retest reliability as compared to other functional connectivity measures 52 . The wPLI like PLI measures the phase angle differences between the time series of two electrodes x and y using the imaginary part of cross-spectral density S xy of two electrodes' signals. The wPLI in comparison to PLI employs a more conservative approach to deal with potential confounds caused by volume conduction, by scaling contributions of angle differences according to their distance from the real axis: One-minute resting-state EEG dataset was recorded for each subject with a sampling frequency of 500 Hz and 18 electrodes. (C) Bandpass filtering and ICA were applied to remove high frequency noise and artifacts. Then, the one-minute data of each subject passed through the nine FIR band-pass filters to have EEG data in nine well-known frequency bands. (D) For each subject, the tHOFC matrix was computed for each band, separately. The wPLI and Pearson correlation methods provided the first and second steps of FC matrices for tHOFC, respectively. (E) The frequency and total energy of triads were used to compare OCDs and CONs in the perspective of the SBT context. The TMH and frequency of positive and negative links were employed for topological comparison purposes. (F) After checking for normal distribution, the Wilcoxon rank-sum test was used for statistical comparison between OCD and CON groups. www.nature.com/scientificreports/ where |.| indicates the absolute value, sgn is the sign function, imag represents the imaginary part, and t and n are the time index and the total number of time points, respectively. For triadic interaction analysis, FC matrices must have both positive and negative values. Hence, for the second step, the Pearson correlation was used to provide a similarity profile and final FC matrix for each segment.
The number of links. The number (or occurrence rate) of negative links |N| and positive links |P| are computed for each subject in each frequency band. By having the information of |N| and |P| it can be answered that |T i |s and TMHs may become different between groups even when there is no difference in terms of the number of negative and positive links.
(1) wPLI = n t=1 imag(S xy,t ) sgn(imag(S xy,t )) n t=1 imag(S xy,t ) www.nature.com/scientificreports/ Structural balance. SBT investigates the stability and behavior of a network by analyzing the triadic interactions between entities (herein electrodes). In this study, as with Moradimanesh and colleagues 39 , four types of triads were analyzed in nine frequency bands. These triads were strongly balanced T 3 : (+ + +), weakly balanced T 1 : (+ − −), strongly unbalanced T 2 : (+ + −), and weakly unbalanced T 0 : (− − −) (Fig. 5). The "+" and "−" are the sign of FC weights between the electrodes and, respectively, represent the phase synchrony and asynchrony between electrodes (brain regions). This way, information about the organization of the network that cannot be detected on the level of pair connections would get a chance to be revealed. A well-known analogy for this definition is that positive (negative) links are considered friendship (enmity) relations, respectively. Then, the classic balance model defines a triad as balanced if it contains no violations of four assumptions: (A1) A friend of a friend is a friend, (A2) A friend of an enemy is an enemy, (A3) An enemy of a friend is an enemy, (A4) An enemy of an enemy is a friend 40,53,54 . The first assumption is represented by T 3 and the rest assumptions are represented by T 1 . Otherwise, we have unbalanced triads, T 2 ("a friend's friend is an enemy") and T 0 ("an enemy's enemy is an enemy") 40,53,54 . Entities of an unbalanced triad are frustrated about their conditions and try to change their relationships to reach one of the balanced conditions. This is analogous to the transition of an unstable physical system toward a stable state with a lower energy level based on the principle of minimum energy. Accordingly, it can be assumed that a balanced (stable) triad situates stationary in a low-level energy state despite an imbalanced (unstable) triad that tries to solve its frustrations to reduce its energy and move to the stable state 40,55 . The T 2 and T 0 respectively are strong and weak unbalanced triads (or equally strong and weak frustrated triads) because the T 2 injects more frustration into the system than T 0 (the entities of T 2 are more frustrated than those of T 0 about their conditions and, therefore, the T 2 is more unbalance (unstable) than T 0 ). Likewise, the T 3 and T 1 are strong and weak balanced triads because a T 3 is more stable than T 1 and a system containing entirely triple positive triads is more stable 35,40 .
The balanced (stable) state of a network is a state in which there is no frustration and all triads are balanced (stable) ones. Based on the principle of minimum energy, a stable network (or a network in a balanced state) has the least energy and remains stationary since there is no dynamic demand to change link signs due to the presence of imbalanced triads 40,56 . Therefore, one should know the definition of balance-energy to find the balanced state of a network. For a balanced interaction, the product of its edges is a positive number, whereas, for an unbalanced interaction, this product is negative. As previously proposed 57 , if one sums the negative of these products and divides it by the total number of ternary interactions, the total energy Un of a network would be obtained. Energy represents the extent to which a network is structurally balanced. This definition of energy is similar to the Hamiltonian concept in physics. The Hamiltonian of a system represents the total energy of the system, that is, the sum of the energies of all particles (triads) associated with the system 58 . The negative of products for computation of Un helps to better understand the equation from the physical energy perspective. This means that the balanced/unbalanced triads make the network stable/unstable. Thus, products of their components should decrease/increase the energy of the network. To achieve this property, the negative of products was proposed by Marvel and colleagues 57 . The total energy of network Un is defined as where N is the total number of network triads, w is the edge weight of triad T i , and x, y, and z indicate to electrodes of triad T i . As with 39,40 , we call this total energy balance-energy because based on which one can understand how much a network is balanced and how (i.e., positively or negatively) the metrics impact the network stability by analyzing the relation between Un and those metrics. For a fully strong (strong means weights are + 1 and − 1) balanced and unbalanced network, the Un would be − 1 and + 1, respectively. Therefore, the minimization of Un leads to more stability of the network.
If one variable or metric decreases the Un, (based on the definition given in this subsection) one can say that that metric leads to a more balanced state for the network. For example, in this study, the results show Figure 5. Four types of triads are defined by SBT. The number of negative links is even/odd for balanced/ unbalanced triads. The subscript of each T denotes the number of positive links. For balanced triads, the strong vs weak means that T 3 is more stable than T 1 . For unbalanced triads, the strong triad T 2 injects more frustration into the network than the weak triad T 0 . www.nature.com/scientificreports/ that the tendency of OCDs' brains for making hubs with positive links (the tendency to make hubs is a metric explained in the next subsection) is significantly more than that of CONs' brains in many frequency bands. Also, this tendency has a much stronger anti-correlation with Un for OCDs in comparison to CONs in all frequency bands. As a result, one can conclude that such a tendency leads to a more balanced (lower energy Un) state for the OCDs' brains. In this study, two metrics were used to compare the triadic interactions between OCD and CON. The first one was the occurrence rate of triad T i (indicating by |T i |) where i = 1, 2, 3, 4. In this paper, the occurrence rate of something such as T i or a link of T i is equal to the number of times it happens. The second one was the Un.
It is expected that the balanced/unbalanced triads become over-/under-presented in the brain network. This means that the number of balanced/unbalanced triads in the brain network is more than those in the random network. The surprised value S is a metric providing the positive/negative values for over-/under-presented triads 39 : where the p 0 (T i ) is the ratio of the |T i | to the total number of triads in the random network. The random network has the same links as the brain network and only the signs of brain network links are randomly assigned to the existing links of the random network. In this study, the S was only used to provide information for the over-/ under-presented behavior of triads in OCD and CON, and not for group comparison.
Tendency to make hub. Hubs are nodes (electrodes) with a high number of connections and these connections have high weights in weighted networks. Hubs, which are local features of networks, play a key role in the topology of the brain network. In this study, we used the global hubness metric to compare the brain networks of OCDs with CONs in an aspect of network topology. This metric was first time introduced by Saberi and colleagues and used to study autism spectrum disorder 40 . This metric, which is named the tendency to make hub (TMH), is separately defined for positive and negative links as TMH_p and TMH_n: where M is the total number of electrodes, D i,p and D i,n represent the positive and negative degrees of ith electrode, respectively, and w ij,p and w ij,n are the positive and negative weights between ith electrode and the rest of the electrodes.
The TMH_p and TMH_n demonstrate the tendency of the network to make hubs with positive and negative links, separately. Thus, the TMH can describe the impact of positive and negative links on the topology of the brain.

Statistical analysis.
First of all, the number of positive and negative links and their ratio were compared between OCD and CON groups. Subsequently, the number of balanced and unbalanced triads were compared and the structural balance-energy of the networks in OCD and CON groups were examined. Then, considering no significant differences in terms of the total number of positive and negative links between the groups, the effect of the topology of the links was investigated by comparing between global tendency in the network to make positive and negative hubs. The above-mentioned comparisons between metrics of OCD and CON were performed for the networks of Delta, Theta, Alpha I, Alpha II, Beta I, Beta II, Beta III, Beta IV, and Gamma bands separately. In each of these bands, the group-level normality of the measures was tested using the Shapiro-Wilk test 59 . The results showed that the distributions of some measures at some frequency bands were far from normal. Therefore, the Wilcoxon rank-sum test as a nonparametric test was used for statistical comparison purposes 60 . A threshold of p < 0.05 (Fisher permutation) was considered to find the statistically significant differences between OCD and CON groups. We used the Bonferroni method 61 to correct the results for multiple comparison effects. A threshold of P value < (0.05/(18*18*9)) was considered for the number of positive and negative links. Since the other metrics are global, the correction was only performed for the frequency bands and a threshold of P value < (0.05/9) was implied.