4.1. Calculation of propagation power in a large network
To calculate the propagation power, we present the algorithm according to the definition of propagation power to be applied in a large-scale network as follows.
The number of hops required for a virus to spread from an original node to all nodes of the network can be considered as the maximum value of the shortest path length which is the shortest length one needs to travel from the original node to another. Thus, the problem comes down to a task of obtaining the shortest path.
The main idea of calculating the propagation power is that a shortest path tree for each node in the network is worked out by the Dijkstra algorithm first, and then the height of the tree which represents the number of hops is obtained by calculating F. The algorithm is described as follows:
-
(1)
Input graph G and set propagation power F = 0;
-
(2)
Calculate the shortest path tree SPT
i
(1 ≤ i ≤ n) by Dijkstra (G, v), the root of which is v;
-
(3)
Get the height of tree SPT
i
, disp
i
= TreeHeight (v);
-
(4)
Return F,
As the time complexity of the optimized Dijkstra algorithm is O(|E| log |V|) [31], since every vertex must be computed, the complexity of the algorithm above is O(|V| × |E| log |V|). Figure 5 shows the algorithm.
As shown in Figure 6, we present an example to show how the algorithm works:
-
1.
Calculate the propagation power of Figure 6a:
-
2.
Calculate the propagation power of Figure 6b:
In Figure 6, although the vertex numbers are the same, the propagation powers are different, which suggests that the virus risk is different.
4.2. Relation between propagation power and infection time
In this section, we present some theorems about the propagation power F and the infection time n/v.
First, we show the mathematical expressions of the propagation power of SPS and the propagation speed of SPS.
Relationships between the propagation power F of LPS and number of nodes n in the network and relationships between the speed v of LPS and number of nodes n in the network can be expressed as follows:
(1)
where
(2)
Relationships between propagation power F of RPS and number of nodes n in the network and relation between speed v of RPS and number of nodes n in the network can be expressed as follows:
(3)
(4)
Relationship between propagation power F of SPS and number of nodes n in the network and relationship between speed v of SPS and number of nodes n in the network can be expressed as follows:
(5)
(6)
According to the above formulae, it may be concluded that v is the average speed of the nodes infecting the whole network, and propagation power expresses the risk of virus propagation in the network. Assuming the two variables are related, three theorems are presented as follows:
Theorem 1 When n approaches infinity in LPS, F− 1 = α(1/v), where 3/4 ≤ α ≤ 3/2; In RPS, F−1 = α(1/v), where α = 1; when n approaches infinity in SPS, F−1 = α(1/v), where α = 1.
Proof In LPS:
When n approaches infinity, substitute F−1 = (3/4)t0 into the above inequalities. Hence, 3/4 ≤ α ≤ 3/2.
We can prove the relationships in RPS and SPS in the same way.
Theorem 2 The ratio of the reciprocal of propagation energy of any network structure to time (n/v) has upper and lower limits. The upper limit function of the two variables is f(n, α) = α × n, and the lower limit function is f(n, α) = a/n, where α = t02.
Proof Since
and 1 ≤ disp
i
≤ n.
Therefore,
And because 1 ≤ α
i
≤ n,
From above, it can be concluded that , where f(n, α) = αn , where f(n, α) = a/n.
Theorem 3 The speeds of virus propagation in three SBSs are different when the numbers of nodes are the same. The speed in LPS v
line
, the speed in RPS v
ring
, and the speed in SPS v
star
satisfy the inequality v
line
< v
ring
< v
star
.
Proof Since
According to the Equation 3, vline < vring
According to Equations 3 and 5, vring < vstar.
Therefore, vline < vring < vstar.
From formulae 1, 3, and 5, the following conclusions can be made:
-
1.
The speed of virus propagation in LPS decreases when the number of nodes increases.
-
2.
The speed of virus propagation in RPS fluctuates around 2 t
0
.
-
3.
The speed of virus propagation in SPS increases when the number of nodes increases. The relationship between the speed and the number of nodes is linear.
Through the above analysis, we can see that the structure of the network is the main factor in virus propagation and the most dangerous structure is the SPS. When a network has more SPS, the risk of propagation is higher.
According to Equations 1, 3, and 5, the speed of virus propagation is not only related to the scale of the network, but it also largely depends on the structure of the network. The star structure has played the most significant role in increasing the speed of virus propagation. In any given network, the more star structures there are and the bigger the propagation power F is, the faster the virus propagation would be. The influence of the star structure also increases with the increase of the number of nodes. The influence of the ring structure is smaller and that of the linear structure is the smallest. Overall, the propagation is slower in a network with more linear structures and ring structures than that in one with more star structures.