A Multiagent Memetic Optimization Algorithm Based on Temporal Asymptotic Surprise in Complex Networks to Reveal the Structure of the Dynamic Community

Complex networks are used in a variety of applications. Revealing the structure of a community is one of the essential features of a network, during which remote communities are discovered in a complex network. In the real world, dynamic networks are evolving, and the problem of tracking and detecting communities at different time intervals is raised. We can use dynamic graphs to model these types of networks. This paper proposes a multiagent optimization memetic algorithm in complex networks to detect dynamic communities and calls it DYNMAMA (dynamic multiagent memetic algorithm). The temporal asymptotic surprise is used as an evaluation function of the algorithm. In the proposed algorithm, work is done on dynamic data. This algorithm does not need to specify the number of communities in advance and meets the time smoothing limit, and this applies to dynamic real-world and synthetic networks. The results of the performance of the evaluation function show that this proposed algorithm can find an optimal and more convergent solution compared to modern approaches.


Introduction
Dynamic networks change over time and are used in various fields. Identifying dynamic communities in complex networks is of great importance. A community in a complex network is a collection of close operations with other community entities. e existence of direct communication is a unique and essential action. Most of the new, improved tools and algorithms have been used for static networks, where the input graph cannot be changed, while most real networks have a dynamic nature [1]. Because real-world networks constantly change dynamically, community detection in static networks cannot capture natural phenomena and essential dynamics. Discovering communities in dynamic networks helps to find the laws of network evolution processes, which have been necessary for obtaining basic structural information in social [2][3][4] and biological systems [5,6]. Evolution-based methods integrate communities and their evolution by simultaneously considering current and historical community structures in dynamic networks [7]. With increasing access to dynamic networks, the issue of detecting dynamic communities has become a new and vital topic in research, and various methods have been proposed for it [8,9]. If static networkbased methods identify real-world network communities, critical changing situations are easily lost [10]. Optimization has been considered the most critical issue in evolutionary sciences and methods. Evolutionary methods provide computational methods in which an iterative process is used to improve the resulting solutions until the termination condition is met.
One of the optimization algorithms is an advanced discrete version of the Water Cycle Algorithm (WCA) to solve the Traveling Salesman Problem (TSP) [11]. A PSObased optimization method is proposed for fuzzy navigation cognitive maps [12]. In this method, the complexity of the optimization problem requires the automatic adaptation of fuzzy cognitive map parameters, which evolutionary algorithms have proven to be effective in this field. Other optimization algorithms include a reinforcement learningbased control method that uses a Q-learning algorithm and meta-heuristic gravity search algorithm and has good performance to solve optimization problems [13]. An optimization method based on the heuristic algorithm is proposed in [14], which uses effective rule classification for string adaptation architectures with heterogeneous bit divisions.
is method uses the uniqueness of the target pattern to classify all the characters in the target law and estimate the distance between strings to reduce memory demand. e optimization of fuzzy controllers for nonlinear processes is described in [15], which uses a meta-heuristic algorithm whose evaluation results indicate the high efficiency of this method. e problem space on static problems remains unchanged during the optimization process. At the same time, most optimization problems are dynamic in the real world; the problem search space changes during the optimization process. In static optimization problems, finding the global optimal point is the primary goal, while finding the optimal global effectiveness is not the only goal of dynamic optimization. Tracking the optimal point in the problem space is very important. It is noteworthy that in many evolutionary optimization findings in dynamic environments, the concept of dynamic problems or time-dependent problems is not discernible. In these findings, dynamic optimization problems are defined sequentially as static problems. We have a dynamic problem using the time function in optimization; otherwise, we have a static problem [16]. In real-world network analysis, when data become temporal, the issue of modeling structural changes in networks becomes critical, and these types of networks become evolutionary. e activity of user groups over time can predict future behaviors on the network, such as clusters of famous writers in the Blogosphere [2], online networks such as Facebook and Twitter, and mobile networks. Dynamic networks have become widely popular in many fields and provide dynamic tracking of network structure [17]. In dynamic networks, two conflicting criteria are often considered for the problem of community recognition. First, they need to maximize the quality of the snapshot and measure the clustering performance of the photo at this time. en, minimize time costs. In this way, in dynamic networks, the problem of community structure recognition can be considered a multiobjective optimization problem [18].
In this paper, a new algorithm is introduced called a dynamic multiagent memetic algorithm in unweighted and undirected complex networks. In this algorithm, the agents are placed in a network-like structure. is algorithm is then used in complex networks for dynamic community detection and is named DYNMAMA (dynamic multiagent memetic algorithm). e evaluation function used in this algorithm for the dynamic environment is based on an example of an improved surprise function called temporal asymptotical surprise (TAS). e most popular criterion for the quality of a partition in a static network is modularity.
However, this criterion is not a good choice in dynamic networks because the measurement has an inherent resolution limit. Surprise can overcome the resolution limit, and we can use it to reveal the exact community structure of complex networks. But surprise optimization has high computational complexity. We use the TAS formula in the structure of multiagent memetic algorithms in dynamic networks and conclude that it can achieve better results in detecting communities. We show that with this function, we can obtain better results in the problem of dynamic community detection, and we can apply it to other problems of the dynamic environment. DYNMAMA is suitable for handling large-scale complex problems.
In the following, the structure of the paper is as follows: in the second part, some related works are briefly reviewed. In the third part, dynamic community detection is explained. In the fourth section, optimization and multiagent systems are described. In the fifth part, a multiagent memetic optimization algorithm in complex networks for dynamic community detection is introduced. In the sixth part are the results of tests and evaluations. e seventh part includes discussion and future work, and the last part is the conclusion.

