Mathematical Problems in Engineering

Volume 2018, Article ID 2048525, 9 pages

https://doi.org/10.1155/2018/2048525

## A Weighted Multi-Local-World Network Evolving Model and Its Application in Software Network Modeling

^{1}School of Computer Science, Wuhan University, Wuhan 430072, China^{2}Complex Networks Research Center, Wuhan University, Wuhan 430072, China^{3}School of Automation, Huazhong University of Science and Technology, Wuhan 430074, China^{4}School of Mathematics and Statistics, Wuhan University, Wuhan 430072, China

Correspondence should be addressed to Bing Li; nc.ude.uhw@ilgnib

Received 21 February 2018; Accepted 16 April 2018; Published 16 May 2018

Academic Editor: Michele Bacciocchi

Copyright © 2018 Zengyang Li et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

The phenomenon of local worlds (also known as communities) exists in numerous real-life networks, for example, computer networks and social networks. We proposed the Weighted Multi-Local-World (WMLW) network evolving model, taking into account the dense links between nodes in a local world, the sparse links between nodes from different local worlds, and the different importance between intra-local-world links and inter-local-world links. On topology evolving, new links between existing local worlds and new local worlds are added to the network, while new nodes and links are added to existing local worlds. On weighting mechanism, weight of links in a local world and weight of links between different local worlds are endowed different meanings. It is theoretically proven that the strength distribution of the generated network by the WMLW model yields to a power-law distribution. Simulations show the correctness of the theoretical results. Meanwhile, the degree distribution also follows a power-law distribution. Analysis and simulation results show that the proposed WMLW model can be used to model the evolution of class diagrams of software systems.

#### 1. Introduction

Networked structures appear in a wide range of complex systems, such as the Internet, traffic systems, and scientific collaboration relationships. Since the small-world and scale-free network models were proposed [1, 2], researchers have made tremendous progress in network modeling [3–5].

In 2003, Li and Chen proposed a local-world evolving network model, which represents a transition between power-law and exponential scaling [6]. The concept of local-world structure exists in various real-life complex networks and has been taken by many studies [7, 8], allowing better describing and understanding more real-life complex networks. Based on the aforementioned local-world evolving network model, Pan et al. proposed two generalized local-world models for unweighted and weighted complex networks, respectively [8]. Li et al. proposed a weighted local-world evolving network model based on the edge weights preferential selection mechanism [9]. However, in the aforementioned models, the nodes composing a local world were selected randomly from the network and the number of nodes in a local world is fixed, which did not comply well with the real-life complex networks.

In 2005, Chen et al. proposed a Multi-Local-World (MLW) model [10] which aims at modeling the Internet and emphasizes the property of the Multi-Local-World of the structure of the Internet. A comparison clearly demonstrated that the MLW model was the best model for describing the Internet topology in the sense that the basic network properties (e.g., mean degree and clustering coefficient) of the MLW model are closer to those of the real Internet topology than other models, such as the BA model. In the MLW model, local worlds are relatively stable in the sense that each local world is not comprised of randomly selected nodes from the network when new nodes are added to a local world of the network.

The aforementioned network models did not take into account the difference between a link within a local world and a link across two local worlds. In real-life cases, an inter-local-world link tends to play a more important role than an intra-local-world link. For instance, in a computer network, a link between two nodes from two subnetworks is responsible for the communication between the two subnetworks. In addition, nodes differ on their capacity, which can be represented by their strengths.

Inspired by the MLW model, we try to extend the MLW model and propose a Weighted Multi-Local-World (WMLW) model in which a weight mechanism is introduced. To our knowledge, there has been no study about MLW taking into account the edge weight and node strength. In fact, the real-life complex systems would be better reflected if the edge weight and node strength were taken into consideration. The proposed WMLW model does not aim at modeling the Internet, but it should be feasible to model more real-life complex networks, for example, software systems.

There have been some studies on diverse aspects of software systems from a perspective of complex networks. Qu et al. explored community structure of software call graph and its applications in class cohesion measurement [11]. Concas et al. investigated software quality and community structure in Java software networks [12]. A complex network approach was used to study software dependency network evolution [13, 14]. Chong and Lee used weighted complex network with graph theory analysis to automate the derivation of clustering constraints from object-oriented software [15]. Joblin et al. investigated the evolutionary trends of developer coordination using a network approach [16]. Ding et al. identified key classes in weighted software networks [17]. In this paper, we apply the MLWM to modeling the evolution of object-oriented software networks, in which a node is a class and an edge between two nodes is a dependency link between two classes.

The remaining of this paper is organized as follows. We propose the WMLW model in Section 2. In Section 3, we analytically study the strength distribution of WMLW model. We report numerical simulations in Section 4 and the application of WMLW model to software systems in Section 5. Finally, we conclude our work with future work in Section 6.

#### 2. Weighted Multi-Local-World Model

We first introduce several key concepts on the WMLW model and then propose two preferential attachment rules to construct the WMLW model and finally describe the WMLW model in detail.

##### 2.1. Key Concepts on the WMLW Model

A weighted network is characterized by an adjacency matrix , whose element denotes the weight of the edge between nodes and , where , and is the total number of nodes of the network.

Here, we restrict our interest to undirected networks in which weights of edges are symmetric () and assume that . In our model, when adding new edge connected nodes and that belong to the same local world, we have ; otherwise, when adding a new edge between nodes and from different local worlds, we have .

Naturally, as the generalization of degree of node , we define the strength of node as , where denotes the set of neighbors of node . The strength of a node integrates the information about its connectivity and the weights of its links [18, 19]. The strength of the node reflects its power and importance. A larger strength of a node indicates that it is more important.

##### 2.2. Preferential Attachment Rules

###### 2.2.1. Probability about Selecting a Local World following the Scale Preferential Rule

