## 3 Spawn Multi-Mobile Agent Itinerary Planning (SMIP) Approach
### Determining the Itinerary for Each MA in SMIP  
In MIP, determining the itinerary for each MA is a challenging issue, where the optimal itinerary has a direct impact on both energy and time consumption. In the proposed SMIP approach, there are two types of MA (main MA and SMA); therefore, the sink is required to determine the itinerary for each MA. At the first, after the network partitioning process is done, the sink assigns one main MA to each partition. In each partition, the source nodes' visited order list for the main MA is statically determined at the sink by adapting the local closed first (LCF) algorithm. In this paper, LCF algorithm has been adapted for two reasons. First, LCF algorithm has simplicity and low computation process to find the path of MA. Secondly, in terms of fair comparison, this paper adapts the same algorithm that has been used by GIGM-MIP algorithm. LCF algorithm uses the current global network information of all sensor nodes and determines an efficient MA itinerary at the sink before MA is starts its migration. When the main MA is at the sink, LCF lookup to the source node with the shortest distance to the sink from the rest of the source nodes. Then, the LCF algorithm lookup again to the source node with the shortest distance to the current location of the main MA and so on until all the remaining source nodes are assigned to the main MA's visiting list. After the main MA's visiting list has completed, the sink then determines in which source node the main MA will create an SMA. In the proposed SMIP approach, the size of the main MA's data payload is used to determine at which source node the SMA can be created. Specifically, a threshold has been used for the main MA's data payload, so once the accumulated data exceeds the threshold, the main MA spawns a new SMA. Let \(S\in(1,2,3,\ldots,i)\) represent a set of source nodes to be visited by the main MA, then the size of the main MA's data payload at source node \(i\) by the MA-assist local reduction process can be calculated as:  
\[R_{i}=S_{data}^{i}\cdot(1-r) \tag{1}\]  
where \(R_{i}\) is the data reduced at source \(i\), \(S_{data}^{i}\) is the size of raw data at source \(i\), and \(r\) is the reduction ratio (\(0<r<1\)). When the main MA completes the reduction process at source \(i\), it migrates to the next source node (\(i+1\)) to perform the same reduction process and then aggregates the result with the one that is already carried from source \(i\). Therefore, the size of accumulated data after the MA leaves source \(i\) can be calculated as follows:  
\[S_{ma}^{1}=R_{1}, \tag{2}\] \[S_{ma}^{2}=R_{1}+(1-f)\cdot R_{2}\] \[S_{ma}^{i}=R_{i}+(1-f)\cdot R_{i}\] \[=R_{1}+\sum_{i=2}^{S}(1-f)\cdot R_{i}\]  
where \(S_{ma}^{i}\) is the size of the accumulated data after the main MA leaves the source node \(i\), \(f\) is the aggregation ratio (\(0\leq f\leq 1\)), and \(R_{i}\) is the amount of data aggregated by \(f\). Note that in Equation (2), there is no data aggregation at the first source node. The itinerary of the SMA is also determined by using LCF algorithm. The only difference between the main MA and SMA itinerary is that the starting point of the SMA is the location where it has been created, while the starting and ending point of the main MA is the sink. Moreover, there is no data aggregation process along with the SMA's itinerary, because it only visits intermediate nodes. However, LCF algorithm does not always guarantee a lower cost, since the output of this algorithm is highly dependent on the MA's current location and the size of the accumulated data carried by the main MA. The last source nodes to be visited by the main MA are typically associated with high migration cost due to the increase in the size of the MA's data payload. Therefore, in the proposed SMIP approach, the data payload is drained and sent back to the sink with the SMA, which would lead to a decrease in the migration cost of the main MA.