Related Works
e benefits of detecting communities in dynamic networks have led to much research in this area, such as methods based on two-step strategy [19], incremental clustering, evolutionary clustering [20], and multiagent algorithms [21]. We analyzed the structure of the distributed community through a tracking method. Another method is to use a few snapshots of the fixed network to evolve communities over time. It introduces a clustering method that tracks and evaluates the evolution of clusters, which are the same communities, over time.
FacetNet, presented in [2], is a structure for community analysis in dynamic networks which operates based on instant photo cost optimization and ensures that it converges to an optimal local solution. Its convergence is slow, and communities must first be identified for each time slot and then compared to determine correspondence. e idea provides a framework for discovering communities that maximize temporal evolution. e concept of game theory has been used to identify static communities [20,21]. is approach has also been proposed by Alvari et al. To identify communities in dynamic networks, the game theory method provides for dynamic community detection in which each node behaves as a logical representative [22]. Structures for evolutionary spectrum clustering are provided that include cluster quality maintenance parameters and cluster membership maintenance. In evolutionary clustering, we must take two goals into account: that the result of good clustering should be well-proportioned with current data and also not be significantly different from recent history at the same time. In this idea, smoothness measurement is integrated into the overall measure of clustering quality using the wellknown k-means clustering. In [18], a multiobjective safety algorithm is presented. is algorithm can optimize both 2 Computational Intelligence and Neuroscience modularity criteria and normalized mutual information criteria simultaneously. A multiobjective method is proposed that identifies communities with temporal softness as a multiobjective problem and is based on genetic algorithms. e main advantage of this algorithm is that it automatically offers a solution that shows the best exchange between the obtained clustering accuracy and the deviation from one step to another [4]. A genetic algorithm with merging and splitting operators called MSGA [23] has been proposed to identify a dynamic community based on asymptotic surprise [24] and the maximum temporal asymptotic surprise to measure and calculate the quality of partitions in a dynamic network. Wang et al. [25] have proposed a new method of targeted optimization for community-based immunization to select immunization nodes. In this method, the structures of society are first discovered.
en, according to the characteristics that exist in the structure of society, potential candidates are limited. Finally, a new memetic algorithm selects safe nodes from the node set. Targeted immunization is formulated as an optimization problem. As mentioned earlier, dynamic communities change at different intervals and thus evolve with other developments. We can offer various approaches to achieve these communities [26]. One of these methods is the instant optimization that the currently identified associations should be the most relevant associations that only consider the current state of the network [27][28][29]. In the temporal trade-off method, the communities identified presently correspond to the balance between the best relatively stable communities to the network and the history of the communities built. is method consists of three steps. First, identify fixed communities at present. Second, identify existing communities later, using communities acquired earlier, and in the third step, it returns to the second step to complete all the processes. In the cross-time community detection method, all stages of evolution are studied simultaneously. By considering in a single transition all network cycles and creating a single decomposition, single community detection is performed, i.e., instant detection on all snapshots [30][31][32][33][34]. Figure 1 shows some of the most prominent algorithms that have been proposed so far for these approaches. Various ideas of the memetic algorithm have been proposed for community detection in a static environment. e memetic algorithms have been able to attract the interest of many researchers and are one of the most desirable methods of evolutionary optimization. Table 1 shows examples of the application of memetic algorithms in community detection in networks, which shows the type of crossover operators and mutations used in them. Several studies focused on the neighbor mutation that guarantees that each mutated gene is linked only with one of its neighbors. is method can cause one of two effects that relate to a community's state by either splitting a single community or combining two communities and ultimately modifying the community structure.
In adaptive mutation, the mutation rate varies according to the fitness value, previous mutation rate, or the number of generations (assuming that the mutation points are determined randomly). Other new methods have been proposed in dynamic networks to solve and optimize the problem of community detection.
Mishra et al. [45] proposed a tree-based structure in dynamic networks that uses connection and penetration methods to maintain and record information about the discovery and change of communities at different time intervals. e spiderweb method is suggested in [46], which uses the idea of a spider web by forming subgraphs of nodes to identify a community. In [47], a new method for identifying dynamic communities is introduced, which works based on the distance between the resistance, identifying the core node, and using a noise community. Also, a method based on classification approaches, including top-up, topdown, and based on the data structure to identify the community in dynamic networks, is proposed [48]. Other new algorithms based on ant colony and network node attributes have been proposed in [49,50] for community detection.
e chaotic memetic algorithm is a new method for detecting the structure of the community in complex networks that use a modularity function [51]. In this method, a chaotic memetic algorithm is proposed that uses both chaotic numbers instead of random numbers in global and local search processes, preserving population diversity and preventing local optimization from falling.

