# A New BAT and PageRank Algorithm for Propagation Probability in Social Networks
## 4 Simulation Experiment
### Model Introduction  
NetworkX is a Python package that can randomly generate different types of networks and can also be used to analyze network structures, build network models or draw networks. Using NetworkX to generate Barabasi-Albert models with different numbers of nodes can ensure that the network model conforms to the power distribution and preferential connection mode [97], as shown in Figures 7 and 8.  
A Barabasi-Albert model with 8 nodes and 12 edges is randomly generated by NetworkX in Python as shown in Figure 7. Its degree distribution conforms to the power distribution as shown in Figure 8.  
Figure 7 shows the network graph used to simulate the scale-free network in this study, which contains 8 nodes and 12 edges where \(i=0\), \(1\),..., \(7\) and \(i\in V\). In the experiment, we assume that the source node of propagation starts from \(i=0\), \(1\),..., \(7\), respectively,  
Figure 8: Degree distribution of network in Figure 7.  
Figure 7: Network of Barabási–Albert model with 8 nodes and 12 edges.  
and consider all the propagation probabilities to be \(N_{page}=1\), \(2\),..., \(8\). Therefore, this experiment contains a total of 64 experimental results.  
Due to the influence of user preference on the propagation probability [29; 30; 31], the assigned weight of each node in the random walk varies according to user preference on the web page, as shown in Section 2.3.2. For example, an advertiser plans to advertise a food. One of the nodes in the network of Figure 7 is a food-related website. At this time, the personalization vector of this node is \(r_{u}=1\), and the personalization vectors of the other nodes are \(r_{u}=0\). Thus, the model performs an experiment of assigning weights to three different nodes as follows.  
* All nodes are assigned the same weight; that is, the traditional PageRank is used to calculate the page probability, and the propagation probability is \(Pr(s,N_{page})=R_{1}\).
* Set node 3, for which the total number of original adjacent nodes is the highest, as the preference node and use Personalized PageRank to calculate the probability of the page; that is, \(r_{3}=1\), \(r_{0}=r_{1}=r_{2}=r_{4}=r_{5}=r_{6}=r_{7}=0\). At this time, the propagation probability \(Pr(s,N_{page})\) equals \(R_{2}\).
* Set node 1, for which the original PageRank value is the lowest, as the preference node and use the personalized PageRank to calculate the probability of the page; that is, \(r_{1}=1\), \(r_{0}=r_{2}=r_{3}=r_{4}=r_{5}=r_{6}=r_{7}=0\). At this time, the propagation probability \(Pr(s,N_{page})\) equals \(R_{3}\).  
In addition to analyzing and predicting the propagation probability of a social network, this section also changes theme of the node in disguise through the personalized vector. If the node is more in line with the user's preference, the allocation weight of the node is increased to interfere with the PageRank value. Table 13 presents the total number of adjacent nodes for node \(i\), the set of adjacent nodes, the total number of state combinations, the PageRank value, the PageRank value of maximum propagation state, the Personalized PageRank value and the Personalized PageRank value of the maximum propagation state, which are denoted as \(Deg(i)\), \(V(i)\), \(C(i)\), \(PR(i)\), \(PR_{max}(i)\), \(PPR(i)\) and \(PPR_{max}(i)\), respectively.