## 5 Proposed Heuristic
### Stage I and II: Determining Sojourn Locations and RPs  
Generally, the main idea of identifying the sojourn locations in the network by considering the objective function of minimizing DDT in Equation (7) is to consider the locations on the trajectory that the sensor-nodes have denser distribution. Since at the beginning of network's operation, the mobile-sink is not familiar with the sensor-nodes which are being distributed in the periphery of trajectory, it will have a tour to introduce itself to the sensor-nodes which are in the communication range of the mobile-sink. To recognize the dense areas for selecting sojourn locations and RPs, one of the simple solutions is to deliver this work to the mobile-sink. However, there are two main disadvantages for this solution. The first one is related to computational resources for the mobile sink and data harvesting time in the start-tour. In this case, at first the mobile-sink needs to complete the first tour to harvest all of the related information about sensor-nodes. It should move with a very slow average speed to send its information to the sensor-nodes and wait until receiving the reply messages before visiting other sensor-nodes. Obviously, in large-scale EWSNs this process will be very time consuming. And after collecting all of the information about the sensor-nodes, a central station or the mobile-sink should do the computation for determining the sojourn locations and RPs. The second disadvantage is related to the sensor-nodes which should communicate with the mobile-sink in case of receiving introduction message that is energy-consuming process since the reply message should provide adequate information for the process of selection.  
To eliminate the mentioned limitations, we attempt to design a distribute heuristic that allocates the responsibility of selecting RPs to the sensor-nodes and the sojourn locations will be identifies based on the position of selected RPs. The following steps illustrate our overall approach in this stage and more details will be presented afterwards.  
1. The mobile-sink moves in the trajectory at the first tour for introducing itself to the periphery sensor-nodes and when a sensor-node receives introduction message, it will consider itself as the candidate RP. The mobile-sink moves in the trajectory and broadcasts the introduction message. Therefore, in this stage the mobile-sink does not wait for reply message and by moving in the trajectory without stopping can accomplish this task.
2. The candidate RP starts to do the process of identifying its potentiality for becoming RP based on our designed Fuzzy Decision System (FDS) which is being described with details in Section 5.1.1.
3. The voting procedure will be started after the previous step to choose the most suitable sensor-nodes as RPs.
4. The mobile-sink determines its sojourn locations based on the selected RPs.
5. The rest of sensor-nodes will be assigned to the appropriate RPs based on our designed methodology for constructing balanced routing trees as explained in Section 5.2.  
After identifying the sojourn locations, the mobile-sink stops in each sojourn location to harvest data from the RPs which are being assigned to that specific sojourn location. Since the sensor-nodes are event-driven and their data includes information about an (some) event(s), the mobile-sink should harvest all of the buffered data from the RPs. To determine the waiting-time, the mobile-sink broadcasts a message by arriving to a sojourn location to inform the RPs about its arrival. Then RPs reply a message which includes the amount of their buffered data. And finally based on the channel capacity, the mobile-sink can calculate the required waiting-time. It should be mentioned that if during the waiting-time a RP receives new data, it informs the mobile-sink to extend the waiting-time.