Dynamic Community Detection
Community detection, one of the problems of social network analysis, is the detection of hidden structures in the network and the division of the network into partitions where the communication between network members is dense in each section. Network partitioning is modeled in the form of the objective function optimization problem. Detecting communities fall into the category of NP-Hard issues. Figure 2 shows the relationship of members of a community.
Community detection is often used in complex networks. ese networks represent systems or data that are not random and can originate from nature, community, or anything else. A group of nodes can be defined as an association in a network whose dense internal connections rarely have external links. We can obtain commonalities or relationships from community detection [52]. Today, networks are extensive in scales that are constantly changing their structure. A dynamic network can be considered a collection that includes snapshots at different time intervals. e first feature of dynamic community detection is used in dynamic networks. Networks evolve and can originate from a variety of contexts. Gathering information in real time as soon as they appear is another way to get a changing network.
We can obtain the community model by combining a previous timestamp or a network snapshot. According to a dynamic G network, periods can be discrete or continuous in a dynamic community without changing the nature of dynamic communities. We can use operations in dynamic communities that include six different operations on communities. Cazabet et al. [53] added a seventh operation, which provides for growth, contraction, merging, splitting, Computational Intelligence and Neuroscience birth, death, and resurgence as shown in Figure 3. Figure 3 shows that the growth operation can enlarge a community by merging new nodes. e contraction operator in a community means removing some nodes and making that community smaller. e merging operator involves combining two or more communities into one community. e splitting operator implies that a community can be divided into two or more other communities. In birth operations, we can create a new community over some time.
e death operator means that a community can be destroyed or disappear at any time. In resurgence operations, a community that has vanished in a limited time can reappear at another time.
Most optimization problems are dynamic in the real world, and the problem search space changes during the optimization process. Finding the global optimal point is not the only goal of dynamic optimization, and tracking the optimal point in the problem space is very important. If the cost function of the optimization problem is not a function of time, we are dealing with a static optimization problem.
Still, if time also enters the cost function, the problem of optimization becomes dynamic. Effective optimization over time depends on the increasing effect of instabilities caused by the parameter space on the time vector. Complex timedependent systems can have dense components in cohesive groups of nodes known as "communities." In the real world, network topologies change over time. Figures 4 and 5 show the structure of a variable community with time, and the following figures show the evolution of the community in a dynamic network [54]. An evolutionary algorithm based on clustering in dynamic networks has been proposed by Chen et al. [55]. Other algorithms for detecting dynamic communities have also been proposed in [56][57][58][59]

Optimization and Multiagent Systems
e goal of optimization is to find the best acceptable answer, given the limitations and needs of the problem. ere may be different answers to a problem, and the objective function is defined to select the optimal solution. Multiagent Community structure in timedependent, multiscale, and multiplex networks systems provide the opportunity to calculate and optimize many complex problems. ere are two critical issues involved in designing multiagent systems: the first is the design of the agent, and the second is the creation of the environment for the performance and relationship between the agents, in agent design, how to build an agent capable of performing independent tasks and autonomous actions. In designing a community or operating environment, the key is how to create agents that can interact with one another. is relationship implies cooperation, coordination, and negotiation between agents. It is indispensable for accomplishing the tasks we have been given because not all agents have common goals or create the same interests. In Figure 6, you can see the structure of an environment with two agents and what parts each agent contains, and what kind of relationship it has with the other agent. eir neighborhood knowledge determines the relationship between the two agents. ey were deciding whether two agents were adjacent to each other. We can combine multiagent systems and evolutionary algorithms to form new algorithms to solve optimization problems. e optimization algorithm is introduced that uses the structure of a multiagent system to optimize the extractive text summarization problem [60]. is method combines the optimization algorithm based on biogeography (BBO) and the concepts of multiagent systems to create an optimal summary, the results of which show the efficiency of this method. Agents live in a network, and each agent is fixed at a network point. All agents can increase their energy in competition with their neighbors and use domain knowledge. Combining evolutionary algorithms and multiagent systems leads to convergence to optimal global solutions, which occurs at high speed. ey are also used to solve large-scale problems with thousands of dimensions, and this hybrid structure has been able to achieve good performance and reduce computational costs. Also, a method based on the multiagent particle swarm optimization approach has been proposed to improve the text summarization. In this method, each particle is upgraded with the status of multiagent systems [61]. e environment, as an agent, provides environmental information to other agents. When the search is limited to points that have not yet been met, the search speed increases.
In the community detection problem, the agent is defined as dividing a network, a candidate solution to solve the problem. Because the agents live in a network-like

Types of memetic algorithms in community detection References
Crossover method Mutation method Gong et al. [35] Two-way X Neighbor Zalik and Zalik [36] X-based modularity and community size Neighbor Haque et al. [37] Add random vertices X Delete random node Naeni et al. [38] Modularity-based X Adaptive Wu and Pan [39] One-way X Neighbor Mu et al. [40] One-way X One neighbor point Wang et al. [41] Uniform X One point Ma et al. [42] Two-way X Neighbor Gach and Hao [43] Priority-based X -Gong et al. [44] -Neighbor label  Computational Intelligence and Neuroscience environment, they are called network agents who can exchange information with their neighbors. Multiagent systems have been integrated with evolutionary algorithms to solve constraint satisfaction problems and combinatorial optimization problems with satisfactory results.

