Multifractal analysis of weighted networks by a modified sandbox algorithm

Complex networks have attracted growing attention in many fields. As a generalization of fractal analysis, multifractal analysis (MFA) is a useful way to systematically describe the spatial heterogeneity of both theoretical and experimental fractal patterns. Some algorithms for MFA of unweighted complex networks have been proposed in the past a few years, including the sandbox (SB) algorithm recently employed by our group. In this paper, a modified SB algorithm (we call it SBw algorithm) is proposed for MFA of weighted networks. First, we use the SBw algorithm to study the multifractal property of two families of weighted fractal networks (WFNs): “Sierpinski” WFNs and “Cantor dust” WFNs. We also discuss how the fractal dimension and generalized fractal dimensions change with the edge-weights of the WFN. From the comparison between the theoretical and numerical fractal dimensions of these networks, we can find that the proposed SBw algorithm is efficient and feasible for MFA of weighted networks. Then, we apply the SBw algorithm to study multifractal properties of some real weighted networks — collaboration networks. It is found that the multifractality exists in these weighted networks, and is affected by their edge-weights.

Scientific RepoRts | 5:17628 | DOI: 10.1038/srep17628 out that a single fractal dimension is not enough to characterize the fractal property of a scale-free network when the network has a multifractal structure. They also introduced a compact-box-burning (CBB) algorithm for MFA of complex networks. Wang et al. 42 proposed an improved fixed-size box-counting algorithm to study the multifractal behavior of complex networks. Then this algorithm was improved further by Li et al. 43 . They applied the improved fixed-size box-counting algorithm to study multifractal properties of a family of fractal networks proposed by Gallos et al. 47 . Recently, Liu et al. 45 employed the sandbox (SB) algorithm proposed by Tél et al. 48 for MFA of complex networks. The comparison between theoretical and numerical results of some networks showed that the SB algorithm is the most effective and feasible algorithm to study the multifractal behavior of unweighted networks 45 .
However, all the algorithms for MFA in refs 41-45 are just feasible for unweighted networks. Actually, there are many weighted networks in real world [49][50][51] , but few works have been done to study the fractal and multifractal properties of the weighted networks. Recently, an improved box-covering algorithm for weighted networks was proposed by Wei et al. 52 . They applied the box-covering algorithm for weighted networks (BCANw) to calculate the fractal dimension of the "Sierpinski" weighted fractal network (WFN) 53 and some real weighted networks. But the BCANw algorithm was only designed for calculating the fractal dimension of weighted networks.
In this work, motivated by the idea of BCANw, we propose a modified sandbox algorithm (we call it SBw algorithm) for MFA of weighted networks. First, we use the SBw algorithm to study the multifractal property of two families of weighted fractal networks (WFNs): "Sierpinski" WFNs and "Cantor dust" WFNs introduced by Carletti et al. 53 . We also discuss how the fractal dimension and generalized fractal dimensions change with the edge-weights of the WFN. Through the comparison between the theoretical and numerical fractal dimensions of these networks, we check whether the proposed SBw algorithm is efficient and feasible for MFA of weighted networks. Then, we apply the SBw algorithm to study multifractal properties of some real weighted networks -collaboration networks 54 .

