# GraphSAGE-Based Multi-Path Reliable Routing Algorithm for Wireless Mesh Networks
## 3 Multi-Path Routing Algorithm Based on the Improved Breadth First Search
### Multipath Output
The network performance of each path is calculated according to Equation (15). The path with the largest value of \(NP\) is the optimal path \(p_{best}\). ## 5 Simulation

This section describes the experimental environment and the model training process and evaluates the performance of the proposed algorithm based on the simulation results. ### Experimental Environment and Model Training Process

The network simulations are performed in \(NS3\). In the simulations, the maximum radio transmission range and the interference range is set to 300 m and 500 m, respectively. The log-distance path loss model is used as the propagation model, which is suitable for outdoor propagation such as in urban areas, and the path loss exponent is set to 3 [25]. The constant speed propagation delay model is used as the delay model. Unless specifically stated, the simulations are performed in a 16 Mesh nodes topology within an area of 1000 m \(\times\) 1000 m and the node transmission power is set to 23.0306 dB. The distribution of the nodes is shown in \[u_{ij}=\frac{1}{\sum\limits_{k=1}^{c}{\left(\frac{d_{ij}}{d_{k}}\right)^{\frac{ 2}{m-1}}}} \tag{4}\]5 WiFi6 is used as the physical layer protocol, which operates in a 5 GHz frequency band. The traffic is sent from the source using the User Datagram Protocol (UDP) and the packet size is 1024 bytes. In the experiments, the implementation of the GraphSAGE model is based on Python 3.8 and the deep learning framework PyTorch. The network topology of 16 nodes is first simulated in \(NS3\), 30 routing schemes that are randomly generated and traffic is sent at 10 different rates for each routing scheme. 1000 pieces of network performance data are collected for training. Based on the combination of each routing scheme and sending rate, \(NS3\) is used to generate network performance metrics such as traffic, transmission delay, and packet loss rate. Then the FCM algorithm of Section 4.1 is used to iterate the clustering centers of the network performance dataset and correspond the network performance to the clustering categories one by one. Finally, the network labels are generated based on the feature vectors of the nodes in the topology and the GraphSAGE model is trained in a supervised manner. During the training process, the number of iterations of the GraphSAGE is set to 3000, the learning rate \(lr\) is set to 0.003 and the neural network uses the Adam optimizer and the Relu activation function. In addition, the number of first-order neighbor nodes is set to 4 and the number of second-order neighbor nodes is set to 8. ### Algorithm Performance Evaluation

The evaluation consists of two parts: (1) The GraphSAGE-based performance optimization algorithm can effectively evaluate the network performance and optimize the selection of transmission paths. (2) The actual performance of the multi-path reliable routing algorithm for wireless mesh networks is evaluated and proven to improve the network performance. The average of 10 runs of the program is used as the simulation results. During each run, randomly select several source-destination node pairs from the network topology for packet transmission, record the network performance metrics such as end-to-end delay, packet loss rate, and throughput, and take the arithmetic average of the simulation data. \[u_{ij}=\frac{1}{\sum\limits_{k=1}^{c}{\left(\frac{d_{ij}}{d_{k}}\right)^{\frac{ 2}{m-1}}}} \tag{4}\]6 Distribution of nodes. This section first proves that the GraphSAGE-based performance optimization algorithm can effectively evaluate the network performance and optimize the selection of transmission paths. The available bandwidth (avail-bw) of an end-to-end path is defined as the residual capacity at the path's bottleneck, which represents the maximum additional load that the path can carry before saturation [26]. It is often applied as a network performance metric for path selection.