# Random Walker Coverage Analysis for Information Dissemination in Wireless Sensor Networks
## 4 Simulation Results  
In this section, indicative simulations are provided in order to validate the analytical results and confirm the applicability of the proposed modeling. The following simulations were made on a custom-made simulator. The simulator was developed in Python 3.0, using the SciPy and NumPy libraries, whereas the graphs were plotted using the Matplotlib library. Randomness was generated using the random number generator of Scipy (i.e., the Mersenne Twister pseudo-random number generator) with a different seed each time. Simulations are performed on random geometric networks with 1000 and 10,000 nodes (see Figure 3 for an indicative snapshot of a marginally-connected network). The geometric area chosen for the development of the networks is the 2D-torus as suggested by the literature (e.g., in [23]). The networks assumed for simulation purposes are from marginally- to fully-connected (therefore, there are various values for the radius \(r_{c}\)), and on each of them, a random walker is employed. Furthermore, in Figure 4, the mean number of neighbors for a network of 1000 nodes is depicted as a function of \(r_{c}\). It is obvious that for each node, the longer the radius \(r_{c}\) was, the more (on average) neighbors it had. To begin with, the average spatial movement of the random walker is tested on each step. This is described by the following equation:  
\[\bar{d}=\frac{2r_{c}}{3}. \tag{8}\]  
where \(\bar{d}\) is the average distance covered by the random walker. The obtained simulation results of a random walker doing \(10^{5}\) steps on a network with \(10^{4}\) nodes and \(r_{c}=0.05\) are shown in Figure 5, and as depicted, they are in accordance with Equation (8). In particular, the equation's result is 0.033, whereas the one derived from the simulation is 0.033. Figure 3: A snapshot of a geometric random graph with \(N=1000\) and transmission range \(r_{c}=0.052\). It depicts a marginally-connected WSN from which it can be visually understood why there is a significant time lag in the network coverage of a random walker, compared to denser networks. One can easily observe the existence of small bottlenecks dispersed over the network. Afterwards, Equation (1) is evaluated considering a network with 1000 nodes and radius \(r_{c}=0.1\). For this network, a random walker performed 100 steps, and on each step, the spatial displacement starting from the starting node is computed. The results are illustrated in Figure 6 along with the analytic results of Equation (1). From the depicted comparison, it seems that the analytical result comprehends the actual walker's movement. Both curves are incremental in a similar manner, and although there are some spikes on the simulation curve, Equation (1) successfully describes the underlying behavior. Figure 4: Mean number of neighbors depending on the radius \(r_{c}\) for a geometric random graph of 1000 nodes. Figure 5: A bar graph showing the spatial displacement of the random walker after each step on a network with \(10^{4}\) nodes and \(r_{c}=0.05\). There are \(10^{5}\) steps, and each bar corresponds to the number of steps (\(\times 50\)), where the spatial displacement of the random walker is in the range of \(10^{-3}\). In order to evaluate Equation (3), the number of each node's neighbors that were visited by the random walker in the last nine steps is monitored for multiple simulations. The simulations took place in 10 networks of \(10^{4}\) nodes with the random walker performing \(10^{5}\) steps for each one of them. The results confirmed the relevant analytical results (analytic calculation = 2.838, simulation results' mean = 3.264, std = 1.718). In the sequel, simulations are performed on networks with \(10^{3}\) nodes and varied transmission range \(r_{c}=0.06,0.1,0.2,0.5\) and 1.0 in order to verify the main arguments of this work. For each value of \(r_{c}\), 10 networks are created, and on each one of them, a random walker runs for \(10^{4}\) steps.