Multiagent Memetic Optimization Algorithm to Dynamic Community Detection (DYNMAMA)
e memetic algorithm is one of the evolutionary algorithms, and it is a hybrid optimization method that adds local search to the evolutionary optimization process, increases convergence speed, and can successfully solve complex optimization problems. In this algorithm, each member of the population can grow its fitness as its neighbors. e utility of each of the answers in this algorithm is calculated based on the fitness function, and it generates new responses using the intersection and mutation operators. A local search is done on each generation at the end of this algorithm. A set of solutions of that generation and a subset of the current generation are transferred for the next generation's survival. Generating new generations continues until fulfilling the stop condition. e local search strategy is the most critical key to the effectiveness of memetic algorithms. e proposed algorithm, the multiagent memetic algorithm in dynamic community detection, is called DYN-MAMA. In this structure, agents live in a network-like environment. Agents can live in the environment and apply activities according to their understanding, and specific goals can guide them. Because each agent interacts with its environment and other agents, it can increase its energy, which allows the multiagent memetic algorithm to optimize the objective function value. We can base agents' decisionmaking on parameters defined as agents' input, and agents can use appropriate actions and activities to solve and optimize the problem. One of the most critical applications of multiagent systems is modeling complex systems, and the structure of networks can be considered a complex system. We can use graphs for modeling that graph nodes are agents, and having a link and edge between agents means having their relationship. Multiagent systems can be the optimal way to solve the problem of complexity in the structure of networks such as social networks. If we want to model complex dynamic networks, this is very costly and requires a lot of processing. We can model this complex dynamic network with less cost and processing because of agents' features in multiagent systems, such as scalability and flexibility. An agent can use local search to increase the value of its evaluation function based on the appropriateness of the importance of its neighbor's evaluation function. When the environment of multiagent systems is dynamic, then for learning operations, we must constantly update agents. Sharing knowledge between agents and their neighbors leads to joint learning, effectively removing and reducing obstacles. Each agent competes or cooperates with other neighboring agents to achieve its ultimate goal in optimization issues. Neighborhood competition, crossover, mutation, and self-learning operators are defined for these operating behaviors. Figure 7 introduces the parameters that make up our proposed algorithm and explain how we can apply the parameters according to the application of the algorithm. In the proposed algorithm, we need to enter the data at each step for processing. Initialization should be done based on the data of that time and based on the number of nodes and connections between nodes, then partitioning should be done, and we should enter the next stage or time. We will enter new data into the program again and operate the data again. is method does not need to specify the number of communities in advance and, at the same time, satisfies the time smoothing limit. e initial values of the agents are random, and in the following steps, the populations are randomly assigned with the best sample of the community in the previous time step. e dynamic network G is represented by a set of instantaneous images of the network G � G 1 , DYNMAMA uses a locus-based adjacency encoding schema.
is schema brings to these approaches the advantage that the number of communities does not need to be specified in advance. In this graph-based structure, each g genotype contains n genes. Each g i gene can take up any of the neighboring node nodes. erefore, any value of j assigned to the gene i is interpreted as a link between i and j. As a result, these nodes are in the same community. For example, suppose a network is assumed to be in Figure 8.
is graph has 15 nodes and can be divided into three communities. An example of a possible chromosome is illustrated. Each community is a subset of network vertices. e complex multiagent memetic algorithm for community detection has the following basic steps: neighborhood-based integration operator, hybrid integration operator, adaptive mutation operator, self-learning operator, fitness function, and local search, which are detailed in each step. Each of these parameters is described below.

Division Operator and Neighborhood Competition Based
Integration (Split and Merging). We consider the agent in the a, b coordinates of the grid to be Z a,b , and the agent with the highest energy among the neighbors to be Max a,b . If the amount of energy Z a,b is greater than the amount of energy Max a,b , then Z a,b will be the winner, and it is one of the best and can survive; otherwise, the agent Z a,b is replaced by For the loser and replacement mode, two strategies can be proposed that emphasize exploitation or exploration Max a,b chooses one of these strategies considering the probability. An agent locates at (a, b), a, b � 1, 2 . . . Size { }, and an agent Z a,b consists of N genes. If there is a connection between nodes i and k, then the g i gene takes the value of k. In this display, k � (g i � k) and the indices of i and k are in a similar community. We define a genotype that explores the relationship between specific nodes and communities. In this method, we consider two approaches to detect the allele value of a random gene from each agent. e gene selected for each agent that is randomly determined is called the target gene. We choose an approach by choosing a random number. We compare the energy of the modified energy agent (Z a,b ) with the point of the best agent in the energy neighborhood Max a,b , and if the energy improves, we save the new agent. e modified agent (Z a,b ) is compared with the energy of the best agent in its neighborhood (max a,b ). In the case of energy improvement, the new agent is saved; otherwise, we will replace it with the best neighbor. If Z a,b satisfies equation (1), it is a winner; otherwise, it is a loser.
Max a,b is first mapped on [0, 1] and generates a new agent, New a,b , and then, New a,b is put on the lattice point. We used the division and integration operator to remove lower energy agents from the network.

Hybrid Integration Operator (Crossover).
In the proposed method, a neighboring integration operator is defined that consists of combining two types of two-point and uniform integrations. In this function, using two integration action strategies, an agent Z a,b is integrated with the best agent in its neighborhood max a,b . Each strategy is selected based on the P x probability. If u(0, 1) < p x , the first strategy is adopted; otherwise, we will use the second strategy. e first strategy begins with the two-point integration and the random selection of points k 1 and k 2 . If u(0, 1) < 0.5, the Computational Intelligence and Neuroscience genes between the two selected points of max a,b are replaced with Z a,b ; otherwise, we will replace the genes outside these selectable points with each other. In fact, in the first strategy, we map the genes between positions k 1 and k 2 of max a,b to Z a,b . Otherwise, the rest of the genes are mapped to Z a,b . In the second strategy, a uniform integration operator is used in which max a,b and Z a,b are integrated, and Z a,b is replaced with the new agent.

Mutation Operator.
e mutation is performed based on the probability p b . If u(0, 1) < p b , then the value of the gene is replaced by the neighbor allele's value in its neighborhood list. Also, the p b changes to achieve better results in an adaptive mutation operator. Equation (2) shows the mutation.
where N x is the end criterion and P b is the probability of mutation.

Local Search.
e local search is applied to agents after generating a new generation and replacing it with previous generations in the proposed algorithm. Accordingly, for each agent, a neighborhood radius is considered that the neighbors of each agent Z a,b in the proposed method are determined based on equation (3). Each agent is compared with the neighboring agents in terms of energy. In equation (3), Z size is the size of the population. Agents are used to detect communities within graphs. We show the neighborhood structure we used in Figure 9.    Computational Intelligence and Neuroscience improves agent energy until no improvement is achieved. e self-learning operator is essential in improving the performance of our proposed algorithm.

