# Energy and Environment-Aware Path Planning in Wireless Sensor Networks with Mobile Sink
## 4 Formulation for Optimal Solution
### Optimal Path Planning Problem
The smallest value among all adjacent metrics is selected as the final neighboring environmental impact as follows:  
\[NEI_{i}(t)=\text{min}\big{\{}NEI_{ij}(t)\big{\}}_{j\in NZ_{i}}\big{\}}. \tag{9}\]  
Finally, the final environmental impact of zone \(i\) is jointly calculated by the multiple environmental impacts \(MEI_{i}(t)\) and the neighboring environmental impact \(NEI_{i}(t)\) as follows:  
\[FEI_{i}(t)=\left\{ \begin{array}{ll}MEI_{i}(t)&\quad\text{if }NEI_{i}(t)=1\\ \frac{MEI_{i}(t)+NEI_{i}(t)}{2+\text{exp}(-K_{ij})}&\quad\text{otherwise}\end{array}  \right.. \tag{10}\]  
According to Equation (10), the proposed final environmental effect metric is based on the insignificant nearby environmental impact during normal operation periods. If a neighbor's environmental effect is one, it is appropriate to ignore it. As a zone's neighbor's attenuation coefficient drops, so should its final environmental metric. This means the closest neighborhood zone will have a larger environmental impact. So, the final environmental metric should be proportional to the attenuation coefficient. Finally, the exponential function is used where a small value of the attenuation coefficient results in a reasonably large decrease in the proposed metric result. We must assess the impact of the environmental characteristics on each cluster head since the mobile sink's path planning algorithm must seek cluster head locations to avoid risky regions. According to Equation (11), the following is the ultimate environmental effect measure for a cluster head \(x\) in zone \(i\):  
\[EIM_{x}^{i}(t)=FEI_{i}(t). \tag{11}\]  
For the path planning algorithm to circumvent the cluster heads in the danger zones, the cluster heads in the candidate cluster head set \(CH^{t}\) that have a final environmental impact metric larger than the threshold value are added to the final candidate cluster head set \(FCH^{t}\). The path planning method avoids cluster heads in the candidate cluster head set \(CH^{t}\) in hazardous zones by adding cluster heads with high final environmental effect metrics to the final candidate cluster headset \(FCH^{t}\); formally, as in Equation (12):  
\[FCH^{t}=\Big{\{}x\Big{|}x\in CH^{t},EIM^{i}_{x}(t)>EI_{ht}\Big{\}}. \tag{12}\]  
A heterogeneous environment is often used for deploying the WSN. As a result, the environment is divided into discrete regions known as zones, and these regions are then classified by assigning each zone a value known as zone priority based on its given priority (important) [12]. Data that is urgent is sent via sensor nodes located in high-priority areas. Urgent data packets should be sent to the sink right away since they have a high priority. The network topology is clustering-based, and the sink node rotates regularly among cluster heads. Imagine that a certain cluster head in a high-priority zone collects urgent data packets from its members when the sink is either visiting it for the first time or has previously done so. In such scenario, the routing method should be used to quickly convey this urgent data to the sink. Since the mobile sink will go first to high-priority cluster heads, zone priority is an important factor to take into account while determining the mobile sink's path. As a result, urgent data may be transferred directly from cluster heads to sink nodes without the need for routing. Therefore, excessive route avoidance may reduce network lifespan and/or increase latency and/or throughput of critical data. In order to find the optimal data collection path for the mobile sink utilizing a new function called the zone priority metric function, we incorporate zone priority as one of the key metrics. Equation (13) defines the zone priority measure for a cluster head \(x\) in zone \(i\):  
\[ZPM^{i}_{x}(t)=\frac{(1-\varepsilon)}{ZP_{\max}-ZP_{\min}}ZP_{i}(t) \tag{13}\]  
where, \(ZP_{min}\) and \(ZP_{max}\) are the minimum and maximum values assigned for zone priority. The zone priority function gives a high-priority cluster head a better chance of becoming the movable sink's new location.