## 4 Proposed SiM-RPO Algorithm
### Bound MSs' Movement within the Networks  
Initially, all the MSs are deployed in a specific position in the network, and then, they start moving along with the defined path in the network. However, how does one bound the MSs movement in the network and follow the defined path? Which do not go outside of the network? When an MS reaches the position in the network where it changes movement direction, then how does it know that specific position? All the MSs move in a specific region, so the coordinates of the region at which the MSs change the movement direction are stored in the memory of the MS. Three network coordinates, center, corner, and mid-boundary coordinates, are stored. When an MS moves a step forward, then it checks its present coordinates with the stored coordinates. If it is equal to one of the stored coordinates, then it changes its movement direction and defines its direction according to the stored coordinates. Otherwise, it moves in the same direction. The addition or subtraction of a fixed quantity \(z\) defines the direction of the MSs' movement. For example, MS\({}_{1}\) starts its motion from the center of the network. MS\({}_{1}\) checks its current position after moving to the next step with the stored coordinates. When the present coordinates do not equal any of the stored coordinates, then it moves in the same direction. When its coordinates become equal to the corner coordinates, then it increases only the \(x\) coordinate by adding a fixed value of \(z\) while the \(y\) coordinate remains same. The addition of a fixed value \(z\) to \(x\) indicates that the movement of the MS\({}_{1}\) is in the horizontal direction and bounds the MS\({}_{1}\) in the network. In another case, if the coordinates are equal to the midpoint, then it starts increasing only the \(y\) coordinate, which indicates the vertical movement. When the coordinates are equal to the center coordinates, then it moves in the diagonal direction. Likewise, this is done for all the MSs to follow the specified path in the network. To track the MS on the specified path, the increment or decrement of the \(x\) and \(y\) coordinates forces the MS to follow the specified path. Changing both the \(x\) and \(y\) coordinates specifies the diagonal movement of the MS, while changing only one coordinate determines the horizontal or vertical movement of the MS. To change the direction of the MS, it periodically checks its coordinates with the center, corner, and mid-boundary coordinates of the network, which are stored in the memory of the MS. When its present coordinates are matched with the stored values, then the MS changes its direction. The water currents can cause the MS to diverge from its path. Therefore, to keep the MS on the track, an error \(e\) is calculated by every MS when moving to the next step. When an MS step forwards from the current position (\(x_{p}\), \(y_{p}\)) to the next position (\(x_{n}\), \(y_{n}\)), then it is compared with the estimated position value from the surface sinks to confirm the actual position of the MS and detect the drifts. When an MS step forwards, then it checks its new position (\(x_{n}\), \(y_{n}\)) with the previous position (\(x_{p}\), \(y_{p}\)) and finds the error \(e\) as:  
\[e=|x_{p}-x_{n}|-1 \tag{24}\]  
Furthermore, for the \(y\) coordinates, \(e\) is:  
\[e=|y_{p}-y_{n}|-1 \tag{25}\]  
The value of \(e\) will be zero if the water currents do not disturb the movement direction of the MS. If \(e\) has some positive or negative value, then it will be subtracted or added respectively, when moving to the next position to follow the specified triangular path. In case of positive error, the next coordinates are calculated as:  
\[MS(x_{n},y_{n})=(x_{p}\pm z-e,y_{p}\pm z-e) \tag{26}\]In case of negative error, the next coordinates are:  
\[MS(x_{n},y_{n})=(x_{p}\pm z+e,y_{p}\pm z+e) \tag{27}\]  
For example, the MS is at the (250, 250) position, and it moves to the next position (251, 251). In this case, the water currents do not disturb the MS movement, and the error is zero.