Fitness Function.
A statistical measure of the community is called a surprise. e formula of this criterion is shown in the following equation: where (i) M � the maximal number of links (ii) M int � the maximal number of intracommunity links (iii) m � the number of existing links (iv) m int � the number of existing intracommunity links Surprise can eliminate the degree of resolution and, by maximizing it, can accurately reveal the community structure of networks, but optimization with this method has high computational complexity. Trag et al. presented an exact asymptotic approximation of surprise or asymptotic surprise called asymmetric surprise or AS. Asymmetric surprise can accurately measure and quickly calculate the quality of partitions in a dynamic network. Detecting a dynamic community is a matter of maximizing this function. is method lacks a resolution that makes the structure of the community more accurate. Its formula is shown in the following equation: where Asymmetric surprise has been developed for the temporal asymptotical surprise (TAS) for dynamic community detection. We used TAS as the fitness function to optimize.
For a given partition π, the temporal asymptotical surprise at time t is defined according to equation (7), which shows that the asymmetric temporal surprise at time t depends on AS at t, t − 1, . . . , t − k( 1 ≤ k ≤ t − 1). Given a partition π, we can obtain the total numbers of internal links mint and possible internal links Mint.
A chromosome is decoded into a partition, and the TAS associated with the partition and current time step is calculated using equation (7).
A dynamic network G is given by a series of network snapshots, G � G1, G2, . . . , GT { }. Parameter β is an input parameter that measures the relative importance of the snapshot cost in the whole one. erefore, to calculate the fitness of each population, first, the populations are converted to partition by decoding. en, the fitness value for each population is calculated by the TAS function. If we consider TAS as a qualitative criterion for communities, the problem of detecting the structure of the community becomes the problem of finding the partition of the network with the optimal value of TAS. Algorithm 1 shows our proposed method, DYNMAMA, for dynamic community detection. We use TAS as an effective measure to evaluate the quality of a partition on the snapshot of the dynamic network. As an extension of asymptotic surprise, TAS is preferable for dynamic community detection because it can break resolution limits and supports temporal smoothness for adjacent snapshots. Figure 10 shows the flowchart of the multiagent memetic algorithm in dynamic community detection, DYNMAMA. e value of parameters used in our proposed algorithm is according to Table 2.

Test Results and Analysis
In this section, we test the results of evaluating the effectiveness of using the multiagent memetic algorithm in complex networks for dynamic community detection (DYNMAMA). e results of the suitability value or the same TAS and NMI (normalized mutual information) [62] are calculated at each time step. As an evolutionary method, we have to set several parameters. Finally, we compare the proposed method with state-of-the-art approaches, such as MSGA [23], DYNMOGA [4], ESPRA [63], and FacetNet algorithms [2], which are well-known evolutionary approaches for the accurate detection of dynamic communities in networks. ese methods are in dynamic networks and are based on evolution, which integrate the extraction and evolution of societies by simultaneously considering the structures of current and historical community. In MSGA, a genetic algorithm improved by the split and merge operator is used for dynamic community detection. First, the algorithm gets the dynamic network, the number of time steps, and the population size. en, it generates the best partition for each time step. e initialization is divided into two parts. 90% of the initial Computational Intelligence and Neuroscience populations are randomly selected, and the remaining 10% are quantified by the best samples of the previous population. e standard parameters are considered the same for better comparison in both methods.
In fact, by comparing this algorithm with our proposed method, we want to examine whether local search in a memetic algorithm can improve the results or not. In the DYNMOGA algorithm, which is based on a genetic algorithm, the discovery of communities in dynamic networks has been proposed as a multiobjective optimization problem to increase the quality of snapshots and reduce time costs. ESPRA is a clustering method for finding dynamic communities presented under temporal smoothness. FacetNet uses a random model to generate communities and a probabilistic model to capture community change and discovers communities that maximize time evolution. We run our algorithm in MATLAB 2016, and we select solutions with the maximum value of NMI at each run.

Data Sets.
We tested DYNMAMA performance on realworld dynamic networks and synthetic networks, which we describe below:

Real-World Network: Enron Email.
e data set used a collection of emails sent between employees of an organization collected between 1999 and 2002. e data set we reviewed is part of these emails sent to employees within the organization for 12 months. e smaller version of this data set contains the following: the number of employees is 151, and the number of emails sent is 50,572. erefore, in the network structure, the number of 151 nodes and the number of directional links equal the number of emails sent. e Enron email data supporting this study's findings are available with the identifier "https://doi.org/10.1109/TKDE.2013.131" [4]. e number of different links without repetition is equal to 2235. Also, the number of time steps is 12.

Synthetic Network: LFR Benchmark.
is database is one of the standard graphs that achieve heterogeneity in the distribution of node degree and size of the community in the dynamic environment. e LFR data supporting this study's findings are available with the identifier [3]. at is, we can trace communities over time in unstable networks. is data set is a network generator that can generate dynamic where k A is the number of communities in A, k B is the number of communities in B, D is the confusion matrix, and N is the number of elements. In addition to NMI, the error rate [2] can also be used to evaluate the distance between a detected partition and the ground truth. At the error rate, the Z matrix is used to represent the partitions and the G matrix is used to represent the ground truth. If the number of nodes in the network is n, the number of communities in a detected partition is k, and the actual number of communities is m, Z � n × k, and G � n × m. e error rate is then defined as the norm ZZ T − GG T , that is, nonzero inputs and the detected partition will be more accurate if the error rate is lower. e error rate measures the distance between the community structures represented by Z and G.

