4.5.1. Cost Function

To define the cost function, we consider the energy outage of IoT devices. The energy outage occurs when batteries of IoT devices are empty. Therefore, the cost function can be defined as

$$r\left(S,A\right) = \begin{cases} 1, \text{ if } E\_{\bar{i}} = 0, \\\ 1, \text{ if } E\_{\bar{j}} = 0, \\\ 0, \text{ otherwise.} \end{cases} \tag{43}$$
