# Optimization Algorithms for Detection of Social Interactions

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Mathematical Definition of Modularity in Networks

## 3. Immunological Algorithms

#### 3.1. Opt-IA

- (i)
- the hypermutation operator, which acts on each clone in order to explore its neighborhood;
- (ii)
- the precompetition operator, which makes it possible to maintain a more heterogeneous population during the evolutionary cycle;
- (iii)
- the stochastic aging operator whose aim is keep high diversity into the population and consequently help the algorithm in escaping from local optima; and, finally,
- (iv)
- the selection operator which identifies the best d elements without repetition of fitness, ensuring heterogeneity into the population.

Algorithm 1: Pseudo-code of Opt-IA |

1: procedure Opt-IA(d, $dup$, m, ${P}_{die}$) |

2: $t\leftarrow 0$ |

3: ${P}^{(t)}\leftarrow \mathrm{InitializePopulation}(d)$; |

4: $\mathrm{ComputeFitness}({P}^{(t)})$ |

5: while $\neg \mathrm{StopCriterion}$ do |

6: ${P}^{(clo)}\leftarrow \mathrm{Cloning}({P}^{(t)},dup)$ |

7: ${P}^{(hyp)}\leftarrow \mathrm{Hypermutation}({P}^{(clo)},m)$ |

8: $\mathrm{ComputeFitness}({P}^{(hyp)})$ |

9: ${P}^{(pre)}\leftarrow \mathrm{Precompetition}({P}^{(t)})$ |

10: ${P}_{a}^{(pre)}\leftarrow \mathrm{StochasticAging}({P}^{(pre)},{P}_{die})$ |

11: ${P}^{(t+1)}\leftarrow \mathrm{Selection}({P}_{a}^{(pre)},{P}^{(hyp)})$ |

12: $t\leftarrow t+1$; |

13: end while |

14: end procedure |

- equiprobability: randomly select a vertex from the solution and reassign it to a cluster among those existing at that time. Each cluster has the same probability of being selected;
- destroy: randomly select a cluster ${c}_{i}$ from the solution $\overrightarrow{x}$, a percentage P in the range $[1\%,50\%]$, and a cluster ${c}_{j}$ in the range $[1,N]$. All vertices in ${c}_{i}$ are then moved to the cluster ${c}_{j}$ with P probability. Note that, if the cluster ${c}_{j}$ does not exist, then a new community is created;
- fuse: randomly select a cluster and assign all its nodes to a randomly selected cluster among those existing.

#### 3.2. Hybrid-IA

Algorithm 2: Pseudo-code of Hybrid-IA. |

1: procedure Hybrid-IA(d, $dup$, $\rho $, ${\tau}_{B}$) |

2: $t\leftarrow 0$ |

3: ${P}^{(t)}\leftarrow \mathrm{InitializePopulation}(d)$ |

4: $\mathrm{ComputeFitness}({P}^{(t)})$ |

5: while $\neg \mathrm{StopCriterion}$ do |

6: ${P}^{(clo)}\leftarrow \mathrm{Cloning}({P}^{(t)},dup)$ |

7: ${P}^{(hyp)}\leftarrow \mathrm{Hypermutation}({P}^{(clo)},\rho )$ |

8: $\mathrm{ComputeFitness}({P}^{(hyp)})$ |

9: $({P}_{a}^{(t)},{P}_{a}^{(hyp)})\leftarrow \mathrm{Aging}({P}^{(t)},{P}^{(hyp)},{\tau}_{B})$ |

10: ${P}^{(select)}\leftarrow (\mu +\lambda )-\mathrm{Selection}({P}_{a}^{(t)},{P}_{a}^{(hyp)})$ |

11: ${P}^{(t+1)}\leftarrow \mathrm{LocalSearch}({P}^{(select)})$ |

12: $\mathrm{ComputeFitness}({P}^{(t+1)})$ |

13: $t\leftarrow t+1$; |

14: end while |

15: end procedure |

## 4. Results