Results of the DYNMAMA.
First, the results based on the best NMI values in the Enron email network are presented for comparison and analysis. To calculate the NMI value, we need to know the initial communities in the Enron email network. Figure 11 shows the NMI results for DYNMAMA, MSGA, DYNMOGA, and ESPRA. As you can see in Figure 11, our proposed method, DYNMAMA, has been more successful than other methods in obtaining values close to 1, which indicates the high accuracy of the proposed method and the high quality of the dynamic communities discovered. e MSGA algorithm has also obtained good values close to our proposed method. For example, in step 9, the NMI values obtained by DYNMAMA and MSGA are 0.8309 and 0.8024, respectively, which are close to each other. At this time, the NMI values obtained from the other two methods, DYNMOGA and ESPRA, are 0.6718 and 0.5491, respectively, which have weaker answers than our proposed method. Our proposed method maintains the NMI values obtained in these 12 time steps between 0.7625 and 0.8685. e highest value that the MSGA method has been able to get for NMI is 0.8081 in time step 3, for the DYNMOGA method, 0.7821 in time step 7, and for the ESPRA method 0.6527 in time step 10 in the Enron email network data set. In Figure 11, the lower error rate is related to our proposed algorithm in all time steps, which, for example, in step 6 was able to achieve the value of 508. e lowest error rates for other comparable algorithms are 610, 903, and 990 for MSGA, DYNMOGA, and ESPRA, respectively. We observe that in this network, the highest error rate in all time steps is related to the ESPRA algorithm.
In Table 3, the results of the TAS value in each time step are calculated for the best partitioning in each step in the proposed dynamic community detection algorithm, DYN-MAMA, in the Enron email network. In other words, after determining the best solution or the best partition in each step, its TAS value is determined and shown in Table 3. Both DYNMAMA and MSGA methods use the TAS evaluation function, and the DYNMOGA method uses the Q modularity evaluation function. |C| D1 and |C| D2 are the number of dynamic communities detected in DYNMAMA and DYNMOGA methods, respectively, and |C| M is the number of dynamic communities detected in MSGA. |V| and |E| are the number of nodes and edges, and |E * | is the number of undirected edges.
As shown in Table 3, the number of evaluation functions and the number of dynamic communities detected are variable at each time step for each method. For example, in time step 2, the numbers of dynamic communities obtained by the DYNMAMA method equal 12. For the two methods, MSGA and DYNMOGA are equal to 11 and 9, respectively. Also, at the same time step, the value of TAS in the DYNMAMA method is equal to 179.563, and in the MSGA method, it is equal to 178.376, and the value of modularity function in the DYNMOGA method is equal to 0.5348. In time step 12, the numbers of dynamic communities obtained by the DYNMAMA method are equal to 14, and for the two methods, MSGA and DYNMOGA are equal to 13 and 9, respectively. Also, at the same time step, the value of TAS in the DYNMAMA method is equal to 376.025, and in the MSGA method it, is equal to 329.668, and the value of modularity function in the DYNMOGA method is equal to 0.5175. In other words, the proposed method has been able to increase and improve the value of its evaluation function and detect more dynamic communities. Because both DYNMAMA and MSGA methods use the TAS function, their values at each time step for comparison are shown in Figure 12. As can be seen in the results, the proposed method (DYNMAMA) in the Enron email network has been able to achieve better results than the MSGA method and achieve better answers in each step. It allows for better partitioning, and the detected communities are more accurate. e structure of the communities detected by the proposed DYNMAMA method at time steps 3 and 4 for the email network can be seen in Table 4. If we want to compare operations in the third and fourth time steps according to e results of the LFR data set are shown below. We mentioned earlier that this benchmark is closer to real-world networks regarding node degrees and community size. Figure 13 shows the performance of our proposed algorithm, DYNMAMA, and the other four algorithms, MSGA, DYNMOGA, ESPRA, and FacetNet, in the birth and death of the LFR network. In evaluating and comparing the results, we can see that the DYNMAMA method has obtained the NMI value always better than the other four methods and the value of 1 or relatively close to 1. e minimum NMI in the DYNMAMA method is 0.9967 in time interval 1. It means that our proposed method has always been able to obtain more accurate quality communities in periods of 1 to 10 than the other two methods.
e existence of local search in the structure of memetic algorithm and cooperation and evolution of factors in the network structure such as multiagents in the DYNMAMA method have improved the results continuously upward. DYMAMA and MSGA are relatively equal and close to each other in the birth and death part of the LFR data set at time intervals 2, 5, 7, and 8. DYNMOGA maintained the NMI values obtained, except for step one, between 0.9754 and 0.9936 in steps 2 to 10. ESPRA received the highest NMI value in time 5 with 0.9871. FacetNet also got the highest value in time 6 with 0.9878 and the lowest value in time 1 with 0.9714. In Figure 13, the lower error rate is related to our proposed algorithm in all time steps, which, for example, in step 6 was able to achieve the value of 69. e lowest error rates for other comparable algorithms are 84, 468, 2032, and 6543 for MSGA, DYNMOGA, ESPRA, and FacetNet, respectively. We observe that in this network, the highest error rate in all time steps is related to the FacetNet algorithm. Figure 14 shows the performance of our proposed algorithm, DYNMAMA, and the four comparable algorithms in the expansion and contraction section of the LFR data set in 10 time steps. Both DYNMAMA and MSGA algorithms perform well. In each time step, DYNMAMA has higher accuracy in terms of NMI value in this part of the network than the LFR database, and except for time steps 2, 6, and 9, it has been able to obtain a value of 1 at other times. MSGA has also been able to get values close to 1, and the minimum NMI value for it in the time interval is four and equal to the value of 0.9926. DYNMOGA has a value of 0.9301 in NMI in period 1. In period 2, this value has improved to 0.9801 but still changes sequentially between 0.9740 and 0.9880 in 3 to 10 time steps. Because DYNMOGA uses the modularity function as the optimization function, we can raise the issue of resolution in the face of these changes.
ESPRA has the highest NMI value in time 1 with 0.9951, and FacetNet has the highest value in time 7 with 0.9655. In Figure 14, the lower error rate is related to our proposed algorithm in all time steps, which, for example, in step 10 was able to achieve the value of 101. In this time step, error rates for other comparable algorithms are 139, 2111, 3899, and 8195 for MSGA, DYNMOGA, ESPRA, and FacetNet, respectively. We observe that in this network, the highest error rate in all time steps is related to the FacetNet algorithm. ESPRA was able to obtain a lower error rate than DYN-MOGA in steps 2, 4, and 6. We have already mentioned that the lower the error rate, the higher the accuracy of community detection. Figure 15 shows the performance of our proposed algorithm, DYNMAMA, and the four algorithms MSGA, DYNMOGA, ESPRA, and FacetNet in the merging and splitting section of the LFR database. As you can see, DYNMAMA has been able to detect communities more accurately in obtaining NMI than the other four methods. Also, the presence of the TAS function with the property of breaking the resolution limit in both DYNMAMA and MSGA methods is a better criterion for detecting dynamic communities and can find higher quality communities, which has resulted in an NMI value of either one or almost 1.
e NMI values obtained in this section for DYNMAMA ranged from 0.9910 to 1 during steps 1 to 10. MSGA ranged has been able to detect dynamic communities with better quality than the DYNMOGA method in these two time steps. In Figure 15, the lower error rate is related to our proposed algorithm in all time steps, which, for example, in step 2 was able to achieve the value of 98. e error rates for other comparable algorithms in this time step are 129, 3951, 11151, and 8199 for MSGA, DYNMOGA, ESPRA, and FacetNet, respectively. We observe that DYNMOGA has the highest error rate in time step 1. Also, ESPRA has a higher error rate than FacetNet in steps 2 and 3.