Results and Discussion
Multifractal properties of two families of weighted fractal networks. In order to show that the SBw algorithm for MFA of weighted network is effective and feasible, we apply our method to study the multifractal behavior of the "Sierpinski" WFNs and the "Cantor dust" WFNs 53 . These WFNs are constructed by Iterated Function Systems (IFS) 55 , whose Hausdorff dimension is completely characterized by two main parameters: the number of copies s > 1 and the scaling factor 0 < f < 1 of the IFS. In this case, the fractal dimension of the fractal weighted network is called the similarity dimension and given by 53 : To construct "Sierpinski" WFNs and "Cantor dust" WFNs 53 , a single node and a triangle is set as a initial network G 0 respectively. The first a few steps to construct them are shown in parts a) and b) of Fig. 1 respectively. We first consider two "Sierpinski" WFNs with parameters s = 3, f = 1/2 and s = 3, f = 1/3 respectively. Considering the limitation of the computing capability of our computer, we construct the 8th generation G 8 of these two networks. There are 9841 nodes and 9837 edges in the G 8 of these two networks. For the case s = 3, f = 1/2, the edge-weights of G 8 are equal to 1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, respectively; the diameter of G 8 is less than 4. When we use the SBw algorithm for MFA of G 8 , radiuses r of sandboxes are set to 1/128, 1/128 + 1/64, ···, 1 + 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 1/64 + 1/128, respectively for this case. We can do similar analysis for G 8 of network with s = 3, f = 1/3. It is an important step to look for an appropriate range of r (i.e., r ∈ [r min , r max ]) for obtaining the generalized fractal dimensions D(q) (defined by equations (6) and (7)) and the mass exponents τ(q) (defined by equation (5)). In this paper, we set the range of q values from − 10 to 10 with a step of 1.
When q = 0, D(0) is the fractal dimension of a complex network. Now we adopt the SBw algorithm to estimate the fractal dimension of two "Sierpinski" WFNs with parameters s = 3, f = 1/2 and s = 3, f = 1/3 respectively. We show the linear regression of ln(〈 [M(r)] q−1 〉 ) against (q − 1)ln(r/d) for q = 0 in Fig. 2. By means of the least square fit, the slope of the reference lines are estimated to be 1.5419 and 1.0169, with standard deviations 0.0309 and 0.0148, respectively. It means that the numerical fractal dimension is 1.5419 ± 0.0309 and 1.0169 ± 0.0148, respectively; they are very close to the theoretical similarity dimension 1.5850 and 1.0 respectively. Hence we can say that the numerical fractal dimension obtained by the SBw algorithm is very close to the theoretical similarity dimension for a "Sierpinski" WFN.
To further check the validity of the SBw algorithm, let the copy factor s be 3 and the scaling factor f be any positive real number in the range 0 < f < 1. From Equation (1), we can get the relationship between the fractal dimension and the scaling factor f of the "Sierpinski" WFN as: The "Sierpinski" weighted fractal networks, s = 3, f = 1/2 and G 0 is composed by a single node. From the left to the right, the 1th generation G 1 , the 2th generation G 2 , and the 3th generation G 3 are shown. The fractal dimension of the limit network is log(3)/log(2) ≈ 1.5850. (b) The "Cantor dust" weighted fractal networks, s = 4, f = 1/5 and G 0 is a triangle. From the left to the right, the 0th generation G 0 , the 1th generation G 1 , and the 2th generation G 2 are shown. The fractal dimension of the limit network is log(4)/ log(5) ≈ 0.8614. The slope is 1.5419 ± 0.0309 The slope is 1.0169 ± 0.0148 Numerical result for f=1/2 Linear fit for f=1/2 Numerical result for f=1/3 Linear fit for f=1/3