The scale of local world is denoted by ; the total number of local worlds is denoted by . is a constant that represents the “attractiveness” of local world , and it is used to govern the probability for those “young” local worlds to get new links [10]. In the WMLW model, the probability with which local world is selected is described by

If the constant , we haveFor the sake of simplicity, we consider (i.e., (2)) in the rest of this paper.

In (2), denotes the sum of the scales of local worlds in the network, that is, the total number of the nodes in the network.

In fact, it is more reasonable to select a local world following the scale preferential rule than to select a local world randomly. In many real cases, the scales of different local world are not equal, for example, software systems, Economic Trade Web, and Internet. The larger the sale of a local world is, the more attractive it is; that is, it also obeys the rule of “the rich get richer.”

###### 2.2.2. Probability of Selecting a Node within a Local World following the Strength Preferential Rule

The probability that node in local world is chosen is

##### 2.3. Algorithm of the WMLW Model

*Step 1 (initial condition). *Start with an initial network containing local worlds, in which it is supposed that there are nodes and links in each local world, and every edge is assigned a weight .

*Step 2. *At each step, perform one of the following four operations on probability:

(i) With probability , a new local world is created, which contains nodes and links.

(ii) With probability , a new node is added to an existing local world, which has links connecting to the nodes within the same local world. The local world is selected with a probability given by (2), and then a node in the local world is chosen with a probability given by (3). Every new added edge is assigned a weight . This process is repeated times.

(iii) With probability , new links are added to a chosen local world. A local world is selected with a probability given by (2), and then one end of a link is selected with a probability given by (3), while the other end of the link is chosen randomly. Every new added edge is assigned a weight . This process is repeated times.

(iv) With probability , a local world is selected and it has new links to the other existing local worlds. A local world () is selected with a probability given by (2). Then, each link is added according to the following process: a node is selected from with a probability given by (3), and this node acts as one end of a link; the other end of the link is a node selected with a probability given by (3) from another local world () chosen at random; and every new added edge is assigned a weight . This process is repeated times.

*Step 3. *Repeat Step 2 until the total number of the nodes reaches the number given in advance.

In this model, neither a node is allowed linking with itself nor two nodes are allowed linking repeatedly. In addition, the parameters (probabilities) have to satisfy and .

#### 3. Strength Distribution of the WMLW Model

Using the mean-field theory [21, 22], one can obtain the strength distribution of node in local world , which can be divided analytically as follows.

(i) With probability , create a new local world. In this case, the strength of node in an existing local world does not change over time, since the original nodes in the newly created local world have no links with any other nodes in existing local worlds. Thus,

(ii) With probability , a new node is added to an existing local world , and this node has links connected to the nodes within the same local world. Every newly added edge is assigned a weight : is the probability that local world is selected according to preferential choosing with the probability given by (2). is the probability that a node is selected according to strength preferential attachment with the probability given by (3). represents the total strength of all nodes in local world . There are links between the newly added node and existing nodes in local world , and the weight of each newly added edge is , and thus the coefficient is equal to .

(iii) With probability , links are added to a chosen local world . Each newly added edge is assigned a weight . We haveOn the right-hand side of (6), local world is selected according to the probability given by (2), represents the preferential selection within local world , and means the random selection of node within the same local world .

(iv) With probability , a selected local world () has links connected to other existing local worlds. Each newly added edge is assigned a weight . Hence,

In the first term on the right-hand side of (7), is the probability given by (3) with which we select local world . In the second term on the right-hand side of (7), another local world is chosen at random (i.e., with the probability of ), and represents the total strength of all nodes in the randomly chosen local world. The two ends of a link are all selected by (3) in their own local worlds.

Combining (4)–(7) together, we have

In the following text, denotes the average strength of the nodes in local world , and represents the average strength of all nodes in the network. Hence, we have . Since denotes the sum of the strength of all nodes in a local world, which is selected randomly, in the average sense, we have

Thus, (8) becomesFor large , we have ; therefore,

In the following text, we deduce the strength distribution of the network when the probability (i.e., in the case when the number of the local worlds is unchanged). In the case when the probability , we only give a simulation result for simplicity in Section 4.

When the probability , the number of the local worlds is the initial . All local worlds perform the same steps (ii), (iii), and (iv), though with different probabilities. Different probabilities just bring on different scales of the local worlds.

We can see from works [6–8] that the average degree of the network is free from the scale of the network. In our model, we can also consider that the average strength of every local world is equal for large ; that is,Also, is equal to . Both of them are free from .

Considering (12), when the probability , (11) becomes Define and .

Therefore,By integrating, we have , where is any constant.

Using the initial condition , one obtainsThus,

In the process of the growth of the network, we add nodes every time interval. Then, the probability density of isSo Therefore, For large , the strength distribution approximately is where and , as defined before.

#### 4. Numerical Simulations

We design several numerical simulations to verify our theoretical analysis results. We consider two cases, that is, a given number of local worlds () and an increasing number of local worlds ().

##### 4.1. A Given Number of Local Worlds

To testify the theoretical result of strength distribution of the WMLW model, we conducted a numerical simulation in which a network was generated by our WMLW model and the simulation and theoretical results were compared. Figure 1 shows the simulation result. In this simulation, the size of the generated network was set to one million. The details of parameter settings of the WMLW model for the simulation are described in Figure 1. In Figure 1(a), the simulation and theoretical results are shown to facilitate the comparison between them. The theoretical data are calculated by (20), and the simulation data were calculated based on the generated network. The comparison shows that the simulation data and the theoretical data fit well, which implies the correctness of the theoretic result of the strength distribution of the WMLW model. In addition, Figure 1(b) shows that the degree distribution of the WMLW model also follows a power-law distribution. Hence, the WMLW network is scale-free network.