Input:
Dynamic network G � {G 1 , G 2 ,. . .,G T } Time Steps: T; Z t : the agent at the t generation of Z; sl: agents carried out self-learning operator; B t : the best agent; KB t [sl]: the best sl agents; KB t : the best agent in Z t ; Crossover probability: P a ; Mutation probability: P b ; P s : the probability of chosen for hybrid neighborhood crossover operator; N s : the maximum number of generations without improvement; Output: Partitions π 1 , π 2 ,. . ., π T t � 0; n � 0; ts � 1; While (ts < T) do If ts �� 1 then Z 0 � Initialize population with random individuals; Else Z 0 � Initialize population with part of members being of best individuals from ts − 1 generation; End if Evaluate the fitness of each individual in the population; Computational Intelligence and Neuroscience Figure 16 shows a comparison between our proposed method, DYNMAMA, and the four algorithms in obtaining the NMI value for the hidden part of the LFR data set, which still shows the superiority of the DYNMAMA method over the other four methods. NMI values ranged from 0.9988 to 1 for DYNMAMA, 0.9901 to 1 for MSGA, and 0.9520 to 0.9810 for DYNMOGA during steps 1 to 10. But we are still of the opinion that these evolutionary algorithms have always been able to keep the NMI value in the very close range of 1 and always discover higher quality communities. Still, in comparing TAS and modularity evaluation functions, this advantage with TAS is always preserved. Existence of split and merge operators in MSGA, the presence of multiobjective structure using genetic algorithm in DYNMOGA, and the existence of local search and multiagent structure in DYNMAMA have led to this process of improving dynamic communities with higher accuracy and quality. e highest NMI values obtained by ESPRA and FacetNet methods are in steps 1 and 4, respectively, with 0.9881 and 0.9789. In steps 1, 2, and 7, the ESPRA method obtained higher values than the DYNMOGA method. In Figure 16, the lower error rate is related to our proposed algorithm in all time steps, which, for example, in time step 4 was able to achieve the value of 199. e error rates for other comparable algorithms in this time step are 232, 3251, 5741, and 13700 for MSGA, DYNMOGA, ESPRA, and FacetNet, respectively. We see that the highest error rate in time step 1 is related to DYNMOGA and FacetNet algorithms with values of 9451 and 16300.
We mentioned earlier that in our proposed algorithm, DYNMAMA and the MSGA algorithm we used for comparison both use the temporal asymptotical surprise (TAS) evaluation function in their optimization. In the following, we show the experimental results on four parts of the LFR data set, which shows the value obtained by the TAS function by both methods and states which way was able to get the higher TAS value. Figure 17 shows the performance of these algorithms in the birth and death network for the TAS value. As shown in Figure 17, for the LFR network of the birth and death section, the TAS value obtained in our proposed algorithm, DYNMAMA, has increased compared to the MSGA. In time step 1, the value of TAS is equal for both algorithms, but from time step 2 onward, we encounter an increase in the amount of TAS obtained by DYNMAMA. For example, in time step 3, the TAS value of the DYN-MAMA method is equal to 2.7845e + 03, and for the MSGA  Computational Intelligence and Neuroscience method, it is equal to 2.6436e + 03. In time stages of 7 to 10, the value of TAS for both ways is close to each other. e evolutionary structure in both methods has improved the value of TAS. However, this advantage is still with the DYNMAMA algorithm until the time step of 10. Figure 18 shows the performance changes of these algorithms in the expansion and contraction network of the LFR data set. In this section, the closeness of the answers can still be seen, but the superiority in obtaining a higher TAS for the DYN-MAMA method has been maintained from time two onward. As we can see in Figure 19, for the LFR network of the merge and split section, the NMI value obtained in our first proposed method, DYNMAMA, has increased compared to the comparison method. In this section, too, DYNMAMA has maintained its superiority in achieving higher TAS values. For example, in step 2, a value of 2.4971e + 03 is obtained for our proposed algorithm. A value of 2.2919e + 03 is accepted for the MSGA algorithm. Figure 20 shows the performance comparison between these algorithms in the hidden network.
As we can see, for the LFR network of the hide section, the TAS value obtained in our proposed method, DYN-MAMA, has increased compared to the MSGA method in time steps 10. For example, in step 3, a value of 2.7960e + 03 is obtained for our proposed algorithm. A value of 2.6510e + 03 is obtained for the MSGA algorithm. In step 6, we received a value of 3.3562e + 03 for our proposed algorithm. We got a value of 3.2778e + 03 for the MSGA algorithm. According to the results obtained in the LFR data set, we can say that our proposed algorithm, DYNMAMA, has been able to perform better in dynamic community detection than MSGA and increase the values of the TAS parameter and NMI value, which indicates the effectiveness of the proposed algorithm.
As we can see in the figures above, DYNMAMA performs better than other algorithms on all networks. Under the same number of evaluations, DYNMAMA can quickly converge to optimum mode with good stability. DYN-MAMA can achieve the best-known results better than MSGA and DYNMOGA. DYNMAMA can converge optimally with a small number of evaluations. Having a local search improves the algorithm. e poor scores of genetic algorithms do not converge in a limited number of iterations at each time step. At the same time, the presence of integration and division operators leads to convergence.

