# Uncovering Hidden Community Structure in Multi-Layer Networks
## 4 Hidden Community Detection Method
### HCD Algorithm  
For hidden communities in a network, there is hidden community detection, which aims to identify the invisible or weaker community structure in a multi-layer network that often goes undetected or ignored by many popular community detection algorithms. Hence, to make it more precise, the proposed HCD method has three basic steps, and the basic functions of the method are given in Algorithm 1  
1. Having a network G and applying a baseline method to detect the initial set of communities which can be regarded as a stronger community structure.  
Figure 3: The flowchart illustration of the operation of the hidden community detection (HCD) method.  
After identification, the weakening of the layers process begins by removing all of the internal edges for the current set of detected communities by using the Remove Edge process by which the effect of their structure on the network is removed to easily detect the hidden structure beneath, and get another set of communities (different than the first set). This process is repeated until no compelling communities can be found.
3. To further improve the quality of these detected layers, there is another iterative process which takes into consideration each layer of the structure and makes improvements in the manner that it first weakens the structures of all other layers in the original network. It then applies the base algorithm to the other resulting network.  
```
1:Step 1,2:
2:Input:\(G=(V,E)\)
3:Initialize:\(Gr=G//Gr\) is reduced graph
4:for each Layer in \(R\)do
5:Partition\(\leftarrow\)baseline method (\(Gr\))
6://Determine whether to store or reduce graph
7:Hcd_layer\(\leftarrow\)store graph
8://Weaken the structure by removing edges
9:Hcd_layer\(\leftarrow\)reduce graph
10:Compute modularity \(Q\) of each \(C\) in layers using Equation (1)
11:endfor
12:Step 3:
13:for each Clr_i in \(R\)do
14://Clr is clarification iteration and R is the range.
15:Initialize: \(Q=0\)
16:for each \(i\) in \(L_{i}\)do
17:for each \(k\) in \(L_{k}\)do
18://where \(L_{i}\) and \(L_{k}\) are the layers being computed.
19:if\(i=k\)then
20:Clr_itr\(:i=k\)
21:endif
22://Weaken the structure by removing edges in the same way as previous step.
23:Hcd_layer\(\leftarrow\)reduce graph
24:endfor
25:Apply baseline method to get communities
26:\(Q=\)Compute \(|\,Q\,|\)
27:endfor
28:endfor
```  
**Algorithm 1**Hidden Community Detection: Basic Steps  
An important point to note is that there is need to debilitate the effects of both the weaker layers and the stronger ones because any of them can lessen the process of community detection of the current layer. For example, regardless of having the smaller influence on the network, the weaker layer can also hinder the detection process. By exercising it, there is more possibility to get a reliable version of layers. In every iteration of step three, the modularity is calculated from the layers detected, but the concluding outcome will be the one with the maximum average modularity value.  
Another main challenge for this approach is to determine whether the number of layers that have been chosen for the operation of the method is correct or not. In our work, we use the policy to determine whether it is correct or not by determining the average modularity score. If the score on the graph increases, then the number of layers chosen is correct; otherwise, the trend on the graph declines.