# Sensor Topology Optimization in Dense IoT Environments by Applying Neural Network Configuration
## 3 System Model Design and Optimization Framework
### Problem Formulation  
In this work, we focus on maximizing the 2D sensing area by activating the minimum number of sensors and selecting their optimal coordinates in terms of extending the network lifetime under energy and communication constraints. We, therefore, propose a joint optimization problem to minimize the total energy consumption and maximize the coverage area by ensuring a WSN-connected graph at all times. All possible generated topologies generated randomly are a function of \(N\), as \( \begin{pmatrix}M\times M\\ N\end{pmatrix} \). Therefore, the number of topologies scale exponentially as a function of the number of scattered nodes. However, only a subset of the produced topologies are valid ones, thus satisfying the network constraints. To do so, the overall network energy consumption must be minimized and, thus, the total residual energy is maximized and the WSN's lifetime is extended. In our model, we apply the first-order radio model [27] in which the energy of the radio transmitter and receiver circuitry is equal to \(e_{elect}=50\) nJ/bit for the electronic subsystem, and \(e_{amp}=\frac{100\mathrm{pl}}{\mathrm{bit}}\) m\({}^{2}\) expresses the energy required to run the transmitter amplifier. The model also assumes a pass loss factor \(\approx\frac{1}{d}\), where \(d\) is the Euclidean distance between two nodes and \(l\) is the path loss exponent as \(2\leq l\leq 5\), according to the application's requirements. The energy consumed to transmit a packet is given as:  
\[E_{tx}=e_{elect}\times k+e_{amp}\times k\times d^{l} \tag{1}\]  
where \(k\) is the packet size in bits. Following this, the energy consumed to receive a packet of \(k\) bits from a node is given as:  
\[E_{rx}=e_{elect}\times k \tag{2}\]  
According to Equations (1) and (2), the total energy consumption per node is defined as: \(E_{total}=pk*(E_{tx}+E_{rx})\), where \(pk\) stands for the total number of packets sent or relayed by a sensor node. Additionally, we assume that the radio channel is symmetric, which means that the energy cost of transmitting and receiving a packet is the same. As far as the path loss channel model is concerned, we assume the log-normal shadowing model, as in [28]. Empirical studies [28] have shown that the log-normal shadowing model  
Figure 1: (**a**) Initial placement of sensor nodes for a deterministic deployment, sink node at point (0, 0); (**b**) Initial placement of sensor nodes for a random deployment, sink node at point (0, 0). provides a more accurate multipath channel model as compared to Nakagami and Rayleigh, appropriate for a cellular deployment. Therefore, the path loss is given as:  
\[PL\big{(}d_{ij}\big{)}=PL(d_{o})+10\beta\,\log_{10}\bigg{(}\frac{d_{ij}}{d_{o}} \bigg{)}+X_{\sigma} \tag{3}\]  
where \(d_{o}\) is a reference distance, \(\beta\) is the path loss exponent, and \(X_{\sigma}\) is a zero-mean Gaussian random variable in dB, with a standard deviation, \(\sigma\), to simulate the shadowing effects. Following this, for each node given a transmitting power, \(P_{t}\), in dBm, the received power in dBm is given as follows:  
\[P_{r}=P_{t}-PL\big{(}d_{ij}\big{)} \tag{4}\]  
We formulate a joint energy and coverage optimization problem, with connectivity constraints, in which the objective function, \(f_{1}\), relates to the total average WSN energy consumption for the data collection and transfer to the BS and \(f_{2}\) relates to the total sensing coverage inside the given terrain. The definition of \(f_{1}\) is:  
\[f_{1}=\frac{1}{N}{\sum_{i\in S}}E_{total} \tag{5}\]  
where the set \(S\) defines the set of all active nodes. The sensor connectivity constraint is fulfilled, as long as \(P_{ri}\geq P_{rtlres}\)\(\forall i\in[1\dots N]\) and \(P_{rtlres}\) gives the minimum required power for the packet reception. Furthermore, the second objective relates to the maximization of the coverage area, in essence the maximization of the total sensing coverage points within the terrain.