## 2 Materials and Methods
### Layer 1  
**Step 1. ** The information collected from the electric distribution substations (the active and reactive power profiles) following the measurement campaigns carried out by the DNOs represents input data. These profiles are recorded in the database and uploaded in the matrices [P] and [Q] having the sizes TxN\({}_{\text{EDS}}\), where T represents the period used in the measurement campaigns to record the data with various sampling steps (usually 60 min) and N\({}_{\text{EDS}}\) correspond with the number of the EDSs from the analysed EDN. \[[P]= \begin{bmatrix}P_{1,1}&P_{1,2}&\ldots&P_{1,n}&\ldots&P_{1,N_{EDS}}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ P_{t,1}&P_{t,2}&\ldots&P_{t,n}&\ldots&P_{t,N_{EDS}}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ P_{T,1}&P_{T,2}&P_{T,n}&P_{T,N_{EDS}}\end{bmatrix} [Q]= \begin{bmatrix}Q_{1,1}&Q_{1,2}& \ldots&Q_{1,n}&\ldots&Q_{1,N_{EDS}}\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ Q_{t,1}&Q_{t,2}&\ldots&Q_{t,n}&\ldots&Q_{t,N_{EDS}}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ Q_{T,1}&Q_{T,2}&Q_{T,n}&Q_{T,N_{EDS}}\end{bmatrix}  \tag{1}\]  
The matrices [P] and [Q] contain the values of the active and reactive powers recorded at the time t, t = 1, \(\ldots\), T, where T is the analysis period, in each EDS n, n = 1, \(\ldots\), N\({}_{\text{EDS}}\), from the analysed EDN. **Step 2. ** The correlation coefficients are calculated between each two EDSs (n and m, n \(\
eq\) m, n, m \(\in\) {N\({}_{\text{EDS}}\)}) from the analysed EDN and recorded in the matrix [CC], having the size (N\({}_{\text{EDS}}\)xN\({}_{\text{EDS}}\)). \[CC_{P_{n},P_{m}}=\frac{Cov(P_{n},P_{m})}{\sigma_{P_{n}}\cdot\sigma_{P_{m}}}\;( \forall)n,m\in\{N_{EDS}\};\;n\
eq m \tag{2}\]  
where CC\({}_{\text{Pn},\,\text{Pm}}\) represent the correlation coefficient between the EDSs n and m; Cov (P\({}_{n}\), P\({}_{m}\)) represents the covariance between the active power profiles P\({}_{n}\) and P\({}_{m}\) recorded in the EDSs n and m from the set of the EDSs, generically noted {N\({}_{\text{EDS}}\)}; \(\sigma_{\text{Pn}}\) and \(\sigma_{\text{Pm}}\) represent the standard deviation of the active powers recorded in the EDSs m and n, (\(\forall\)) m, n \(\in\) {N\({}_{\text{EDS}}\)}, calculated with the following relations:  
\[\sigma_{P_{n}}=\sqrt{\frac{1}{T}\sum_{t=1}^{T}\bigl{(}P_{t,n}-\overline{P}_{n }\bigr{)}^{2}};\;\overline{P}_{n}=\frac{1}{T}\sum_{t=1}^{T}P_{t,n}\;n\in\{N_{ EDS}\} \tag{3}\]  
\[\sigma_{P_{m}}=\sqrt{\frac{1}{T}\sum_{t=1}^{T}\bigl{(}P_{t,n}-\overline{P}_{m }\bigr{)}^{2}};\;\overline{P}_{m}=\frac{1}{T}\sum_{t=1}^{T}P_{t,m}\;m\in\{N_{ EDS}\} \tag{4}\]  
The significations of the variables from the relations (3) and (4) are as follows: P\({}_{\text{t},\,\text{n}}\), P\({}_{\text{t},\,\text{m}}\) represent the values of the active and reactive powers recorded at the time t, t = 1, \(\ldots\), T in the EDSs n si m, (\(\forall\))m, n \(\in\) {N\({}_{\text{EDS}}\)}, from the analysed EDN; and \(\tilde{\text{P}}_{n}\), \(\tilde{\text{P}}_{m}\) correspond to the average values of the active and reactive powers recorded at the time t, t = 1, \(\ldots\), T in the EDSs n si m, (\(\forall\))m, n \(\in\) {N\({}_{\text{EDS}}\)}. **Step 3. ** The classes corresponding to the EDSs with similar features of the correlation coefficients are identified based on a clustering process. The optimal partition in the classes will be determined using the K-means clustering algorithm [31] and an internal test based on a performance indicator, namely the silhouette coefficient (SC) [32]. The clustering process includes the following phases:1.