## 4 Proposed SARP Routing Protocol for BASNs
### Working Principle of Sensors in SARP
#### 4.4.4 Route Repair Procedure
Constraints in (11a)-(11f) show that each active biosensor node is connected to one group leader or a group leader connected to at least one other group leader within its transmission range in the network, in which \(d\) (\(\mathcal{S}_{hi},\mathcal{S}_{hj}\)) is equal to 1 only if the group leader \(\mathcal{S}_{hi}\) can directly reach \(\mathcal{S}_{hj}\), and is \(d_{i0}(\mathcal{S}_{hi},\mathcal{S}_{hj})\) otherwise. \(\mathcal{R}\) is an integer whose value is 1 when a biosensor node is connected to the cluster head (\(\mathcal{X}_{\delta_{i1},\mathcal{S}_{hj}}\)) or a cluster leader is connected to the neighboring group leader (\(\mathcal{E}_{\mathcal{S}_{h(i)},\mathcal{S}_{hj}}\)), and 0 otherwise. Constraints in (12a) state that all the packets are collected by the group head node from its member nodes in a cluster. Constraints in (12b) ensure that the collected data are forwarded from the biosensor head node \(\mathcal{S}_{h1}\) to the neighboring biosensor head node \(\mathcal{S}_{h2}\). Constraints in (13a) and (13b) state that a relay cluster head node joins the routing path \(\mathcal{R}_{p(k)}\) between the source and the destination in the network, in which \(\mathcal{J}_{\delta_{hi},\mathcal{S}_{hk}}^{\mathcal{S}_{hj}}\) is a binary variable whose value is 1 only if a group leader biosensor node \(\mathcal{S}_{hj}\) is on the route between the source head node \(\mathcal{S}_{hi}\) and the destination head node \(\mathcal{S}_{hk}\), while \(\mathcal{J}_{\mathcal{S}_{h(h)}}^{\mathcal{S}_{hh},\mathcal{S}_{hk}}\) is also a binary indicator that is equal to 1 only if the traffic stream, sourced at \(\mathcal{S}_{h\mu}\), and the destination to \(\mathcal{S}_{hk}\) uses the link to the head \(\mathcal{S}_{hj}\) node in the network. In (13c), constraints guarantee that the distance between two group leaders must not be greater than the defined maximum distance \(d_{max}\). Constraints in (13d) ensure that the group head node \(\mathcal{S}_{h2}\) is closer to the sink. Constraints in (14) declare that a group head node \(\mathcal{S}_{h2}\) can not receive the data packets \(\mathcal{D}\mathcal{P}_{i}\) from the neighboring group leader \(\mathcal{S}_{h1}\) over a link \(\mathcal{E}_{1}\) than its maximum storage capacity \(s_{c}\). This constraint helps to avoid data packet losses due to buffer overflow during packet transmission in the network. Constraints in (15) support the constraints of (14), which guarantee that the data packets always move over a different link \(\mathcal{L}_{k}\) towards the neighboring cluster head nodes in the network. Constraints in (16) ensure that the number of packets transmitted by a sensor node \(\mathcal{S}_{i}\) to sensor node \(\mathcal{S}_{j}\) over a link \(\mathcal{L}(i)\) is equal to the number of packets transmitted from the sensor node \(\mathcal{S}_{k}\) over a link \(\mathcal{L}(j)\). This helps to balance the network traffic load in the entire network. Constraints in (17a) state that the sum of the energy spent by the biosensors during packet transmission (E\({}_{t}\)) and reception (E\({}_{r}\)) is bounded to a specific round in the network. Constraints in (17b) minimize packet transmission and reception energy consumption of each biosensor node in each round of the data collection process. Constraints in (18a)-(18c) state that the routing constraints show that the biosensor nodes and head relay nodes along a routing path \(\mathcal{R}_{p(k)}\) between the source and the destination are connected in the network. Constraints in (19) make it clear that at least one group leader or a sensor node in the region \(\mathcal{R}_{i}\) exists away from the sink in the network.