#### 4.1. Large Synthetic Networks

#### 4.2. On the Computational Complexity of Opt-IA and Hybrid-IA

- Any element of the population, i.e., a tentative solution, is an array of length $N,$ where N is the number of vertices of the input graph.
- The operator $\mathrm{InitializePopulation}(d)$ randomly creates a population of d tentative solutions. Thus, total cost is $\mathcal{O}(dN).$ However, we stress here the fact that $d,$ which is set experimentally, is actually constant, i.e., it does not depend on the size of the input. In our case, we fixed to the value 100 for all of the experiments. This allows us to say that the cost of the procedure is actually $\mathcal{O}(N).$
- The operator $\mathrm{ComputeFitness}()$ computes the fitness for all the $d=100$ elements of the population. A bound on the cost of the procedure can easily be computed using Equation (1), and it clearly is $\mathcal{O}({N}^{2}).$
- The operator $\mathrm{Cloning}()$ creates $dup$ copies of each of the elements of the population. As you can see from our settings, $dup$ is a parameter which does not depend on the size of the input graph, but just on the nature of the algorithm. This allows us to say that the cost of $\mathrm{Cloning}()$ is $\mathcal{O}(N).$
- The operator $\mathrm{Hypermutation}()$ mutates each element of the population with constant probability $m.$ As we described earlier, we have three different implementations. In all three cases, we have either the random selection of a vertex or the random selection of a cluster. In the two most time-consuming implementations, namely destroy and fuse, we might have the reallocation of several vertices. Thus, all in all, $\mathrm{Hypermutation}()$ has an upper bound $\mathcal{O}(N).$
- The operator $\mathrm{Precompetition}()$ randomly selects two vertices, checks their community numbers, and, if they are the same, it deletes with probability $1/2$ the one with lower fitness. Since the fitness value was already computed, the overall cost of the operator is clearly $\mathcal{O}(1).$
- The operator $\mathrm{StochasticAging}()$ goes through all the elements of the population and removes an element with the user defined probability ${P}_{die}$. Thus, its overall cost is $\mathcal{O}(N).$
- Finally, the operator $\mathrm{Selection}()$ chooses, without repetition of fitness values, the best d B cells among ${P}_{a}^{(pre)}$ and ${P}^{(hyp)}$. As we underlined before, the number of elements in these two populations is constant with respect to the size of the input, so we can simply say that the cost of the operator is $\mathcal{O}(1).$

- The operator $\mathrm{Hypermutation}()$ in the worst case moves all the vertices from one community to another, but it is still obviously $\mathcal{O}(N).$
- The operator $\mathrm{Aging}()$ goes through all the elements of the populations which we consider a constant number, again independent from the size of the input graph, so, all in all, it is $\mathcal{O}(1).$
- The operator $\mathrm{LocalSearch}()$ acts on every vertex of the given graph and explores its vicinity. Therefore, we can estimate that its work has an upper bound $\mathcal{O}({N}^{2}).$

