## 3 Search Most and Remove Useless Algorithm
### The SMRU Algorithm  
The algorithm is divided into two parts. In the first part, the candidate position of the directional charger is selected on a sensor randomly. Next, we search for the number of sensors covered by the chargeable radius at the candidate position of the directional charger. The candidate position rotates \(360^{\circ}\) to find the angle that can cover most of the sensors within the charging range. If the number of sensors covered by the candidate position of the directional charger is more than three, the algorithm is repeated for each candidate position within the chargeable radius. To find the angle that can cover most of the sensors within the charging range, the position that covers the most sensors is selected as the new position of the directional charger. If the number of sensors covered by the candidate position of the directional charger is less than three, the candidate position is determined as the position of the directional charger. In the second part, after determining the position of the directional charger, the proposed algorithm checks whether there is an unnecessary position of the directional charger. Therefore, the algorithm checks and removes the charger, and the sensors covered by the charger can be covered by other chargers. This check action can effectively reduce the number of chargers. The operation of SMRU represented as Algorithm 1 is as follows:  
```
Input: The locations of all the sensors \(s_{i}\) and directional charger \(c_{i}\) Output: Positions of chargers
1:Step 1. Randomly select the sensor position as the position of the charger. 2:Step 2. Search for the number of sensors covered by the chargeable radius \(d\) at charger position \(n\). 3:while\((distance(s_{i}-c_{i})\leq d)\)do
4: Record the number of sensors to \(n\) in the range. 5:endwhile
6:Step 3. The charger rotates \(360^{\circ}\) to find the angle that can cover most of the sensors within the charging range. 7:Step 4. If the number of sensors covered by Step 2 is more than three, Step 3 is repeated for different positions of sensors within the chargeable radius, and the position that covers most of the sensors is selected as the new position of the charger. If the number of sensors covered by Step 2 is less than three, the position of the charger does not change. ### An Example of SMRU

In this study, we use the sensor position to deploy a charger, which can ensure that the worst result of the position selection will converge to the number of sensors. This means that when there are N sensors in WRSNs, it is only necessary to deploy N chargers in the worst case. This can prevent the position selection algorithm from converging. The first idea at the beginning of this study is to search for the charger position that first covers the most sensors among all sensor positions. However, this method is time-consuming because the same calculation is repeated at 360\({}^{\circ}\) angles of the charger for each position. Therefore, this study improves the first idea. This study found that the key point to covering all sensors in WRSNs with fewer chargers is the charger position with dense sensors. For example, under the same sensor position configuration, if the charger position is selected as shown in Figure 1, the charge angle of the charger is limited, so that two chargers are required to fully cover all the sensors in this area. However, if the algorithm first compares the positions in the dense area and finds the position that can cover most of the sensors, the algorithm can reduce the number of chargers to one, as shown in Figure 2.

Figure 1: Covers all sensors with two chargers. Therefore, the proposed algorithm first randomly assigns the position of the charger and then checks to see if there are more than three sensors in the 360\({}^{\circ}\) charging range of the charger, after which it selects the charger position that covers most of the sensors.