Convergence of the Algorithm.
We compare the proposed algorithm convergence with other algorithms in this subsection. e convergence graph shows the mean error performance of the best solution over the total runs. e output results are shown in Figure 21. As shown, the proposed algorithm in each repetition achieves better results.    Computational Intelligence and Neuroscience 6.5. Statistical Analysis. We compare the results of the proposed DYNMAMA algorithm using ANOVA (ANalysis of VAriance) with other algorithms to ensure the statistical results. ANOVA is a statistical test to determine the difference between the meanings of two or more independent statistical populations. In other words, the analysis technique of variance is used to compare two or more groups to investigate whether they are significantly different. ANOVA compares the variance of the between groups with the variance of the within groups. If their variance is not significantly high, the average group may be equal. Tables 5 and  6 present the ANOVA test results for our proposed algorithm compared to other algorithms, including MSGA, DYNMOGA, and ESPRA. Analysis of variance can be used as a method to test the hypothesis of comparing the mean between several independent communities. One of the indicators that can be used to express the characteristics of communities can be the mean. By comparing the mean and detecting their equality or inequality among communities, one can vote for them to be the same or different. erefore, if one of the means is different from the others, we find that communities are not the same. e test hypotheses for comparing the mean k of a community are shown in the following equation: H1: There are some μ′s not equal with others.
Here, the opposite hypothesis, or H 1 , states that at least one of the means is different from the others, and that the null hypothesis is true, indicating that the means are equal to each other. We see that the p− value or sig is less than 0.05. In addition, Figure 22 shows the stability of the compared algorithms in achieving coverage. All algorithms run 20  times independently, and our proposed algorithm has excellent performance in creating full coverage.

Discussion and Future Work
is paper describes an optimization method based on memetic algorithms and multiagent systems in complex networks to reveal a dynamic community structure. Experiments on the networks used show that our process works well to obtain optimal values. We were able to get good results in the TAS fitness function and the NMI evaluation criterion, which can be found in Tables 3 and 4, and see     20, which show that the answers to the proposed idea are better than the methods compared. In future work, we can combine other evolutionary algorithms with multiagent systems and introduce robust structures to recognize the structure of dynamic communities and increase the strength of this type of network against possible attacks. Let us examine whether combining other evolutionary algorithms with multisystems can create a robust, consistent, and efficient structure for large-scale dynamic networks. e multiagent memetic optimization algorithm proposed in this paper can also solve other optimization problems to improve results and increase efficiency. e output of this community structure detection algorithm can be used in the following cases: recommender systems (people in a community usually have the same interests and tastes, and we can use this to make suggestions in recommender systems), graph visualization tools (communities are usually detected in very large diagrams, and each community is represented by a node that represents all members of that community), link prediction (given that members of a community have many structural similarities, they are more likely to make connections between members of a community in the future), and improved search engines (community detection can also be used in thematic clustering of websites, and this helps to improve the performance of search engines significantly). e above are just a limited number of practical purposes for detecting community structure by our proposed algorithm. In the future, we will generalize our proposed method to weighted and directed networks that exist in large numbers in real life.

Conclusions
One of the most critical issues recently raised in the structure of complex networks is the discovery of communities that change over time, i.e., dynamic communities. Changes in internal links are recorded over time, and it is possible to change the network structure to trace at different time stages. is paper proposes a multiagent optimization memetic algorithm in complex networks to detect dynamic communities in unweighted and undirected complex networks and calls it DYNMAMA (dynamic multiagent memetic algorithm). We can combine multiagent systems and evolutionary algorithms to create new algorithms to solve optimization problems that lead to convergence to optimal global solutions. is convergence occurs at high speed. We, in this paper, use temporal asymptotic surprise (TAS) as an algorithm evaluation function. e temporal asymptotic surprise criterion has a higher resolution than the modularity criterion, breaking the resolution limit. We can obtain a more precise and clear network community structure by maximizing it. TAS can accurately measure the quality of partitions on the dynamic network at a low cost. We also used the NMI to evaluate the quality and accuracy of the dynamic communities received. e goal is to find the optimal community structure. e results of experiments on the real-world Enron email networks and LFR networks show that our proposed algorithm has been able to achieve more efficiency and better answers than the four well-known algorithms for detecting dynamic communities in complex networks. DYNMAMA can handle networks with different densities of edges beside communities by turning the parameter μ in LFR networks. Moreover, DYNMAMA has good stability according to the standard deviations and can handle large-scale networks with 1000 nodes. Our proposed algorithm in all time steps was able to obtain the lowest error rate compared to other algorithms, which shows that our proposed algorithm can detect communities with higher accuracy and quality.  [3,4].