The Energy Efficient Test Assignment without reciprocal tests (EETA) algorithm builds the testing graph D by taking into account the total energy cost needed for the sensors to execute all the tests of the connection assignment. To this purpose, EETA defines Ci,j as the energy cost spent by the sensors v
i
and v
j
when the sensor v
i
executes a test over the sensor v
j
.
Initially, EETA initializes set V
D
as the set of sensors in region R. Considering the division in four quadrant of the WSN, also R results divided in four quadrants accordingly. As a result also the sensors in set V
D
can be considered split into four subsets, each corresponding to a quadrant. Specifically, we define Q
i
(with 0≥i≤3) as the set of sensors positioned in quadrant i and selected for the connection assignment. Thus, we have V
D
=Q0∪Q1∪Q2∪Q3, with Q
i
⊂V
i
.
In order to satisfy the conditions stated in Sect. 3, each of the Q
i
must be composed of at least t sensors (with the sensors of T included). With t sensors in each quadrant, each sensor can be tested by t others (c2) and the number of sensors that participate to the diagnosis is sufficient to satisfy (c1), once we have 4t≥2t+1. As long as the testing strategy tries to diminish the number of sensors in V
D
, we have n=4t, the minimum n required in our heuristic. Furthermore, the distance to R
c
, the center of region R, is also taken into account to choose the sensors in V
D
.
Note that the initial selection of V
D
may not be sufficient to ensure that t sensors per quadrant are chosen, hence, in this case, other sensors outside R should be added to V
D
. However, in cases where the region R is near the border of the network, it may not be possible to have at least t sensors in each quadrant. In order to guarantee the number of testers per quadrant, the center R
c
of the region R is then shifted toward the center of the network and R is enlarged accordingly.
The total energy cost spent by the tests made by the sensors present in quadrant i is defined as
, i.e.,
∀(v
i
,v
j
)∈E
D
∣v
i
∈Q
i
and
. We also define the total energy cost spent by all tests made by D as C
T
(D). Thus, we have
. The selection of sensors of V
D
is made to minimize the total energy consumption by tests between sensors.
For the diagnosis to be possible, condition (c2) must be fulfilled. As |Q
i
|=t, we can conclude that a sensor v
k
∈Q
i
will test all sensors present in
, i.e., E
D
={(v
k
,v
l
) ∀ v
k
∈Q
i
and
for i=0,…,3}.
It should be observed that edge (v
i
,v
j
)∈E
D
may not exist initially in E, i.e., the sensor v
i
may not be on the transmission range of the sensor v
j
. In order to make possible that the sensor v
i
tests v
j
it is necessary that the transmission range of v
j
be tuned. So the sink asks the sensors that are not neighbors of their testing sensors, i.e., that make and edge in E
D
, to augment their transmission ranges (i.e., the transmission power) in order to enable the test. The underlying assumption is that the network is dense and large and t is relatively small with respect to the network density so that the cases in which a sensor must augment its transmission power is unlikely to happen.
In order to permit that the selection of sensors in each quadrant makes the reduction of C
T
(D) possible, an initial heuristic is used. At first, the sensors in T are selected for each of the quadrants in which they are positioned, since those sensors must participate to the testing procedure. Thus, we define T
i
as the set of sensors of T geographically positioned in quadrant i. The cardinality of T
i
is equal to t
i
. Thus, we have T
i
⊂Q
i
and
. Considering the energy model presented in this work, the energy cost needed for the execution of a test grows polynomially with the geographic distance between the sensors. Thus, if sensors that are geographically near are selected for V
D
, we have a higher probability of generating a testing graph D with a value of C
T
(D) that is reduced.
The initial selection of sensors in V
D
is thus based on the distance of the sensors to a common point, R
c
in this case. Based on this principle, Q
i
is initially formed by the t
i
sensors of T
i
and the t−t
i
sensors of the quadrant i geographically nearer from R
c
. Thus, V
D
is formed mainly by sensors near to R
c
. Figure 3 shows an example of the definition of the set V
D
. Black bullets represent sensors that belong to V
D
. It should be observed that the simple strategy of picking up any initial set of t sensors does not lead to an optimal solution.
Even though the initial heuristic has the goal of selecting the nearest sensors to the point R
c
, it should be observed that a sensor v
k
∈T
i
may be farther from R
c
than a sensor v
l
∈(V
i
−Q
i
). Nevertheless, every sensor v∈T must participate to the diagnosis procedure, regardless of its distance to the point R
c
.
Although the sensors selected by the initial heuristic are the nearest from the center of R, farther sensors may be less distant from the majority of sensors present in their predecessor and successor quadrants, and may produce smaller test costs. This case can be seen in Figs. 4 and 5. In the example of the figures, the exchange of a sensor farther from R
c
than another, but nearer from the majority of the chosen sensors in the neighbor quadrants may diminish C
T
(D). In order to evaluate the possible sets of sensors that guarantee a minor value for C
T
(D) than that obtained by the initial heuristic, an algorithm is executed.
Consider the sensors v
k
∈V
i
and v
l
∈V
i
. The sensor v
k
is defined as the sensor farthest from R
c
that belongs to Q
i
, and v
l
is defined as the sensor geographically nearest to the sensor v
k
, and farther from R
c
than v
k
, so that v
l
∉Q
i
. In other words, v
l
is the sensor nearest from R
c
that was not selected for Q
i
. The algorithm consists in verifying if the exchange of any sensor v
n
∈Q
i
by the sensor v
l
produces a reduction in C
T
(D). The exchange that produces the higher reduction in C
T
(D) is performed. The process is repeated searching for other possible exchanges and is finished once the exchange of a sensor v
n
∈Q
i
by any sensor v
l
∉Q
i
does not generate a reduction in C
T
(D).
This process is performed in all of the quadrants, one quadrant at a time, i.e., at first the possible exchanges are verified in quadrant 0, until no exchange is performed, then the process is initiated in quadrant 1, and so on. The strategy is finished when there is no exchange in any of the four quadrants.
Although the quadrants may be visited more than once in the searching for possible exchanges, the strategy is finite once at some point every farther sensor will produce a higher cost. It is also clear that this heuristic iterates at most a number of times equal to the number of the sensors in the network.