## 3 Greedy Scanning Data Collection Strategy
### Network Initialization
#### 3.2.1 The Establishment of Virtual Grid Structure  
As the deployment area is a rectangle, we adopt Cartesian coordinates for convenience. The origin of coordinates is located at deployment area center. The sink is static during the establishment. The process of establishing the virtual grid structure is as follows:  
Step 1. Calculate the Virtual Grid Cell Side Length  
In order to guarantee that each node can communicate with all nodes in its neighbor grids (i.e., UDLR of a grid), The relation of grid cell side length \(a\) and node communication range \(R\) must satisfy \(a\leq\sqrt{5}R/5\), as shown in Figure 3. In our simulation, we adopt the \(a\) as \(\sqrt{5}R/5\) for energy efficient purpose.  
Figure 3: The relation of communication radius with side length of grid cell.  
Figure 2: A wireless sensor network with virtual grid structure.  
Step 2. Broadcast the Sink Initial Location and Grid Cell Side Length  
After calculating the grid cell side length, the mobile sink broadcasts a \(HELLO\) packet to all nodes, which includes the side length of grid \(a\) and the coordinate of sink. The initial location of sink is \((x_{0},y_{0})\). The \(HELLO\) packet is shown in Figure 4.  
Step 3. Calculate the \(RCN\) for Every Grid Cell  
To identify each grid cell and their relative position in the deployment area, we introduce \(RCN\) (Row Column Number), which is composed of row number (\(M_{r}\)) and column number (\(M_{c}\)), as illustrated in Figure 5. For each node \(i\) can compute the \(RCN\) it belongs to by Equations (4) and (5) based on its location \((x_{i},y_{i})\) (\(1\leq i\leq N\)), and the broadcast \(HELLO\) package received in Step 1. As all nodes are static, the \(RCN\) of each grid cell is determined and unchangeable after the network is deployed.  
\[RCN=(M_{r},M_{c}) \tag{3}\]  
\[M_{r}=\left\lceil\frac{y_{i}-y_{0}-\frac{a}{2}}{a}\right\rceil \tag{4}\]  
\[M_{c}=\left\lceil\frac{x_{i}-x_{0}-\frac{a}{2}}{a}\right\rceil \tag{5}\]  
Step 4. Calculate the \(DN\) for Every Grid Cell  
The mobile sink is moving from one grid to another during the data collection. To reduce the location broadcasting scope, each grid cell calculates the relative direction to the mobile sink. We introduce the concept \(DN\) (Direction Number) for each grid cell to describe the relative direction,  
Figure 4: Format of \(HELLO\) packet.  
Figure 5: The row column number (\(RCN\)) of each virtual grid cell.  
as shown in Figure 6. The grid cell in which mobile sink is located is marked as \(GS\) (Grid of Sink). The value of \(DN\) and its meaning are as follows:  
1. The current grid cell is the \(GS\);
2. The current grid cell is located in the right side of column that \(GS\) belongs to;
3. The current grid cell is located in the left side of column that \(GS\) belongs to;
4. The current grid cell is right above \(GS\);
5. The current grid cell is right under \(GS\);  
Each node computes its \(DN\) according to the \(HELLO\) packet. The process of calculation is shown in Equation (6).  
\[DN=\begin{cases}0&,\ |x_{i}-x_{0}|\leq\frac{\theta}{2}\mathbf{\kappa}\,|y_{i}-y_{0}| \leq\frac{\theta}{2}\\ 1&,\ (x_{i}-x_{0})>\frac{\theta}{2}\\ 2&,\ (x_{i}-x_{0})<-\frac{\theta}{2}\\ 3&,\ |x_{i}-x_{0}|\leq\frac{\theta}{2}\mathbf{\delta}(y_{i}-y_{0})>\frac{\theta}{2} \\ 4&,\ |x_{i}-x_{0}|\leq\frac{\theta}{2}\mathbf{\delta}(y_{i}-y_{0})<-\frac{\theta}{2} \end{cases} \tag{6}\]  
As the \(DN\) indicates the relative position between the current grid cell and the mobile sink, the \(DN\)s of some grid cells will be modified when the mobile sink moves into another grid cell.