## 5. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Girvan, M.; Newman, M.E.J. Community structure in social and biological networks. Proc. Natl. Acad. Sci. USA
**2002**, 99, 7821–7826. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Gulbahce, N.; Lehmann, S. The art of community detection. BioEssays
**2008**, 30, 934–938. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Didimo, W.; Montecchiani, F. Fast layout computation of clustered networks: Algorithmic advances and experimental analysis. Inf. Sci.
**2014**, 260, 185–199. [Google Scholar] [CrossRef] - Newman, M.E.J.; Girvan, M. Finding and evaluating community structure in networks. Phys. Rev. E
**2004**, 69, 026113. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Brandes, U.; Delling, D.; Gaertler, M.; Görke, R.; Hoefer, M.; Nikoloski, Z.; Wagner, D. On Modularity Clustering. IEEE Trans. Knowl. Data Eng.
**2008**, 20, 172–188. [Google Scholar] [CrossRef] [Green Version] - Newman, M.E.J. Fast algorithm for detecting community structure in networks. Phys. Rev. E
**2004**, 69, 066133. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Newman, M.E.J. Finding community structure in networks using the eigenvectors of matrices. Phys. Rev. E
**2006**, 74, 036104. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Talbi, E.G. Metaheuristics: From Design to Implementation; Wiley: Hoboken, NJ, USA, 2009. [Google Scholar]
- Fortunato, S.; Barthélemy, M. Resolution limit in community detection. Proc. Natl. Acad. Sci. USA
**2007**, 104, 36–41. [Google Scholar] [CrossRef] [Green Version] - Fouladvand, S.; Osareh, A.; Shadgar, B.; Pavone, M.; Sharafi, S. DENSA: An effective negative selection algorithm with flexible boundaries for self-space and dynamic number of detectors. Eng. Appl. Artif. Intell.
**2017**, 62, 359–372. [Google Scholar] [CrossRef] - Pavone, M.; Narzisi, G.; Nicosia, G. Clonal selection: An immunological algorithm for global optimization over continuous spaces. J. Glob. Optim.
**2012**, 53, 769–808. [Google Scholar] [CrossRef] - Cutello, V.; Oliva, M.; Pavone, M.; Scollo, R.A. An Immune Metaheuristics for Large Instances of the Weighted Feedback Vertex Set Problem. In Proceedings of the 2019 IEEE Symposium Series on Computational Intelligence (SSCI), Xiamen, China, 6–9 December 2019; pp. 1928–1936. [Google Scholar] [CrossRef]
- Di Stefano, A.; Vitale, A.; Cutello, V.; Pavone, M. How long should offspring lifespan be in order to obtain a proper exploration? In Proceedings of the 2016 IEEE Symposium Series on Computational Intelligence (SSCI), Athens, Greece, 6–9 December 2016; pp. 1–8. [Google Scholar] [CrossRef]
- Spampinato, A.G.; Scollo, R.A.; Cavallaro, S.; Pavone, M.; Cutello, V. An Immunological Algorithm for Graph Modularity Optimization. In Advances in Computational Intelligence Systems; Ju, Z., Yang, L., Yang, C., Gegov, A., Zhou, D., Eds.; Springer International Publishing: Cham, Switzerland, 2020; Volume 1043, pp. 235–247. [Google Scholar] [CrossRef]
- Kernighan, B.W.; Lin, S. An efficient heuristic procedure for partitioning graphs. Bell Syst. Tech. J.
**1970**, 49, 291–307. [Google Scholar] [CrossRef] - Sundaresan, S.R.; Fischhoff, I.R.; Dushoff, J.; Rubenstein, D.I. Network metrics reveal differences in social organization between two fission–fusion species, Grevy’s zebra and onager. Oecologia
**2007**, 151, 140–149. [Google Scholar] [CrossRef] [PubMed] - Zachary, W.W. An Information Flow Model for Conflict and Fission in Small Groups. J. Anthropol. Res.
**1977**, 33, 452–473. [Google Scholar] [CrossRef] [Green Version] - Lusseau, D.; Schneider, K.; Boisseau, O.J.; Haase, P.; Slooten, E.; Dawson, S.M. The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations. Behav. Ecol. Sociobiol.
**2003**, 54, 396–405. [Google Scholar] [CrossRef] - Krebs, V. A Network of Books about Recent US Politics Sold by the Online Bookseller Amazon.com. 2008. Available online: http://www.orgnet.com (accessed on 8 April 2020).
- Gleiser, P.M.; Danon, L. Community structure in Jazz. Adv. Complex Syst.
**2003**, 6, 565–573. [Google Scholar] [CrossRef] [Green Version] - Blondel, V.D.; Guillaume, J.L.; Lambiotte, R.; Lefebvre, E. Fast unfolding of communities in large networks. J. Stat. Mech. Theory Exp.
**2008**, 10, 10008–10019. [Google Scholar] [CrossRef] [Green Version] - Civicioglu, P. Transforming geocentric cartesian coordinates to geodetic coordinates by using differential search algorithm. Comput. Geosci.
**2012**, 46, 229–247. [Google Scholar] [CrossRef] - Storn, R.; Price, K. Differential Evolution: A Simple and Efficient Adaptive Scheme for Global Optimization over Continuous Spaces; Technical Report TR-95-012; International Computer Science Institute: Berkeley, CA, USA, 1995. [Google Scholar]
- Storn, R.; Price, K. Differential Evolution—A Simple and Efficient Heuristic for global Optimization over Continuous Spaces. J. Glob. Optim.
**1997**, 11, 341–359. [Google Scholar] [CrossRef] - Glover, F. Heuristics for integer programming using surrogate constraints. Decis. Sci.
**1977**, 8, 156–166. [Google Scholar] [CrossRef] - Martí, R.; Laguna, M.; Glover, F. Principles of scatter search. Eur. J. Oper. Res.
**2006**, 169, 359–372. [Google Scholar] [CrossRef] - Erol, O.K.; Eksin, I. A new optimization method: Big Bang–Big Crunch. Adv. Eng. Softw.
**2006**, 37, 106–111. [Google Scholar] [CrossRef] - Yang, X.S. A New Metaheuristic Bat-Inspired Algorithm. In Nature Inspired Cooperative Strategies for Optimization (NICSO 2010); González, J.R., Pelta, D.A., Cruz, C., Terrazas, G., Krasnogor, N., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 65–74. [Google Scholar] [CrossRef] [Green Version]
- Rashedi, E.; Nezamabadi-pour, H.; Saryazdi, S. GSA: A Gravitational Search Algorithm. Inf. Sci.
**2009**, 179, 2232–2248. [Google Scholar] [CrossRef] - Naeni, L.M.; Berretta, R.; Moscato, P. MA-Net: A Reliable Memetic Algorithm for Community Detection by Modularity Optimization. In Proceedings of the 18th Asia Pacific Symposium on Intelligent and Evolutionary Systems, Singapore, 10–12 November 2014; Handa, H., Ishibuchi, H., Ong, Y.S., Tan, K.C., Eds.; Springer International Publishing: Cham, Switzerland, 2015; Volume 1, pp. 311–323. [Google Scholar] [CrossRef]
- Atay, Y.; Koc, I.; Babaoglu, I.; Kodaz, H. Community detection from biological and social networks: A comparative analysis of metaheuristic algorithms. Appl. Soft Comput.
**2017**, 50, 194–211. [Google Scholar] [CrossRef] - Lancichinetti, A.; Fortunato, S. Benchmarks for testing community detection algorithms on directed and weighted graphs with overlapping communities. Phys. Rev. E
**2009**, 80, 016118. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Lancichinetti, A.; Fortunato, S.; Radicchi, F. Benchmark Graphs for Testing Community Detection Algorithms. Phys. Rev. E
**2008**, 78, 046110. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Danon, L.; Díaz-Guilera, A.; Duch, J.; Arenas, A. Comparing community structure identification. J. Stat. Mech. Theory Exp.
**2005**, 2005, P09008. [Google Scholar] [CrossRef]

