## 4 Our Proposed Routing Algorithm
### Route Setup Phase  
Mobile sink nodes can move with a certain speed to receive data packets only when they sojourn at certain parking positions. The movement trajectory mainly depends on the network periphery. Mobile sink nodes can move along the network periphery and cross the border in a certain area according to the actual layout. Initially, there is only one mobile sink node existing in the sensor network, and it is located at one special point in the sensing field. On the basic of the value of the distance \(d_{sn}\), neighbor sensor nodes of the mobile sink node in each parking position are chosen for later use. If the value of the distance \(d_{sn}\) is much smaller than the transmission radius, sensor nodes will transmit their monitored data to the sink node directly; otherwise, relay sensor nodes need to be elected to forward monitored data. Relay sensor nodes will be elected mainly based on the value of the link cost. In order to improve communication efficiency and reduce long communication cost, a multi-hop communication manner is used in our proposed routing algorithm. If the distance \(d_{sn}\) of sensor \(s_{i}\) is larger than threshold \(d_{0}\), it needs to find an adjacent sensor as its relay node to forward its data. To achieve load balancing, relay nodes are chosen mainly based on the relative distance and the residual energy. In order to ensure a relay node with a better distance and enough energy is used, distance factor \(D_{f}\) and energy factor \(E_{f}\) metrics are defined in Equations (2) and (3), respectively, where \(E\)(\(j\)) is the residual energy of sensor nodes, and can get the maximum residual energy by flooding. Distance factor \(D_{f}\) is related to the sum of the distance between source node \(s_{i}\), relay node \(s_{j}\), and destination node \(\mathrm{P_{i}}\). Relay node will be chosen from the neighbor nodes of source node:  
\[D_{f}=\frac{d(s_{i},s_{j})^{2}+d(s_{j},\mathrm{P_{i}})^{2}}{\max(d(s_{i},s_{j} )^{2}+d(s_{j},\mathrm{P_{i}})^{2})} \tag{2}\]  
\[E_{f}=\frac{\max(E(j))-E(j)}{\max(E(j))} \tag{3}\]  
Link cost between sensor node \(s_{i}\) and \(s_{j}\) can be defined as is shown in Equation (4), where the value of \(w\) is between 0 and 1. If sensor node \(s_{i}\) is far away from the current location \(P_{i}\) of mobile sink nodes, it needs to choose a sensor node \(s_{j}\) as its relay node. Sensor node \(s_{j}\) with the minimum link cost will be chosen to relay monitored data:  
\[link\_-\cos t(i,j)=(1-\omega)*D_{f}+\omega*E_{f} \tag{4}\]  
Here, we define neighbor sensor nodes of sensor \(s_{i}\) as those nodes existing in the transmission range of \(s_{i}\) Thus neighbor sensor nodes of mobile sink nodes are elected based on the distribution of sensor nodes in rectangle network. Along the mobile sink node moving direction, neighbor sensor nodes with the longest distance will be defined as boundary sensor nodes. Thus, parking position \(P_{i}\) can be determined mainly based on the transmission range of sensor nodes and boundary sensor nodes. The selection of parking positions is shown in Figure 2. In this figure, we define the direction of X-axis as the direction of movement of mobile sink nodes, and mobile sink node \(MS_{i}\) is located at the origin of coordinates. According to the value of the distance \(d_{m}\), neighbor sensor nodes of \(MS_{i}\) are chosen and shown as a black diamond in Figure 2. Boundary sensor nodes will be chosen from these neighbor nodes and marked with black dots. According to the transmission range of boundary sensor nodes, parking position \(P_{i}\) can be determined and marked with a triangle. That is,, park positions are determined by the direction of movement and the transmission range of the boundary sensor nodes. If there is no neighbor sensor nodes of the mobile sink node located in a certain position, the mobile sink node will keep moving along the movement path for a certain distance until it finds a position with neighbor sensor nodes. The mobile distance depends on the actual situation.