Figure 2. Examples of fractal analysis of the "Sierpinski" weighted fractal networks G 8 with 9841 nodes.
Here, copy factor s = 3 and the scaling factor f = 1/2, 1/3, respectively. By means of the least square fit, the slope of the reference lines are 1.5419 ± 0.0309 and 1.0169 ± 0.0148 respectively. The theoretical result is 1.5850 (for f = 1/2) and 1.0 (for f = 1/3), respectively.
shown in part a) of Fig. 3, where each error bar takes twice length to the standard deviation. This figure shows that the numerical fractal dimensions obtained by the SBw algorithm agree well with the theoretical fractal dimensions of these networks. This figure also shows that the fractal dimension of WFNs is affected by the edge-weight. This result coincides with the conclusion obtained by Wei et al. 52 .
Hence we can apply the SBw algorithm to calculate the generalized fractal dimensions D(q) and their standard deviations of "Sierpinski" WFNs. In parts b) and c) of Fig. 3, we show the generalized fractal dimensions D(q) of the 8th generation G 8 of "Sierpinski" WFNs, with the parameter s = 3, f = 1/2, 1/3, 1/4, 1/5 and 1/6, 1/7, 1/8, 1/9 respectively. From these figures, we can see that all the 8th generation G 8 of "Sierpinski" WFNs for different f have multifractal property, and the multifractal property of these weighted networks is affected by their edge-weights. The result also shows that the generalized fractal dimension D(q) almost decreases with the decrease of the scaling factor f for any q.
For "Cantor dust" WFNs, we can only construct the 5th generation networks with s = 4 and f = 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, respectively. We first calculate fractal dimensions and their standard deviations of these WFNs by the SBw algorithm. The results are shown in part a) of Fig. 4. From this figure, we can see that the numerical fractal dimensions obtained by the SBw algorithm are very close to the theoretical fractal dimensions d fract = − log(4)/log(f) for these WFNs. Then we apply the SBw algorithm to calculate the generalized fractal dimensions D(q) and their standard deviations of these "Cantor dust" WFNs. We show the numerical results of the 5th generation G 5 of "Cantor dust" WFNs in parts b) and c) of Fig. 4. From these figures, we can see that all D(q) curves are nonlinear. It indicates that all these weighted networks have multifractal property. Similar to "Sierpinski" WFNs, the multifractal property of these networks is affected by their edge-weights.
The multifractal property of "Sierpinski" WFNs and "Cantor dust" WFNs revealed by the SBw algorithm indicates that these model networks are very complicated, and cannot be characterized by a single fractal dimension.
Applications: multifractal properties of three collaboration networks. Now we apply the SBw algorithm to study multifractal properties of some real networks. We study three collaboration networks: the high-energy theory collaboration network 54 , the astrophysics collaboration network 54 , and the computational geometry collaboration network 56 .
High-energy theory collaboration network. This network has 8361 nodes and 15751 edges, the edge-weights are defined as 54 : where n k is the number of co-author in the kth paper (excluding single authored papers), δ i k equals to 1 if the ith scientist is one of the co-author of the kth paper, otherwise it equals to 0. The data contains all components of the network, for a total of 8361 scientists, not just the largest component of 5835 scientists. When two authors share many papers, the weight value is larger, thus the distance is less. So, in Equation (9), p had better be a negative number (e.g. − 1 given by Newman 54 ). For different values of p, we can calculate the shortest path by Equation (9)    Astrophysics collaboration network. This network has 16706 nodes and 121251 edges, the edge-wights is defined as Equation (3). Here, the data contains all components of the network, for a total of 16706 scientists, not just the largest component of 14845 scientists. When two authors share many papers, the weight value is larger, thus the distance is less. So, in Equation (9), p had also better be a negative number (e.g. − 1 given by Newman 54 ). We calculate the shortest path by Equation (9) and obtain some weighted networks with different values of p. Then we apply the SBw algorithm to calculate the generalized fractal dimensions D(q) and their standard deviations of the largest component of the network with 14845 nodes. We show the numerical results of the astrophysics collaboration networks in parts a) and b) of Fig. 6. From this figure, we can see that these networks also have multifractal property, and the multifractal property of these weighted networks is affected by the edge-weight.
Computational geometry collaboration network. The authors collaboration network in computational geometry was produced from the BibTeX bibliography which obtained from the Computational Geometry Database. This network has 7343 nodes and 11898 edges. Two authors are linked with an edge, if and only if they wrote a common paper or book, etc. The value of edge-weight is the number of common works, so the value is one integer, such as 1, 2, 3, ···, etc. The data contains all components of the network, for a total of 7343 scientists, not just the largest component of 3621 scientists. The data can be got from Pajek Data 56 . When two authors share many papers, the weight value is larger, thus the distance is less. So, in Equation (9), p had better be a negative number. We calculate the shortest path by Equation (9) and obtain some weighted networks with different values of p. Then we apply the SBw algorithm to calculate the generalized fractal dimensions D(q) and their standard deviations of the largest component of the network with 3621 nodes. Because the way to define the weight of this network is different from another two real networks, we can only calculate the generalized fractal dimensions D(q) and their standard deviations of the largest component of the network with 3621 nodes for p ≥ − 1. We show the numerical results of the computational geometry collaboration networks in part c) of Fig. 6. From this figure, we can also see that these networks have multifractal property, and the multifractal property of these weighted networks is affected by the edge-weight (but the impact is relatively small).

Conclusions
In this paper, a modified sandbox algorithm (we call it SBw algorithm) for MFA of weighted networks is proposed. First, we used the SBw algorithm to study the multifractal property of two families of weighted fractal networks (WFNs): "Sierpinski" WFNs and "Cantor dust" WFNs. We also discussed how the fractal dimension and generalized fractal dimensions change with the edge-weights of the WFN. From the comparison between the theoretical and numerical fractal dimensions of these networks, we can find that the proposed SBw algorithm is efficient and feasible for MFA of weighted networks. In addition, we applied the SBw algorithm to study the multifractal properties of some real networks -the high-energy theory collaboration network, the astrophysics collaboration network, and the computational geometry collaboration network. We found that multifractality exists in these weighted networks, and is also affected by their edge-weight. Our result indicates that multifractal property of weighted networks are affected both by their edge weight and their topology structure.