Name | $\left|\mathit{V}\right|$ | $\left|\mathit{E}\right|$ |
---|---|---|

Grevy’s Zebras [16] | 28 | 111 |

Zachary’s Karate Club [17] | 34 | 78 |

Bottlenose Dolphins [18] | 62 | 159 |

Books about US Politics [19] | 105 | 441 |

American College Football [1] | 115 | 613 |

Jazz Musicians Collaborations [20] | 198 | 2742 |

**Table 2.**Comparison of Opt-IA and Hybrid-IA on social networks with reference algorithms. For HDSA, BADE, SSGA, BB-BC, BA, and GSA the results are calculated over 30 independent runs, while for MA-Net over 50 independent runs.

Networks | Algorithms | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|

Louvain | Opt-IA | Hybrid-IA | HDSA | BADE | SSGA | BB-BC | BA | GSA | MA-Net | ||

Zebra | Best | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | - |

Mean | - | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2766 | 0.2768 | 0.2768 | - | |

Worst | - | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2768 | 0.2761 | 0.2768 | 0.2768 | - | |

$\sigma $ | - | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0003 | 0.0000 | 0.0000 | - | |

k | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | - | |

Karate Club | Best | 0.4188 | 0.4198 | 0.4198 | 0.4198 | 0.4198 | 0.4198 | 0.4198 | 0.4198 | 0.4198 | 0.420 |

