## 5 Simulation Experiment and Analysis  
In this section, we report the use of the MATLAB software suite to program, simulate, and validate of the MPASR trusted routing algorithm. For the simulation environment, the operating system Windows 8 and the compiler software MATLAB 7.0.1 were used; the processor was an AMD A4-3300M APU (AMD, Cicero, IL, USA) equipped with a Radeon(tm) 1.90 GHz HD graphics card (Intel, Amsterdam, NY, USA) and 4 GB of memory. To more intuitively illustrate the improvement in security performance achieved by the algorithm proposed in this paper, we compared it with implementations of routing using an Ant-Colony Optimization Router Chip (ACORC) [32], QOS-Particle Swarm Optimization (QOS-PSO) [33], and the Throughput-Aware Novel ACO-Based Routing Protocol (TANARP) [34]. These three routing algorithms were also applied in the simulations, and their results were compared with those of the algorithm proposed in this paper. The ACORC algorithm, proposed by [PERSON] and [PERSON], is a multi-path routing protocol. Upon the failure of a node, the algorithm can provide reliable communication. More importantly, the data packets to be sent do not need to retain information on the nodes that have been visited, which reduces the size of the data packets and consequently conserves node energy. This routing algorithm based on ant-colony optimization considers only the path length in the pheromone computations. The QOS-PSO algorithm treats the integrated service quality of the wireless sensor network as the adaptive value considered in the particle swarm optimization algorithm, thereby improving the overall network performance, supporting the dynamic nature of the wireless sensor network, and ensuring the quality of service of wireless sensor network applications. Because of energy limitations, it is very difficult to design a reasonable and efficient routing protocol for wireless sensor networks. The TANARP algorithm primarily uses ant-colony optimization algorithm to select the optimal path; the ant-colony algorithm considers the delay, energy and frequency of each node, along with other factors. The TANARP algorithm was developed by applying PA-SHORT to the NARP algorithm [35]. It improves the throughput performance of a wireless sensor network by allowing some node mobility. In the simulation experiments, the performances of these four types of trusted routing algorithms were compared under the same conditions. The packet loss rate, packet delivery ratio and average delay were compared. In each experiment, 100 nodes of a wireless sensor network were randomly distributed in a square area of 100 m \(\times\) 100 m and were provided with a sink node to form a wireless sensor network environment with a planar topology, as shown in Figure 6, the black dot in Figure 6 represents the sink node. The specific parameters of the simulated network environment used for network deployment are shown in Table 1.  
Figure 6: Diagram of the node deployment in the wireless sensor network used in the simulation experiments. In order to analyze the security of routing algorithm, the complex network is simplified, and the network nodes are divided into two kinds: normal and malicious nodes. Meanwhile, the reputation value of a node is known, because the higher the reputation value of the node is, the more credible the node is. The reputation value of the normal and malicious nodes is 0.8 and 0.3 respectively. According to Section 4.1.2, the weakening factor \(\eta\) takes values in the range between 0 and 1. Here, the weakening factor is introduced to effectively weaken the statistical information from earlier times, so the value of the factor should be smaller (0.4). From the above Equation (3), we can obtain the coincidence rate \(D_{n}(\overline{d})\). Table 2 shows the number of redundant nodes, which have been removed under different parameter settings. It can be seen that if the node coincidence threshold is set to 1, any redundant nodes are not filtered out.