Methods
Multifractal analysis. The fixed-size box-counting algorithm is one of the most common and effective algorithms to explore multifractal properties of fractal sets 19 . For a support set E in a metric space Ω and a normalized measure μ (i.e. 0 ≤ μ(Ω ) ≤ 1), we consider the partition sum: where q ∈ R, and the sum runs over all different non-overlapping boxes B which cover the support set E with a given size ε. The mass exponents τ(q) of the measure μ is defined as: The generalized fractal dimension D(q) of the measure μ is defined as: . A numerical estimation of the generalized fractal dimension D(q) can be got from the linear regression of lnZ ε (q)/q − 1 against lnε for q ≠ 1, Z 1,ε against lnε for q = 1, respectively. Tèl et al. 48 proposed the sandbox (SB) algorithm for MFA of fractal sets which is an extension of the box-counting algorithm 19  A modified sandbox algorithm for multifractal analysis of weighted networks. Recently, our group employed the SB algorithm proposed by Tél et al. 48 for MFA of unweighted complex networks 45 .
In the SB algorithm 45 , the radiuses r of the sandbox are set to be integers in the range from 1 to the diameter of the unweighted network. However, in weighted networks, the values of edge-weights could be any real numbers excluding zero and the shortest path is defined by the path between two nodes such that the sum of values of its edge-weights to be minimized in some way 57 . So, the shortest path between two nodes could be any real numbers excluding zero. In this paper, for weighted networks, we denote the length of shortest path between node i and node j by d ij , and d ij is defined as 52 : ( ) The SB algorithm is unfeasible for MFA of weighted networks because we cannot obtain enough numbers of boxes (even only one sandbox we can obtain when the diameter of the weighted network is less than one). Wei et al. 52 proposed an improved box-covering algorithm for fractal analysis of weighted network (BCANw). In the present work, motivated by the idea of BCANw, we propose a modified sandbox algorithm (we call it SBw algorithm) for MFA of weighted networks. The SBw algorithm can deal with the multifractal property (hence can also deal with the fractal property) of weighted networks.
Before we apply the SBw algorithm for MFA of weighted networks, we need to calculate the shortest-path distance matrix D of the network and set the range of radiuses r of the sandboxes. The detail is given as: • A network is mapped to an adjacent matrix W N × N , where N is the total number of nodes in the network. For any given real numbers p, the elements of the adjacent matrix ≠ w 0 ij p is the edgeweight between directly connecting nodes i and j, otherwise = w 0 ij p . According to the adjacent matrix W N × N , we can calculate the shortest path distance matrix D by applying the Floyd's algorithm 58 of Matlab BGL toolbox 59 ; • For any given real numbers p, order the edge-weights w ij p as w 1 ≤ w 2 ≤ ··· ≤ w m , where m is the number of edge-weights. From the fractal theory, we should look for an appropriate range of radiuses r to perform the least square linear fit and then obtain the generalized fractal dimensions D(q) accurately. We tried choosing the radius r from 0 to diameter d with equal (linearly or logarithmically) intervals. But we found it is hard to look for an appropriate range of radiuses r to perform the least square linear fit and then obtain the generalized fractal dimensions D(q) of weighted complex networks we considered accurately. So the radiuses r of the sandboxes are obtained by accumulating the value of the edge-weights until it is larger than the diameter d of the network. So, we can get the set of radiuses ( . Specifically, for any i, j, if w i = w j = 1, then the radius set R is the same as the SB algorithm for unweighted network. In this sense, the SBw algorithm can be applied to calculate the mass exponents τ(q) and the generalized fractal dimensions D(q) not only for unweighted network but also for weighted networks. Now we propose a modified SB algorithm (SBw) for MFA of weighted network as: • Initially, ensure that all nodes in the network are not covered and not selected as a center of a sandbox. • Set every element in the radius set R as the radius r of the sandbox which will be used to cover the nodes, where R is obtained as above. (in the SB algorithm the radius r in the range r ∈ [1, d], where d is the diameter of the network). • Rearrange the nodes of the entire network into a random order. Make sure the nodes of the network are randomly chosen as the center of a sandbox. • According to the size N of networks, choose the first 1000 nodes in a random order as the center of 1000 sandboxes, then for each sandbox, search all the neighbor nodes which have a distance to the center node within r. • Count the number of nodes in each sandbox of radius r, denote the number of nodes in each sandbox of radius r as M(r).