Mean | - | 0.4198 | 0.4198 | 0.4198 | 0.4188 | 0.4198 | 0.4196 | 0.4133 | 0.4170 | 0.419 | |

Worst | - | 0.4198 | 0.4198 | 0.4198 | 0.4156 | 0.4198 | 0.4188 | 0.3946 | 0.4107 | - | |

$\sigma $ | - | 0.0000 | 0.0000 | 0.0000 | 0.0018 | 0.0000 | 0.0004 | 0.0105 | 0.0037 | 0.002 | |

k | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | |

Dolphins | Best | 0.5185 | 0.5285 | 0.5285 | 0.5285 | 0.5268 | 0.5257 | 0.5220 | 0.5157 | 0.4891 | 0.529 |

Mean | - | 0.5285 | 0.5273 | 0.5282 | 0.5129 | 0.5200 | 0.5141 | 0.4919 | 0.4677 | 0.523 | |

Worst | - | 0.5268 | 0.5220 | 0.5276 | 0.4940 | 0.5156 | 0.5049 | 0.4427 | 0.4517 | - | |

$\sigma $ | - | 0.0003 | 0.0009 | 0.0005 | 0.0120 | 0.0040 | 0.0068 | 0.0289 | 0.0155 | 0.004 | |

k | 5 | 5 | 5 | 5 | 4 | 5 | 5 | 4 | 6 | 5 | |

Political Books | Best | 0.5205 | 0.5272 | 0.5272 | 0.5272 | 0.5239 | 0.5221 | 0.4992 | 0.5211 | 0.4775 | 0.527 |

Mean | - | 0.5267 | 0.5270 | 0.5272 | 0.5178 | 0.5203 | 0.4914 | 0.5020 | 0.4661 | 0.526 | |

Worst | - | 0.5063 | 0.5246 | 0.5272 | 0.5137 | 0.5167 | 0.4799 | 0.4815 | 0.4558 | - | |

$\sigma $ | - | 0.0028 | 0.0005 | 0.0000 | 0.0042 | 0.0024 | 0.0084 | 0.0149 | 0.0079 | 0.002 | |

k | 4 | 5 | 5 | 5 | 4 | 5 | 9 | 3 | 5 | 5 | |

Football | Best | 0.6046 | 0.6046 | 0.6046 | 0.6046 | 0.5646 | 0.5330 | 0.5171 | 0.5523 | 0.4175 | 0.605 |

Mean | - | 0.5989 | 0.6039 | 0.6033 | 0.5513 | 0.5277 | 0.5061 | 0.5272 | 0.4032 | 0.601 | |

Worst | - | 0.5736 | 0.6031 | 0.6019 | 0.5430 | 0.5189 | 0.4986 | 0.4742 | 0.3905 | - | |

$\sigma $ | - | 0.0078 | 0.0007 | 0.0009 | 0.0085 | 0.0057 | 0.0069 | 0.0325 | 0.0109 | 0.003 | |

k | 10 | 10 | 10 | 10 | 11 | 6 | 10 | 7 | 5 | 10 | |

Jazz Musicians | Best | 0.4451 | 0.4451 | 0.4451 | - | - | - | - | - | - | 0.445 |

Mean | - | 0.4449 | 0.4450 | - | - | - | - | - | - | 0.445 | |

Worst | - | 0.4449 | 0.4446 | - | - | - | - | - | - | - | |

