# Virtual Grid-Based Routing for Query-Driven Wireless Sensor Networks
## 1 Introduction  
Wireless sensor networks (WSNs) consist of two main components: several resource-constrained sensor nodes and a resource-rich data collector unit, called a base station or sink. Sensor nodes have sensing, computing, and communicating capabilities in order to cater to the needs of applications and provide the required sensing information to the sink [1, 2, 3]. Sensor nodes are strategically positioned to detect and monitor various environmental parameters, including but not limited to humidity, pressure, light levels, and more [4, 5, 6]. On the basis of mobility, sinks can be characterized as either static or mobile. A static sink conserves the energy of sensor nodes because it does not require them to broadcast their location periodically. However, the neighboring nodes of the static sink experience more traffic as compared to the distant nodes, and they are prone to exhausting their energy rapidly. This situation is known as the crowded center effect [7] or the energy hole problem [8]. In numerous practical scenarios, sensor nodes are deployed in challenging environments where human intervention is impractical or unfeasible [9, 10]. Therefore, charging or replacing their batteries is very difficult. Mobile sink deals with this situation as it changes its location with its movement, which leads to changes in its neighboringsensor nodes. Therefore, the data traffic does not put a burden on a specific set of sensor nodes, which was the case in the static sink. Mobile sink can accumulate the data from the sensor network by following any of the three mobility patterns: _random_[11], _fixed_[12], and _controlled_[13; 14]. The sink mobility pattern depends on application requirements and surrounding environments. However, mobility of the sink resolves the crowded center effect and extends overall network lifetime, but it requires advertisement of its location periodically, which leads to an overhead in the network. Without this information, the sensor nodes may transmit data to the outdated location of the sink, leading to a low data delivery ratio and increased latency. To alleviate the overhead associated with providing the mobile sink's location and enhance network performance, grid-based routing protocols have been suggested. The routing protocols begin by constructing a virtual grid structure within the sensor network. Following that, a Cluster Head (CH) is chosen for every grid cell, and the remaining nodes within each cell, referred to as cell member nodes, transmit their data to their respective CHs. These CHs subsequently relay the data to the sink. This data transmission from the sensor node to the sink can be query-driven [5; 15], event-driven [16], periodic [17], and hybrid. In the context of query-driven data transmission, the sink initiates the process by sending queries. Designated sensor nodes meeting the criteria specified in the query transmit the sensed data back to the sink.  
This paper proposes a Virtual grid-based Routing for Query-driven WSNs (VGRQ). The VGRQ algorithm creates square-shaped virtual grid cells in the sensor field, specifically targeting an even count of sensor nodes. Afterward, the Cell Header (CH) is selected considering both its energy level and distance from the midpoint of the grid cell. Four CHs together form a chain to reduce communication activities. A randomly moving mobile sink informs a CH about its location and sends a query mentioning the area of interest. This CH further shares this information with other CHs along the chain. Sensor nodes located within the area of interest and meeting the query requirements transmit their data to the respective Cell Header (CH). The CHs then forward the accumulated data to the mobile sink through a chain-like structure. This concept of transmission along the chain conserves the energy of the sensor nodes, reduces the data delivery delay, and increases the data delivery ratio.