$\sigma $ | - | 0.0001 | 0.0002 | - | - | - | - | - | - | 0.000 | |

k | 4 | 4 | 4 | - | - | - | - | - | - | 4 |

**Table 3.**Comparison between Hybrid-IA and Louvain on Synthetic Networks with 1000 and 5000 vertices, with respect to modularity (Q) and $NMI$ evaluation metrics.

Hybrid-IA | Louvain | Difference | ||||
---|---|---|---|---|---|---|

$(|\mathit{V}|,\mathit{k},{\mathit{\mu}}_{\mathit{t}})$ | $\mathit{Q}$ | $\mathit{NMI}$ | $\mathit{Q}$ | $\mathit{NMI}$ | $\mathit{Q}$ | $\mathit{NMI}$ |

$(1000,20,0.1)$ | $0.8606$ | 0.9980 | $0.8607$ | $0.9931$ | $-0.0001$ | $+0.0049$ |

$(1000,20,0.2)$ | $0.7622$ | 0.9970 | $0.7622$ | $0.9909$ | $0.0$ | $+0.0061$ |

$(1000,20,0.3)$ | $0.6655$ | 0.9927 | $0.6642$ | $0.9790$ | $+0.0013$ | $+0.0137$ |

$(1000,20,0.4)$ | $0.5668$ | 0.9905 | $0.5656$ | $0.9588$ | $+0.0012$ | $+0.0317$ |

$(1000,20,0.5)$ | $0.4685$ | 0.9857 | $0.4685$ | $0.9393$ | $0.0$ | $+0.0464$ |

$(1000,20,0.6)$ | $0.3687$ | 0.9767 | $0.3658$ | $0.9084$ | $+0.0029$ | $+0.0683$ |

$(1000,20,0.7)$ | $0.2707$ | 0.9127 | $0.2635$ | $0.6969$ | $+0.0072$ | $+0.2158$ |

$(5000,20,0.1)$ | $0.8923$ | 0.9991 | $0.8934$ | $0.9589$ | $-0.0011$ | $+0.0402$ |

$(5000,20,0.2)$ | $0.7927$ | 0.9966 | $0.7948$ | $0.9399$ | $-0.0021$ | $+0.0567$ |

$(5000,20,0.3)$ | $0.6929$ | 0.9967 | $0.6959$ | $0.9282$ | $-0.0030$ | $+0.0685$ |

$(5000,20,0.4)$ | $0.5931$ | 0.9945 | $0.5975$ | $0.9076$ | $-0.0044$ | $+0.0869$ |

$(5000,20,0.5)$ | $0.4936$ | 0.9953 | $0.5001$ | $0.8789$ | $-0.0065$ | $+0.1164$ |

$(5000,20,0.6)$ | $0.3939$ | 0.9976 | $0.4027$ | $0.8518$ | $-0.0088$ | $+0.1458$ |

$(5000,20,0.7)$ | $0.2929$ | 0.9942 | $0.3033$ | $0.8064$ | $-0.0104$ | $+0.1878$ |

$(5000,20,0.7)$ | $0.2929$ | 0.9942 | $0.3033$ | $0.8064$ | $-0.0104$ | $+0.1878$ |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Cutello, V.; Fargetta, G.; Pavone, M.; Scollo, R.A.
Optimization Algorithms for Detection of Social Interactions. *Algorithms* **2020**, *13*, 139.
https://doi.org/10.3390/a13060139

**AMA Style**

Cutello V, Fargetta G, Pavone M, Scollo RA.
Optimization Algorithms for Detection of Social Interactions. *Algorithms*. 2020; 13(6):139.
https://doi.org/10.3390/a13060139

**Chicago/Turabian Style**

Cutello, Vincenzo, Georgia Fargetta, Mario Pavone, and Rocco A. Scollo.
2020. "Optimization Algorithms for Detection of Social Interactions" *Algorithms* 13, no. 6: 139.
https://doi.org/10.3390/a13060139