• Nenhum resultado encontrado

An energy-Aware data aggregation algorithm for data collection in wireless sensor networks = Um algoritmo de agregação de dados ciente do consumo de energia para a coleta de dados em redes de sensores sem fio

N/A
N/A
Protected

Academic year: 2021

Share "An energy-Aware data aggregation algorithm for data collection in wireless sensor networks = Um algoritmo de agregação de dados ciente do consumo de energia para a coleta de dados em redes de sensores sem fio"

Copied!
53
0
0

Texto

(1)

Universidade Estadual de Campinas Instituto de Computação

INSTITUTO DE COMPUTAÇÃO

Edson Ariel Ticona Zegarra

An Energy-Aware Data Aggregation Algorithm for

Data Collection in Wireless Sensor Networks

Um Algoritmo de Agregação de Dados Ciente do

Consumo de Energia para a Coleta de Dados em Redes

de Sensores Sem Fio

CAMPINAS

2017

(2)

Edson Ariel Ticona Zegarra

An Energy-Aware Data Aggregation Algorithm for Data

Collection in Wireless Sensor Networks

Um Algoritmo de Agregação de Dados Ciente do Consumo de

Energia para a Coleta de Dados em Redes de Sensores Sem Fio

Dissertação apresentada ao Instituto de Computação da Universidade Estadual de Campinas como parte dos requisitos para a obtenção do título de Mestre em Ciência da Computação.

Thesis presented to the Institute of Computing of the University of Campinas in partial fulllment of the requirements for the degree of Master in Computer Science.

Supervisor/Orientador: Prof. Dr. Rafael Crivellari Saliba Schouery Co-supervisor/Coorientador: Prof. Dr. Leandro Aparecido Villas

Este exemplar corresponde à versão nal da Dissertação defendida por Edson Ariel Ticona Zegarra e orientada pelo Prof. Dr. Rafael Crivellari Saliba Schouery.

CAMPINAS

2017

(3)

Agência(s) de fomento e nº(s) de processo(s): Não se aplica.

Ficha catalográfica

Universidade Estadual de Campinas

Biblioteca do Instituto de Matemática, Estatística e Computação Científica Ana Regina Machado - CRB 8/5467

Ticona Zegarra, Edson Ariel,

T437e TicAn energy-Aware data aggregation algorithm for data collection in wireless sensor networks / Edson Ariel Ticona Zegarra. – Campinas, SP : [s.n.], 2017.

TicOrientador: Rafael Crivellari Saliba Schouery. TicCoorientador: Leandro Aparecido Villas.

TicDissertação (mestrado) – Universidade Estadual de Campinas, Instituto de Computação.

Tic1. Redes de sensores sem fio. 2. Algoritmos genéticos. 3. Roteamento (Administração de redes de computadores). I. Schouery, Rafael Crivellari Saliba,1986-. II. Villas, Leandro Aparecido,1983-. III. Universidade Estadual de Campinas. Instituto de Computação. IV. Título.

Informações para Biblioteca Digital

Título em outro idioma: Um algoritmo de agregação de dados ciente do consumo de

energia para a coleta de dados em redes de sensores sem fio

Palavras-chave em inglês:

Wireless sensor networks Genetic algorithms

Routing (Computer network management)

Área de concentração: Ciência da Computação Titulação: Mestre em Ciência da Computação Banca examinadora:

Rafael Crivellari Saliba Schouery [Orientador] Eduardo Coelho Cerqueira

Fabio Luiz Usberti

Data de defesa: 24-08-2017

Programa de Pós-Graduação: Ciência da Computação

(4)

Universidade Estadual de Campinas Instituto de Computação

INSTITUTO DE COMPUTAÇÃO

Edson Ariel Ticona Zegarra

An Energy-Aware Data Aggregation Algorithm for Data

Collection in Wireless Sensor Networks

Um Algoritmo de Agregação de Dados Ciente do Consumo de

Energia para a Coleta de Dados em Redes de Sensores Sem Fio

Banca Examinadora:

• Prof. Dr. Rafael Crivellari Saliba Schouery Instituto de Computação  UNICAMP • Prof. Dr. Eduardo Coelho Cerqueira

Instituto de Tecnologia  Universidade Federal do Pará • Prof. Dr. Fabio Luiz Usberti

Instituto de Computação  UNICAMP

A ata da defesa com as respectivas assinaturas dos membros da banca encontra-se no processo de vida acadêmica do aluno.

(5)

Acknowledgements

I would like to thank my advisor, Rafael Schouery, and my co-advisor Leandro Villas, who gave me an opportunity and support all this time. This work would not have been completed without their guidance throughout this project. I learned a lot from them.

I am thankful to my family; my parents were a great support without whom I could not have nished this thesis. I would like to remark that my brother played a very important role all this time.

I want to express my gratitude to Professor João Meidanis, with whom I worked at Scylla Informatics, and whose support came when it was needed the most.

I want to thank Professors Cid de Souza, Pedro Rezende and Flávio Miyazawa. Their lectures were very instructive.

I would like to thank my friend Rommel, who helped me on my arrival to Brasil, to Gabriela for her continuous support, to the guys from Rajesh, to all my friends, to the guys from the LOCo for the interesting talks at breaking times, to the guys from LRC, particularly to Pedro, and to the Institute of Computing for such a enriching experience. Finally, I want to thank Brazil and his people for this pleasant and comfortable time here. They always made me feel like I am in home.

(6)

Resumo

Redes de Sensores Sem Fio consistem de centenas ou milhares de nós com energia li-mitada e, portanto, faz-se necessário o uso eciente de energia nessas redes. Dado que as transmissões são as operações de maior exigência energética, os algoritmos de rotea-mento devem considerar um uso eciente das transmissões em seus planejarotea-mentos, a m de prolongar a vida útil da rede.

Para enfrentar esses desaos, propõe-se um algoritmo centralizado, denominado Rote-amento Aprimorado de Melhora Contínua (Improved Continuous Enhancement Routing Algorithm  ICER), para computar árvores de roteamento de qualidade renada, com base na agregação de dados, considerando o consumo de energia das baterias.

São realizadas comparações entre o ICER e outros algoritmos conhecidos na literatura. ICER foi capaz de garantir, em média, a sobrevivência de 99,6% e a conectividade de 99,3% dos nós contra 90,2% e 72,4% em relação ao melhor algoritmo comparado em nossos experimentos. Os resultados obtidos indicam que ICER signicantemente estende a vida útil da rede enquanto mantém a qualidade da árvore de roteamento.

(7)

Abstract

Wireless sensor networks consist of hundreds or thousands of nodes with limited energy resources; thus, ecient use of energy is necessary in these networks. Given that trans-missions are the most energy-demanding operation, routing algorithms should consider an ecient use of transmissions into their designs in order to extend the network lifetime. To tackle these challenges a centralized algorithm is proposed, named Improved Con-tinuous Enhancement Routing (ICER), for computing routing trees of rened quality based on data-aggregation while being aware of the batteries energy state.

Comparisons between ICER and other known solutions in the literature are performed. Our experiments show that ICER is able to guarantee, on average, the survival of 99,6% and the connectivity of 99,3% of the network nodes against 90,2% and 72,4% in relation to the best compared algorithm. The obtained results show that ICER signicantly extends the network lifetime while maintaining the quality of the routing tree.

(8)

List of Figures

2.1 Network architecture . . . 15

2.2 Routing examples for dierent types of networks . . . 15

2.3 Eect of the routing tree over the delivery time . . . 16

2.4 Aggregation examples . . . 17

2.5 Steiner Tree Problem solution . . . 18

2.6 Vertex contraction . . . 20

2.7 Setting of a new BRKGA generation . . . 23

3.1 Routing examples for SPT and InFRA . . . 25

3.2 Routing example for DAARP . . . 26

3.3 Routing example for DDAARP . . . 27

3.4 Routing example for ERA and HCCRFD . . . 29

4.1 Flowchart of ICER . . . 33

4.2 ICER routing example . . . 40

5.1 Percentage of dead nodes versus time. . . 43

5.2 Percentage of dead nodes from sink versus time. . . 44

5.3 Connectivity of the network over time for dierent algorithms . . . 44

5.4 Size of the tree expressed as the number of nodes in the routing tree. . . . 45

5.5 Control packets generated by each algorithm. . . 46

5.6 Percentage of dead nodes for events distributed in a time window . . . 46

5.7 Delivery time of packets . . . 47

(9)

List of Tables

3.1 Summary of some routing algorithms . . . 30 5.1 Energy (in mW) needed for transmission and reception for standard sensors 41 5.2 General parameters used for the simulation . . . 42 5.3 BRKGA parameter settings . . . 43

(10)

Contents

1 Introduction 12

1.1 Main Contributions . . . 13

1.2 Organization of the Thesis . . . 13

2 Background 14 2.1 Wireless Sensor Networks . . . 14

2.1.1 Data Aggregation . . . 17

2.2 Steiner Tree Problem . . . 17

2.2.1 Formulations . . . 18

2.2.2 Reductions . . . 20

2.2.3 Heuristic . . . 21

2.3 Genetic Algorithms and BRKGA . . . 21

3 Related work 24 3.1 Shortest Path Tree . . . 24

3.2 Information-Fusion Routing Algorithm . . . 24

3.3 Data Aggregation Aware Routing Protocol . . . 25

3.4 Dynamic DAARP . . . 26

3.5 Energy-Aware Routing Algorithm . . . 27

3.6 HCCRFD . . . 28

3.7 Continuous Enhancement Routing Solution . . . 29

3.8 Summary . . . 30

4 ICER 32 4.1 Conguration Phase . . . 32

4.2 Request/Set Route Phase . . . 34

4.3 Data Transmission . . . 35

4.4 Event ending . . . 35

4.5 Battery Usage and Depletion . . . 35

4.6 Centralized algorithm . . . 36

4.6.1 Decoder . . . 38

4.7 Routing Example . . . 39

5 Results and Comparisons 41 5.1 Energy and network model . . . 41

5.2 General Settings . . . 42

5.3 Network Lifetime . . . 43

5.4 Overhead and Tree size . . . 44

(11)

5.6 Delivery Time . . . 46 5.7 Longest Path . . . 47

6 Conclusions 49

(12)

Chapter 1

Introduction

Wireless Sensor Networks (WSNs) are a special kind of ad hoc network that rely on spa-tially distributed autonomous devices which measure many types of physical quantities such as temperature, pressure, and pollutants. WSNs are used for defense purposes [9], en-vironmental monitoring, communications, in industry [22, 23] and agriculture [29], among other applications. For instance, the deployment of a WSN to monitor the state of a forest can be used to prevent re or illegal logging, saving lives and assets, and reducing the environmental impact.

The sensors usually have limited sensing, processing and communication capabilities and are powered by a battery. Sometimes the battery is attached to the device such that its replacement is only possible by replacing the whole device. Moreover, sensors are deployed in many type of grounds, often of dicult access, making its maintenance expensive. Therefore, it is desirable that an ecient use of the nodes energies is developed to extend the lifetime of the network, which is essential for many applications.

In general, sensing devices are composed of processing units, memory, sensors, trans-ceivers, among other electronic components. The operation of each component contributes to the general consumption of the battery; however, transmission is the most expensive operation in energy terms [4]. Consequently, a wise use of transmissions is expected to extend the lifetime.

For all the mentioned factors above, routing algorithms should take energy consump-tion into consideraconsump-tion. In particular, transmission has to be carefully handled by the routing algorithm. To achieve this goal, data aggregation is exploited as the base of the presented algorithm. When two or more incoming packets arrive, the receiving node can merge the packets so it only needs to retransmit one aggregated packet, reducing the number of transmissions.

Nonetheless, extending the network lifetime is not the only concern of routing algo-rithms in WSNs. There are some other problems that also must be addressed. For in-stance, extending the lifetime of as many nodes as possible is not useful if the connectivity is lost, i.e., the sensing nodes cannot deliver data to the nal application. Consequently, connectivity over time is also an important feature that should be considered.

Delivery time, the time it takes for the data to reach the application from the sensor nodes, is an important performance characteristic of a WSN. Delivery time is proportional to the number of intermediate nodes required to get to the sink; thus, the quality of the

(13)

CHAPTER 1. INTRODUCTION 13

routing tree is related to the application. For example, real-time applications require small delivery times, so the routing tree has to be of high quality; not so critical applications can manage routing trees of lower quality to reduce energy consumption. Finally, even if the network lifetime is extended, maintaining connectivity, the quality of the routing path has to be good enough for the application in order to maintain an acceptable delivery time.

In a data collection application, usually the deployed sensors are constantly sensing data but they only decide to transmit when the acquired data is meaningful. Therefore, to reduce the number of transmissions, the routing infrastructure may be built only when an event happens. In addition, the acquisition rate is not so high in comparison to other applications, ranging from some seconds to a few minutes. The duration of an event is usually much greater than the acquisition rate, so the trac intensity is very low. For instance, the work presented by Larios et. al [21] is a usual data collection application.

The present work addresses the design of a routing algorithm for data collection that extends network lifetime while having control of the delivery time. High connectivity is a characteristic that is maintained over time as a result of the presented routing algorithm.

1.1 Main Contributions

The rst version of this work was presented on the 16th IEEE International Symposium on Network Computing and Applications (NCA 2016) under the title A Continuous Enhance-ment Routing Solution Aware of Data Aggregation for Wireless Sensor Networks [34].

The extension of the previous work, improving the proposed algorithm, was submit-ted to a journal under the title Improved Continuous Enhancement Routing Solution for Energy-Aware and Data Aggregation in Wireless Sensor Networks.

1.2 Organization of the Thesis

Chapter 2 presents some background on Wireless Sensor Networks and the Steiner Tree Problem. Chapter 3 provides a review of some algorithms of the literature. Then, in Chapter 4, the energy-aware algorithm based on data-aggregation is presented; and a discussion on its design and its features is shown. Chapter 5 introduces the results and computational comparisons. Finally, Chapter 6 presents the conclusions and gives some insights about future works.

(14)

Chapter 2

Background

This chapter presents the theoretical background for this work. First, Section 2.1 intro-duces the concepts related to WSNs, states the routing problem and presents its relation to the Steiner Tree Problem. Then, Section 2.2 introduces the Steiner Tree Problem and presents the state-of-the-art regarding the approaches for its solution. Finally, in Section 2.3, the Biased Random-Key Genetic Algorithm (BRKGA) is introduced.

2.1 Wireless Sensor Networks

WSNs comprise of hundreds or thousands of energy-restricted autonomous devices, re-ferred as nodes, with sensing and communication capabilities forming an ad hoc network. The architecture of a WSN varies according to the application. For instance, a common layout is to consider a hierarchical network with some nodes that have better communica-tion capabilities, such as better ampliers for reaching longer distances and sometimes not having energy restrictions, referred as gateways, and the usual sensor nodes that collect the data but have a smaller radius of communication and limited battery. The sink is a node that centralizes all the gathered data and works as an interface between the network and the application. In some scenarios, gateways can directly reach the sink.

In this work, another usual layout is contemplated that considers all the nodes with the same communication capabilities so the only way to reach the sink is in a multi-hop fashion. The intermediate sensor nodes used to transmit data to the sink, in this case, are called relay nodes. The source nodes are the ones that sense the data that must be delivered to the sink. The routing tree is the set of nodes that are used for routing. Moreover, we do not impose restrictions on the computational power of the sink; thus, it is allowed to perform regular computations. This general conguration is depicted in Figure 2.1.

When nodes have the same capabilities, the network is said to be homogeneous, that is, all the devices are of the same type. On the other hand, when the network is composed of dierent types of devices, the network is said to be heterogeneous. For instance, in an heterogeneous scenario where the gateways have no restrictions on energy, they could be heavily used for routing; in contrast, in an homogeneous scenario, the energy expenses cannot be concentrated in a few nodes. Instead, the energy consumption must be balanced

(15)

CHAPTER 2. BACKGROUND 15

Sink

Cloud Server

Application

Figure 2.1: General scenario where the sensor nodes are connected by a multi-hop path to the sink that computes the routing tree and serves as a gateway with the application.

in order to prolong the network lifetime.

Dierent types of architectures lead to dierent approaches for routing the packets. For instance, in an heterogeneous network that has gateways with powerful communication capabilities and better batteries, the nodes can be grouped into clusters so that each node reaches a gateway and then the gateway can directly reach the sink, as depicted in Figure 2.2(a). Unlike the heterogeneous case, a similar approach cannot be applied to a homogeneous network. Figure 2.2(b) shows an example of routing for the homogeneous case.

Sink Gateway

Node

(a) Heterogeneous network

Sink Node

(b) Homogeneous network

Figure 2.2: Routing examples for dierent types of networks

The delivery time can be dened as the time a packet takes to reach the sink from the source. When a node receives a packet, the node takes time to analyze the header and make a decision about the routing, this time, tproc is the processing time. Then,

the packet is placed into a memory buer to start its transmission. Still, there may be many packets that need to be sent, so there is a queue where the packets wait until it is time for transmission; tq represents the queuing time, which is the time that the packet

remains in queue. When the packet reaches the front of the queue, the packet is placed into the transmission buer so that the transmitter places the packet into the wireless medium; this time, tt is the transmission time. Finally, once the packet is in the wireless

medium, tprop, representing the propagation time, indicates the time it takes to reach its

destiny [20].

Therefore, the delivery time can be calculated by the following expression t = tproc+ tq+ tt+ tprop.

(16)

CHAPTER 2. BACKGROUND 16

The maximum allowed delivery time depends on the application. According to Kurose and Ross [20], voice applications cannot have delays greater than 400 milliseconds. Often, monitoring applications can stand greater delays; while real-time applications usually require delays in the order of milliseconds of even microseconds, because they take an action based on the gathered data.

To exemplify the impact of the routing tree size in the delivery time, consider a routing algorithm that increasingly augments the size of the routing tree to balance the use of the battery. Initially, it may use small routing trees such as the trees in Figure 2.3(a) and Figure 2.3(b). However, carelessly increasing the size of the routing tree may lead to routing trees like the ones in Figure 2.3(c) and Figure 2.3(d), which results in greater delivery times that might not be suitable for some applications.

A proactive routing constantly maintains a routing infrastructure [25], thereby, when an event is detected, the data is immediately dispatched reducing latency, which may be suitable for high trac networks. Nonetheless, keeping the routing infrastructure has a greater overhead, augmenting the energy consumption on the network nodes. On the other hand, building a routing infrastructure only when necessary, i.e., when an event happens, which is known as reactive routing, reduces the amount of transmissions by adding some latency and is more appropriate for event-driven networks.

Sink Node (a) Sink Node (b) Sink Node (c) Sink Node (d)

(17)

CHAPTER 2. BACKGROUND 17

Sink Node

(a) Routing with no aggregation

Sink Aggregator Node

(b) Routing with aggregation

Figure 2.4: Aggregation examples

2.1.1 Data Aggregation

Data aggregation is a common technique used in WSNs that refers to combining data coming from dierent nodes. The relay nodes, instead of just retransmitting the raw data, can aggregate the data, reducing the number of transmitted packets. This scheme often reduces the energy consumption. The relay nodes that aggregate data are called aggregators.

Consider the routing example shown in Figure 2.4, on which the two bottom nodes are source nodes. On the routing scheme presented in Figure 2.4(a), no data aggregation is performed at all; for each reading of the sources, a total of six packets will be generated to reach the sink. Figure 2.4(b) presents a routing example on which the green node is an aggregator; in this scenario, a total of ve packets are transmitted in the network for each reading of the sources.

When considering a long operation time, the observed reduction on the number of packets makes a considerable economy of energy. The exact reduction of transmitted bits depends on the structure of packet, but in general, fewer bits are used for headers and paddings. In order to make data aggregation, an aggregator has to wait for all the packets to arrive; consequently, the aggregator adds some delay to the delivery time. Such time is counted into the processing time.

As a result, the routing problem based on data aggregation can be interpreted as the problem of nding an optimal aggregation tree. An important result is that nd-ing an optimal aggregation tree is N P-hard [2], and is equivalent to the Steiner Tree Problem [18].

2.2 Steiner Tree Problem

We formally state the Node-Weighted Steiner Tree Problem (NWSTP).

The (rooted) Node-Weighted Steiner Tree Problem. Given a graph G = (V, E), a set of terminal nodes S ⊆ V and a root vertex r ∈ S, where each edge e ∈ E and each vertex v ∈ V have a non-negative associated cost ce and bv, respectively; the problem is to nd a tree T ⊆ G of minimum

(18)

CHAPTER 2. BACKGROUND 18

cost (dened as the sum of the weights of the vertices and edges in T ) that connects S. The non-terminal nodes that are part of the solution tree T are called Steiner nodes.

A straight way to formulate the routing problem is to consider the network nodes as vertices of a graph; the links between the nodes as edges of the graph; the source nodes and the sink as terminals, and the vertices' weights as the battery level of the nodes. The NWSTP is a generalization of the Steiner Tree Problem (STP), on which the vertices are zero-weighted and is also N P-hard.

Figure 2.5 shows a graph, with the edges of the solution for the STP highlighted in blue.

Node not in Solution Steiner Node Terminal

Figure 2.5: The edges on gray represent the edges of the graph and the blue edges represent the ones in the solution

2.2.1 Formulations

The most common integer linear programming formulation for the STP is to associate a binary variable xe for each edge e ∈ E, such that xe = 1 if edge e is part of the solution

and xe= 0 otherwise. Then, one can consider the following formulation [5]:

min X e∈E xece (2.1) s.t X e∈δ(W ) xe≥ 1 ∀ W ⊆ V, W ∩ S 6= ∅, S \ W 6= ∅ (2.2) xe∈ {0, 1} ∀ e ∈ E, (2.3)

where δ(W ) is the set of edges incident to W and it is called a Steiner cut, since W has at least one terminal and cannot contain all the terminals. Thus, Restriction (2.2) guarantees that at least one edge of the Steiner cut is part of the solution. This can also be interpreted as the requirement of the existence of a path between any pair of terminals. Note that the NWSTP can also be dened with the above described formulation by adding a new binary variable zv, such that zv = 1 if the vertex v is part of the solution

(19)

CHAPTER 2. BACKGROUND 19

and zv = 0 otherwise; by adding the restriction

zu ≥ xuv ∀ u ∈ V, ∀ {u, v} ∈ E, (2.4)

and by replacing the objective function (2.1) with X e∈E xece+ X v∈V zvbv. (2.5)

The directed version resulting from the replacement of edges by two antiparallel arcs is proven to be stronger than the undirected version just presented [17]. On the directed version it is considered a directed graph G = (V, A), with non-negative costs on the arcs, and a variable ya= 1 if the arc a is on the solution, and ya= 0 otherwise. The following

formulation (detailed in [17]) is based on the directed version and is used, for example, in SCIP-Jack [13], one of the best solvers for the STP and variants.

min X a∈A yaca (2.6) s.t X e∈δ−(W ) ye ≥ 1, ∀ W ⊆ V, W ∩ S 6= ∅, S \ W 6= ∅ (2.7) X e∈δ−(r) ye = 0 (2.8) X e∈δ−(v) ye = 1 ∀ v ∈ S \ r (2.9) X e∈δ−(v) ye ≤ 1 ∀ v ∈ V \ S (2.10) X e∈δ−(v) ye ≤ X e∈δ+(v) ye, ∀ v ∈ V \ S (2.11) X e∈δ−(v) ye ≥ ya, ∀ a ∈ δ+(v), v ∈ V \ S (2.12) ya ∈ {0, 1}, a ∈ A (2.13)

where δ−(W ) is the set of incoming arcs into W , δ(v) is the set of incoming arcs into v

and δ+(v) is the set of outgoing arcs from v. Constraint (2.7) guarantees that at least an

edge of the cut dened by any subset of vertices, including at least a terminal and excluding the root, is part of the solution; guaranteeing connectivity of the solution. This restriction is the directed version of Constraint (2.2). The problem can be expressed in terms of ow, considering |S| units of ow going out of r and each terminal receiving one unit of ow; hence Constraint (2.8) points that there is no ow going into r, Constraint (2.9) guarantees that each terminal behaves similar to sinks, that is, there is only ow going into them; and Constraint (2.10) guarantees that every other node either has one arc receiving ow or no ow at all. Constraint (2.11) strengthens the LP-relaxation [10] and it restricts that there are fewer incoming than outgoing arcs for each node. Finally, Constraint (2.12)

(20)

CHAPTER 2. BACKGROUND 20

v

i

v

j e1 e2 e3 e4 e5 e6 e7

(a) Vertex vj is to be contracted into vi

v

i e1 e2 e3 e4 e5 (b) Resulting vertex vi

Figure 2.6: By connecting all the edges of vj in vi, without considering loops and parallel

edges, the vertex vj can be contracted into vi. Note that edge e7 disappears and edges e5

and e6 are parallel after the contraction, but only one of them is considered.

restricts that for every non-terminal vertex, each outgoing arc is necessarily zero if there is no ow going into the vertex. Constraints (2.8), (2.9), (2.10), (2.12) have an empirical improvement in solving the STP [26].

The NWSTP can also be modeled using Formulation 2, in an analogous way as in Formulation 1. More details on Steiner formulations and its variants can be found in [28].

2.2.2 Reductions

The size of the network can be dened in terms of the number of nodes and the number of links between them; when working with the network, the nodes are mapped as vertices and the links between them as the edges incident to the vertices. If the size of the instance can be reduced, by either eliminating vertices or edges, then the search space of the solution is also reduced. As the search space is reduced, the algorithms are potentially faster for nding a solution. This procedure must be done carefully, because when removing a vertex or an edge, an optimal solution could be lost. Consequently, these reductions must guarantee that at least one optimal solution is maintained. More formally, when a set of reductions R is applied to a given instance I; the size of the resulting instance I0 must

be less than or equal to the size of I. Furthermore, the reductions must guarantee the existence of a solution in I0 with the same objective value as a solution in I. Let {v

i, vj}

be an edge; then vj can be contracted into vi by connecting all the adjacent edges of vj

into vi, without considering loops and parallel edges, and nally deleting vj. Figure 2.6

depicts a vertex contraction. The following reductions [11, 7] are commonly used for the Steiner Tree Problem:

• A node with degree one that is not a terminal can be safely deleted.

• A node vi with degree two that is not a terminal can be safely deleted along with

its incident edges by connecting its two adjacent vertices with an edge.

• An adjacent node to a terminal of degree one can be contracted into the latter. All of them are referred as Degree Test (DT). These reductions are shown to be useful when the network is sparse. In contrast, when the network is dense, they have little

(21)

CHAPTER 2. BACKGROUND 21

impact. Nonetheless, the computational cost of applying these reductions is small enough to be executed regardless of the network density.

When deleting a node with degree two, the new edge is assigned a weight equal to the sum of the deleted node plus the weight of the two deleted edges. Also, when contracting a node into a terminal, the weight of the terminal is increased by adding the weight of the contracted node and edge.

2.2.3 Heuristic

The Repetitive Shortest Path Heuristic (RSPH) is broadly used in the context of Steiner Tree problems. It was introduced by Takahashi and Mastsuyama [30] and later improved by Aragão et al. [8] and Polzin [26]. RSPH can also be implemented with a small variant based on the Fredman and Tarjan [12] version of the Dijkstra's algorithm.

Algorithm 1 presents RSPH. The heuristic receives a terminal t as input; then, the Dijkstra's algorithm is executed considering t as initial node; when another terminal node is found, the nodes in the shortest path are added to the solution and their distances are set to zero, so they are processed rst in the next iteration due to their position in the priority queue. Iteratively, this is done until all the terminals are connected.

The heuristic starts by dening the solution variable Sol, on Line 2, and pushing the terminal t to the priority queue Q, on Line 3. Then, in a similar way as the Dijkstra's algorithm, the elements are extracted from the priority queue until it is empty. On Line 5 an element is extracted from Q; if the extracted node u is a terminal, then S0 denotes the

set of nodes that are on the path between the nodes in Sol and the terminal u; all the elements of S0 are reinserted into the priority queue with maximum priority, on Line 8,

and the vertices in S0 are added to the solution, in Line 9. Thereupon, in Line 11, an

iteration over the adjacent nodes of u, denoted as Adj[u], is performed; if the distance of the adjacent node, denoted as v.d in Line 12, is greater than the distance of u plus the weight of the edge between them, denoted as w(u, v); then the distance is set to such value. Finally, the found solution Sol is returned.

In addition, when two nodes are at the same distance; the tie is broken by the remaining energy on them; i.e., the priority queue returns rst the node with more energy available. This procedure is denominated as Node-Weighted RSPH (NWRSPH). The complexity of the RSPH, based on Dijkstra's algorithm using a Fibonacci heap, is O(log |S|(|E| + |V | log |V |)).

2.3 Genetic Algorithms and BRKGA

A Genetic Algorithm (GA) is a metaheuristic inspired by the evolution mechanism and used for optimization problems. A feasible solution is a solution that complies to all the restrictions of an optimization problem. In a GA, a chromosome encodes a feasible solution. A chromosome is modeled as an array of numbers or a string. Each element of the chromosome receives the name of allele. The tness value of a chromosome is the value of the objective function of the solution the chromosome represents. The decoder,

(22)

CHAPTER 2. BACKGROUND 22

Algorithm 1 Repetitive Shortest Path Heuristic 1: function RSPH(t)

2: Sol = ∅ . Solis the solution

3: Q ← t . Qis the priority queue

4: while Q not empty do

5: u ←Extract(Q)

6: if u is terminal then

7: S0Set of nodes on the path between the previous tree and the current terminal

8: s.d ← 0 ∀s ∈ S0 .i.e. the elements of S0are reinserted into the priority queue with maximum priority

9: Sol = Sol ∪ S0

10: end if

11: for v ← Adj[u] ∀ u ∈ Sol do

12: if v.d > u.d + w(u, v) then

13: v.d ← u.d + w(u, v) 14: end if 15: end for 16: end while 17: return Sol 18: end function

which is specic for the problem, is the function that associates a chromosome with a solution and computes its tness value. A set of chromosomes is called a population.

A GA starts by generating a random population, then evolves it generating a new one. The new generation is the result of combining and mutating the chromosomes of the previous one. The combination or crossover of two chromosomes can be done, for instance, by randomly selecting an index and then taking the alleles from the rst chromosome before the index and the alleles from the second chromosome after the index, resulting in a new chromosome. Mutation may be done by randomly changing some elements of the chromosome. The algorithm must be aware that when combining two chromosomes the new chromosome might not represent a feasible solution, so special care must be taken at this step.

Bean [6] proposed the Random Key Genetic Algorithm (RKGA), which takes a uni-formly distributed random number in the range of [0, 1] that is used as a key to codify the chromosomes as an array of these random numbers. The advantage of the RKGA is that the resulting chromosome of a crossover always encodes into a feasible solution.

Gonçalves and Resende [14] introduced the Biased Random Key Genetic Algorithm (BRKGA). A BRKGA ranks the chromosomes in a generation and selects the subset of chromosomes with the best tness, which is called the elite set. Then, to combine two chromosomes, it chooses one chromosome from the elite set and the other one from the remaining chromosomes. In contrast with a normal Genetic Algorithm, BRKGA introduces mutants as a set of random chromosomes instead of performing mutations.

The initial population is a random set of p chromosomes. In a BRKGA, the generation of a new population has some dierences from a usual GA. The elite set, which is a subset of pe chromosomes with better tness, is directly copied into the following generation;

this is called an elitist strategy. The mutants are a set of pm random chromosomes

introduced into the following generation; their function is to avoid getting trapped into a local minimum. The p−pe− pm remaining chromosomes come from the uniform crossover

of an elite chromosome and a non-elite one with probability ρe > 0.5 of inheriting each

allele from its elite father. Figure 2.7 depicts this process.

The algorithm nishes after a given number of generations or when the reached solution is not signicantly improved after a while. Since each chromosome is independent, the

(23)

CHAPTER 2. BACKGROUND 23

{

}

pm pe k-th generation k+1-th generation elite set non-elite set crossover

X

Figure 2.7: The BRKGA generates a new generation by directly copying the pe

chromo-somes from the elite set; then generating pm random chromosomes and nally combining

an elite and a non-elite chromosome for the remaining p − pe− pm chromosomes.

calculation to get its tness value can be performed in a parallelized fashion. The available API [31] lets dene the number of threads for parallel decoding. Furthermore, it oers the advantage of setting several independent populations, which provides a broader search.

(24)

Chapter 3

Related work

This chapter presents some algorithms found in the literature; some of which are used to compare the present work with. We describe them, present their characteristics and discuss about their drawbacks. At the end of the chapter, Section 3.8 presents a summary with Table 3.1 so that the comparison can be easily made.

3.1 Shortest Path Tree

The Shortest Path Tree, SPT [18], starts by ooding the network with a conguration message, containing the distance in hops to the sink. Each receiving node updates the distance in hops, increasing it by one, and broadcasts the conguration message again. This procedure is done until all the nodes are reached; this way, every node knows which neighbor it should route through to reach the sink by using the shortest path. Then, the network is ready to start its operation. When a node detects an event, it reports its data to the sink by using a shortest path. Data aggregation is performed in an opportunistic manner, that is, when there are overlapping paths.

To congure the network, the quantity of transmissions carried out by each node is only one; which is the minimum possible. However, a main disadvantage on SPT is that its routes are not dynamic. Moreover, this approach does not consider the end of events to reconstruct the routing tree. Due to its simple design, the aggregation rate is low, leading to routing trees of low quality and static over time. Figure 3.1(a) shows an example for routing in SPT; the nodes are labeled with the distance in hops to the sink. Thus, a node makes the routing following its neighbor that is closer to the sink. Notice that the two rightmost bottom source nodes do not perform any data aggregation, although it is possible without losing any quality on the routing tree.

3.2 Information-Fusion Routing Algorithm

The Information-Fusion Routing Algorithm, InFRA [24], tackles the routing problem by building event based clusters. That is, whenever an event is detected, all the nodes that detected the event are grouped together into a cluster. For each cluster, the node with smallest id is chosen as cluster-head (CH) and is responsible to aggregate the data in

(25)

CHAPTER 3. RELATED WORK 25 r 3 2 3 5 3 1 2 1 2 4 5 5 6 3 2 1 4 3 4 3 5 5 5 3 4 1 4 6 4 2 4 5 4 2 4 4 5 7 5 1 4 4 4 2 2 2 3 3 5 5 7 5 6 3 4 2

(a) SPT is based on the distance in hops to the sink, which is the label for the nodes.

r 3,7 2,8 3,9 5,10 5,7 3,7 1,7 2,8 1,7 2,7 4,7 5,11 6,8 3,9 2,9 1,8 4,10 3,8 4,9 3,9 5,12 5,11 5,9 3,8 4,11 1,8 4,9 6,8 4,9 2,8 4,9 5,10 4,8 2,8 4,7 4,10 5,10 7,11 5,10 1,8 4,11 4,10 4,9 2,7 2,8 2,8 3,9 3,9 5,11 5,12 7,11 5,8 6,9 3,8 4,9 2,8

(b) The nodes are labeled with a pair (a, b), with a being the distance in hops to the sink and b being the aggregated distance.

Figure 3.1: Routing examples for SPT and InFRA. The sink is the red node, the CHs, for InFRA are in green, and the source nodes are in maroon.

that cluster. Then, the CHs send the cluster data to the sink by using the shortest path while trying to fuse information coming from other clusters. To achieve that, each node of the network keeps two parameters: the distance in hops to the sink and the aggregate distance, which is dened as the sum of the distances between the node and all the CHs. When a packet has to be routed, the following node in the route is the one on the shortest path to the sink; if there is more than one possibility, the node performing the routing sends the packet through the node that is closer to other CHs by selecting the one with lower aggregated distance. On the occurrence of an event, InFRA needs to ood the network with conguration packets to keep the aggregate distance updated for all the nodes in the network; turning the algorithm unscalable due to the high generated overhead. In contrast to SPT, InFRA builds dynamically its routes with the drawback that the generated overhead is linear to the number of nodes in the network. Figure 3.1(b) shows an example for routing in InFRA. The nodes are labeled with the distance in hops to the sink and the aggregated distance; the CHs are colored in green and the clusters are encircled. Thus, a node makes the routing by following its neighbor that is closer to the sink, in case of a tie, the break is done by choosing the node with lower aggregated distance. Notice that there is an improvement on the aggregation rate when compared with SPT.

3.3 Data Aggregation Aware Routing Protocol

The Data Aggregation Aware Routing Protocol, DAARP [32], is another cluster based approach, that is similar to InFRA. On the occurrence of an event, the detecting nodes are grouped into a cluster. The nodes chosen for being CHs are the ones closer, in hops, to the existing routing tree. If the detected event is the rst one, the criteria for the CH is to

(26)

CHAPTER 3. RELATED WORK 26 r 3 1 3 2 0 1 1 0 1 2 1 5 0 3 2 1 2 3 4 3 5 5 2 3 4 0 4 0 4 2 1 3 2 2 0 2 2 2 5 1 4 4 3 2 2 2 2 1 2 3 1 1 1 0 1 2

(a) A rst route setup by DAARP.

r 0 1 2 2 0 1 0 0 1 0 1 1 0 2 2 1 2 1 1 3 4 4 2 3 3 0 0 0 0 2 1 3 2 1 0 2 2 2 1 1 3 4 3 2 2 1 2 1 2 3 1 1 1 0 1 2

(b) The second route setup by DAARP de-pends on the rst one.

Figure 3.2: Routing example for DAARP. The sink is colored in red, the CHs are in green and the source nodes are in maroon; the labels are the distance of a node to the existing routing tree.

select the node closer to the sink. As in InFRA, the CHs are responsible for aggregating on its cluster but aggregation also happens outside the cluster.

For routing a packet, a node chooses the neighbor that is in the shortest path to the existing routing tree; if no routing tree exists, which happens only for the rst event, the neighbor that is in the shortest path to the sink is chosen. Each node in the network keeps the distance to the existing routing tree so the nodes know where they should route to. On the occurrence of an event, a new routing tree is built and the parameter of each node must be updated; so DAARP oods the network with conguration packets. Although the overhead is linear on the number of nodes of the network, it is not as expensive, as it is to keep the parameters of InFRA, resulting in a lower overhead.

A disadvantage on the design is that the routing tree highly depends on the order on which the events appear. DAARP's approach also builds a non-dynamic routing tree; so the rst event may build a routing tree that is disadvantageous for the following events.

Figure 3.2 shows an example for DAARP where the nodes are labeled with the distance to the existing routing tree. In Figure 3.2(a) a rst route is setup. For the next event, Figure 3.2(b), shows a route that uses the closest nodes to the existing routing tree. In addition, other nodes that are not part of the routing tree had its distance updated with the new routing tree.

3.4 Dynamic DAARP

The Dynamic Data Aggregation Aware Routing Protocol, DDAARP [33], in opposition to the previous algorithms, is a centralized approach. Initially, a conguration phase is performed, so a conguration message containing the distance in hops to the sink is broadcasted; at the end of the conguration phase, all the nodes know their distance to

(27)

CHAPTER 3. RELATED WORK 27

r

Figure 3.3: DDAARP routing example. The sink is colored in red, the CHs in green and the source nodes in maroon; the labels are the distance of a node to the existing routing tree.

the sink and know which neighbor they should choose to reach the sink.

Then, DDAARP organizes the nodes that detected an event in clusters; the node selected as CH is the one closer to the sink. After that, on the appearance of an event, the CH sends a packet to the sink requesting a route. The path used for the request of a route is the one obtained in the conguration phase. The moment the sink receives the route request, an algorithm to construct the routing tree is executed by the sink and reported to the network. The construction of the routing tree is done by choosing the path that introduces fewer Steiner nodes.

DDAARP improves DAARP by creating dynamic routes, as its name suggests, so it is independent of the order on which events take place. In addition, DDAARP does not ood the network with conguration messages, so it reduces the overhead, making the algorithm more scalable. A weak spot on DDAARP is that it requires a global knowledge of the network. Figure 3.3 presents an example for DDAARP. Note that in this case, adding the fewest Steiner nodes into the routing tree leads to a similar routing as in the example for DAARP.

3.5 Energy-Aware Routing Algorithm

Amgoth and Jana [3] present an algorithm, Energy-Aware Routing Algorithm (ERA), that considers the battery levels. The algorithm has two conguring stages before being able to operate.

First, ERA builds clusters based on the battery usage; in particular, each sensor has a timer in such a way that the ones with higher residual energy broadcast a conguration message earlier, setting them as CHs; in contrast, the nodes that receive a conguration message are congured as cluster members (CMs). It is possible that a node receives more than one conguration message from a CH, so the cluster membership is decided by choosing the CH that is closer and that has more energy than the average of the

(28)

CHAPTER 3. RELATED WORK 28

possible CHs.

After the CH selection procedure is nished, the sink broadcasts a conguration mes-sage that is processed only by the CHs containing information about the sender such as the energy, the position, and the distance in hops to sink. The CHs then replicate the conguration message with its own information to build the routing infrastructure. Note that the routing tree is only composed of CHs.

When an event happens, the source nodes send data to its CHs, which aggregates and routes the data trough the constructed routing tree. Each CH routes the packets through the neighbor CHs closer to sink, distributing the packets according to the remaining energy; that is, if a CH has more than one route to reach the sink, then it distributes the packets according to the rates of remaining energy of the neighbor CHs with more energy than the average, routing more packets through the CHs with more residual energy, balancing the energy usage.

ERA assumes that the communication radius is double the sensing radius and that all the target area is covered by the sensors; these assumptions guarantee that the maximum inter-cluster communication is, at most, triple the communication radius.

Figure 3.4(a) shows an example of routing for ERA. Note that this scheme establishes all the nodes of the networks either as CH or as CM. In addition, an important feature is that there is no single route for the packets; instead, the nodes having more than one neighbor that have the same distance in hops to the sink balance the packets according to the available energy on them.

3.6 HCCRFD

Guravaiah and Velusamy [15] present a multi-hop routing algorithm (HCCRFD) using the River Formation Dynamics (RFD) metaheuristic [27]. The approach is also based on clustering; at the initialization phase, the sink decides cluster membership by gathering information, specically positions, remaining energy and distance in hops, of the whole network, and randomly choosing 10% of the nodes as CHs between the ones that have residual energy greater than the average.

After that, the network is notied about the CHs, and the sink oods the network with conguration packets containing the IDs of the CHs; the remaining nodes decide its membership by joining the closest CH. Once each node of the network is congured either as CH or CM, the routing is carried out in two stages: intra-cluster routing and inter-cluster routing; the rst is done inside the inter-cluster, and the second one is done between the clusters. Both of them are multi-hop based in the RFD metaheuristic. When a node u has to transmit a packet, it assigns a probability to each of its neighbors v ∈ N(u), where N(u) denotes the neighbor nodes of u which are strictly closer to the sink in hops, and selects the node according to the assigned probability. The probability of being chosen for a neighbor node v of u is dened by

Pv =

Hv

P

(29)

CHAPTER 3. RELATED WORK 29

r

(a) Note that the packets are distributed ac-cording to the level of remaining energy of the nodes with lower distance in hops to the sink.

r

(b) The encircled nodes indicate where HCCRFD makes intra-cluster routing; while inter-cluster routing is performed only by CHs.

Figure 3.4: Routing example for ERA and HCCRFD. Green nodes are CHs, while gray nodes are CMs and maroon nodes are the source nodes.

with

Hv =

HCu− HCv

d(u, v) × REv

where HCuis the distance in hops from u to CH if it is an intra-cluster communication, or

to the sink if it is an inter-cluster communication; d(u, v) denotes the euclidean distance between nodes u and v; and REv is the remaining energy of node v. Each node is aware of

the necessary information for computing the above parameters thanks to the initialization phase.

The authors base their choice of only 10% of the nodes as CHs on a previous result by Heinzelman [16]. Nevertheless, that result was based on a 100 nodes network on which the nodes had the capability to reach the sink in one hop. For a multi-hop scenario such assumption does not guarantee connectivity between the CHs. In fact, in our experiments, when scaling the network that threshold has to be raised to a minimum of 20% to have connectivity on the routing tree formed by the CHs.

Figure 3.4(b) shows an example of routing for this algorithm. The nodes selected as CHs are colored in green. The nodes performing intra-cluster routing are encircled; then the inter-cluster routing is done by the CHs. On both cases, the routing is based using the RFD metaheuristic described above.

3.7 Continuous Enhancement Routing Solution

In an early stage of this work, we proposed the Continuous Enhancement Routing Solution (CER) [34] that is a centralized approach that uses a Genetic Algorithm for computing the routing tree. First, CER congures the network, exchanging messages so the sink has complete information about the network. Then, as events appear and disappear, the source nodes make requests for a routing tree to the sink. The sink computes, using a

(30)

CHAPTER 3. RELATED WORK 30

Genetic Algorithm, the routing trees in a continuous manner; that is, it keeps feeding the network with routing trees as long as it nds enhanced routing trees.

On large networks, the execution of the Genetic Algorithm can have a high computa-tional cost; therefore, it might not be suitable for applications demanding low latency. In addition, the generated number of routing trees is high, generating packets that congure the network unnecessarily, generating wasteful overhead. ICER, presented in the next chapter, is an extension of CER and overcomes these problems.

3.8 Summary

Table 3.1: Summary of the described algorithms

Name Routing

approach AggregationNodes Overhead Paradigm Drawback

SPT Tree Opportunistic Low Distributed Data redundancy

InFRA Tree-based cluster

CHs and intermediate nodes

Very High Distributed Very high over-head DAARP Tree-based cluster CHs and intermediate nodes

High Distributed Static routes. Event order pre-disposes routing for future events DDAARP Tree-based

cluster

CHs and intermediate nodes

Low Centralized Requires global network knowl-edge

ERA Tree-based

cluster

CHs Low Distributed Unbalanced use of

energy in the clus-ters

HCCRFD Tree-based cluster

CHs Low Centralized Does not

guaran-tee connectivity CER Tree-based Steiner Nodes Low Centralized Requires global

network knowl-edge

We remark that all the presented algorithms are multi-hop; some of them mainly based on data aggregation while other mainly based on energy eciency. To sum up this sec-tion, Table 3.1 presents a comparison of the described algorithms. The routing approach columns refers to the way routing is performed. Tree means that a routing tree is built and the routing is performed based on that, while "Tree-based cluster" are the approaches that rst construct clusters; and then the routing starts. The aggregation nodes column indicates which nodes are in charge of performing data aggregation. Opportunistic means that the algorithm makes aggregation whenever overlapping paths occur; CHs and inter-mediate nodes means that the aggregation is done by the cluster heads and any other

(31)

CHAPTER 3. RELATED WORK 31

node that might be in the path to the sink. Note that the design of these kinds of al-gorithms aims to achieve some level of aggregation, while the opportunistic ones do not. CHs means that aggregation is only performed by CHs. Algorithms in this category clas-sify all the nodes of the network either as CH or as CM, so when a source node starts its transmission, it rst routes to its CH and then the CH routes to the sink only through other CHs.

(32)

Chapter 4

Improved Continuous Enhancement

Routing Algorithm

This chapter presents the communication procedures and the centralized algorithm. ICER aims to nd near-optimal routing trees, thus maximizing data aggregation while using the nodes with the highest residual energy available. The owchart of the whole execution of ICER is shown in Figure 4.1. ICER begins conguring the network on the Conguration Phase, described in Section 4.1, which gathers the network conguration and sends it to the sink node; then, on the occurrence of an event, the source nodes make the Route Request to the sink, as described in Section 4.2; thereupon, on the reception of the request, the sink executes the Centralized Algorithm to compute a routing tree, as presented in Section 4.6. Next, when a routing tree is found, the sink congures the network with the new routing tree according to the Set Route, presented in Section 4.2. Following that, the Data Transmission begins as described in Section 4.3. Whenever an event ends, the Event Ending block, described in Section 4.4, makes the sink restart the Centralized Algorithm. Finally, when a battery changes its level, the Battery Usage and Depletion block, presented in Section 4.5 is executed and a new Route Request is performed.

4.1 Conguration Phase

In the Conguration phase, the sink node broadcasts the Initial Conguration Mes-sage (ICM), as shown in Line 1 of Algorithm 2, indicating the distance in hops and the next node that has to be followed to reach the sink. When a node receives an ICM, it veries whether its distance in hops to the sink is longer than the one contained by the message, which is shown in Line 3 of Algorithm 2. In such a case, the node updates its values with the ones indicated in the message; updates the ICM by increasing the distance in one and setting the next node to itself; and nally, broadcasts the updated ICM, as shown in Lines 48 of Algorithm 2. Otherwise, the node just drops the packet.

A border node is dened as a node that has no neighbors whose distance in hops to the sink is greater than his own. When all the nodes have received an ICM, the border nodes start broadcasting a Border Message (BM), which is a message that carries the adjacency list of the node that generated the message. When a BM is received, the receiving node

(33)

CHAPTER 4. ICER 33 Start Configuration Phase Event occurs? Request Route Sink executes Centralized Algorithm Set Route

Data Transmission Event Ending

Does the event end?

Does the battery level change?

Battery Usage and Depletion yes no no yes yes no

Figure 4.1: Flowchart of ICER.

veries if the BM is coming from a node that is in list of neighbors that have greater distance to the sink; Line 3 of Algorithm 3 shows this validation. In such a case, the receiving node stores the ID of the BM's sender (Line 4 of Algorithm 3) and veries if it has received a BM from all its neighbors with greater distance to the sink, in order to broadcast the BM (Line 5 and 6 of Algorithm 3); otherwise, it will wait for the remaining BMs to arrive.

(34)

CHAPTER 4. ICER 34

Algorithm 2 Initialization 1: Sink node broadcasts ICM

2: for u ∈ V do

3: if HopsToSink(u) > HopsToSink(ICM) then

4: HopsToSink (u) ← HopsToSink (ICM)

5: NextHop(u) ← SenderID (ICM)

6: HopsToSink (ICM) ← HopsToSink (ICM) + 1

7: SenderID (ICM) ← ID (u)

8: Node u Broadcasts ICM

9: end if

10: end for

Once the sink receives all the BMs from its neighbors, the sink is ready to accept requests for routing.

Algorithm 3 Border Feedback 1: Border nodes broadcast BM

2: for u ∈ V do

3: if NeighborHopBigger(u) ∈ SenderID(BM) then

4: RxNeighborHopBigger (u).add (SenderID (BM))

5: if RxNeighborHopBigger(u) == NeighborHopBigger(u) then

6: Broadcast BM

7: end if

8: end if

9: end for

4.2 Request/Set Route Phase

When an event occurs, the node that becomes aware of the event sends a Request Route Message (RRM) to the sink by using the next node parameter that was setup during the conguration phase. After a small time delay, the node starts sending the sensed data, so the sink has time to construct a routing tree. When the sink receives the RRM, it computes a route and sends a Set Route Message (SRM) to the nodes that are part of the route so that they update their next node parameter.

The SRM includes the tree ID parameter to handle multiple events, as explained in Section 4.3. When a node receives an SRM, it validates if the tree ID of the SRM is greater than its tree ID, as shown in Line 2 of Algorithm 4, so the parameters of the node are updated (Lines 35 of Algorithm 4) and the SRM is transmitted to the following node in the routing tree (Line 6 of Algorithm 4).

Algorithm 4 SetRoute

1: for u ∈ R do . Ris the set of nodes in the tree

2: if TreeID(SRM) > TreeID(u) then

3: HopsToSink (u) ← HopsToSink (SRM)

4: NextHop(u) ← SenderID (SRM)

5: TreeID (u) ← TreeID (SRM)

6: u.send (SRM) . to the next node in the tree

7: end if

(35)

CHAPTER 4. ICER 35

4.3 Data Transmission

The sink is in charge to compute the routing tree, and when it computes a better solution than the current one, the sink sends an SRM to the network. This is a key characteristic of the proposed algorithm and is the reason why it is called ICER.

Meanwhile, more than one event can be detected, so it may be possible that some RRMs are received at the sink while it is still processing the previous request. When an RRM arrives at the sink, the computing process at the sink is reset, including the new node that requested the route.

In addition, it is also possible that an SRM traveling in the network overrides a conguration on a node that has already been congured with a better route. To handle that occurrence, nodes store the routing tree ID and the SRM has the new tree ID it is aiming to set, then a node will only overwrite its routing table if the SRM's tree ID is greater than the one recorded on the node, which can be seen in Line 2 of Algorithm 4.

These three characteristics allow the routes to be changed according to the needs of the network, always improving the routing tree; hence, the routing trees generated by ICER are dynamic. Furthermore, the data collection is independent of the routing conguration, so the relay nodes always retransmit the data packets using the last congured routing tree. The data packets contain a eld for the used energy of the node; then, when they reach the sink, it knows the state of the battery usage of the nodes.

4.4 Event ending

When an event ends, the routing infrastructure no longer needs to consider the nodes that were reporting such an event. In fact, maintaining that same routing tree aects the overall performance of the network. For that reason, the node that was reporting the data from the culminated event sends Remove Message (RM) to the sink using the existing routing tree. Upon receiving the RM, the sink resets the algorithm by taking o the node that sent the message. After computing a routing tree, the sink sends an SRM to the corresponding nodes.

4.5 Battery Usage and Depletion

Eventually, after a certain time of network's activity, batteries of nodes start to deplete. The battery is discretized into a number of levels of the total battery's capacity, thus, a node starts its functioning on the rst level of the battery, and each time a node reaches the following level, it sends an RRM for the sink to recongure the network; this is done to homogenize the battery consumption between many nodes. When the last level is reached by a node, it sends a Dead Node Message (DNM) to the sink to report him as dead. On the reception of the message by the sink, it removes the dead node from the network, executes the centralized algorithm, and recongures the network. The reason why a threshold is set for the node to be marked as dead is to avoid loss of packets; that is, due to the time the network needs to get recongured, there may be packets being

(36)

CHAPTER 4. ICER 36

transferred through the old routing tree on the meantime, so the node's battery cannot be depleted to complete those transmissions.

In addition to mark the node as dead, the neighbor nodes that have their next node parameter pointing to the dead node have to be recongured, otherwise there would be loss of packets. The dead node broadcasts a message to its neighbors to know which of them are in the described situation, and it includes the list of nodes that have to be recongured in the DNM. Then, when the sink recongures the network, it also includes the list of reported nodes by the DNM.

4.6 Centralized algorithm

As stated in a previous chapter, an aggregation tree is equivalent to a Steiner Tree. Each time a node senses a new event, it requests a route to the sink; consequently, a new instance of the Steiner Tree must be solved and returned to the network. This also happens when an event ends and when a node changes its level of energy. Therefore, the problem must be solved several times to compute new routing trees each time any of the mentioned situations occur. When a request for a new routing tree reaches the sink, it knows, due to the Conguration Phase, the structure of the network, which is represented as a graph G, and the current state of the batteries due to the eld in the data packets described in Section 4.3.

Recall that on the Node-Weighted Steiner Tree problem is given a graph G = (V, E), a set of terminal nodes S ⊆ V and a root vertex r ∈ S, where each edge e ∈ E and each vertex v ∈ V have a non-negative associated cost ce and bv, respectively. The problem is

to nd a tree T ⊆ G of minimum cost (dened as the sum of the weights of the vertices and edges in T ) that connects S.

The Steiner Tree Problem considers the vertices as zero-weighted. In this section, routing tree and solution are used indistinctly to refer to T .

Each node in the network is represented by a vertex in G, and the connections between nodes are represented by an edge in G. To introduce the battery level of a node into the formulation of the problem, the cost of a vertex v is dened as bv/B, where bv is the

current level of battery usage of node v, and B = max{bv : v ∈ V }. In the energy

model, it is considered that either a node reaches another one, then the cost assigned to the corresponding edge is one; or not, then no edge is assigned. The number of edges in T are denoted as |T | and is called the routing tree size or just tree size. The objective function is dened as follows:

min T ⊆G    |T | + f X v∈V (T ) bv B    , (4.1)

where T is a tree that connects all the terminal nodes to the sink node r and f is a non-negative constant called balance factor. When the network begins its operation, the nodes have not spent energy at all; then, bv is zero for all the nodes, and the cost of T is

(37)

CHAPTER 4. ICER 37

of the routing tree increases. On the next request for a route, the new solution will have a cost greater than or equal to the previous solution because the battery consumption only increments. For small values of f, the size of the tree will have more impact than the batteries of the nodes in the tree. In fact, for f = 0, the objective function (4.1) ignores the battery usage. Often, small tree sizes have shorter delivery times than bigger ones. On the other hand, for greater values of f, the impact of the battery usage is increased in the objective function. Augmenting the impact of the battery usage makes the routing tree to use nodes with small battery usage, having a more homogeneous consumption of the batteries. Clearly, there is a trade-o between these two characteristics; for that reason, f is called the balance factor, because it allows balancing of the cost of the routing tree between the tree size and the battery usage. To evaluate the eect of considering the battery usage, the proposal is called ICER when f = 0 and Battery-Aware (BA-ICER) when f > 0.

The balance factor does not need to be the same along dierent executions, which gives the application more control over the algorithm. Applications that need small delivery times could maintain the balance factor in a range of small values, while applications that need greater lifetimes could have the factor in a range of greater values.

When the sink must compute a new routing tree, Algorithm 5 is executed. First, the reductions explained in Section 2.2.2 are executed, as shown in Line 1. Note that the reduced instance may have fewer edges and vertices than the original, but actually, the nodes in the reduced network are not dead; therefore, when the solution is returned to the network, the vertices and the edges are mapped back to the nodes and connections they initially represented.

Then, on Lines 3 to 6, for each terminal t ∈ S, the NWRSPH, presented in Sec-tion 2.2.3, is executed. The complexity of NWRSPH being called |S| times is O(|S| log |S| (|E| + |V | log |V |)). Afterwards, the decoder for the BRKGA is explained. The |S| solu-tions are classied by their objective value, on Line 7, and the best K ones are selected, codied, and introduced to one of the populations of the BRKGA, where K is the number of independent populations. Finally, the BRKGA returns T to the network as soon as it is found, and keeps feeding the network with routing trees as long as it nds improved solutions.

Algorithm 5 Centralized algorithm

1: Reductions(G) . Grepresents the network

2: S = ∅ . Sis the set of solutions for RSPH

3: for t ∈ S do . Sis the set of terminals

4: Sol =NWRSPH(t) . Solis the solution for this iteration

5: S = S ∪ {Sol}

6: end for

7: I ←best K solutions of S

8: while T ← BRKGA(I) obtains improved solutions do

9: Congure network with T

10: end while

Note that when the rst event occurs, the solution is the shortest path between the sink and the terminal node; when subsequent terminal nodes request for a routing tree, either because of a new event appeared or because it also perceived the same event, the sink calculates the shortest path between the requesting node and the existing routing

(38)

CHAPTER 4. ICER 38

tree and executes the NWRSPH; thereupon, the solutions are codied into chromosomes that are inserted in the rst generation of the BRKGA. In that way, the initial solution found by BRKGA is not much worse than the current solution; hence generating fewer set messages and making BRKGA converge faster.

4.6.1 Decoder

The decoder receives as input a chromosome and returns its tness value. Each chromo-some is an array of m random numbers in [0, 1], where m is the number of edges in the network. Each random key, an allele, represents an edge in the graph. For each chromo-some, a variation of the Kruskal's algorithm [19] is executed. Algorithm 6 presents the decoder. First, on Lines 24 for each vertex v ∈ V is called the Make-Set function, which creates a set containing only vertex v; after that, the random numbers assigned to each edge are sorted, on Line 5. Then, in a greedy fashion, the algorithm iterates over the sorted edges; for each edge {u, v}, Line 7 compares the representatives of u and v using the Find-Set function. If they are dierent, it means that vertices are in dierent sets; consequently, they have to be joined by calling the function Union and the edge {u, v} is added to the solution; otherwise, nothing is done. Since the execution of the algorithm results in a tree that connects all the vertices of the graph, and not only the terminals, all the vertices that are not present in any path from the sink to a terminal node are removed to avoid conguring unnecessary nodes. Therefore, the routing tree is pruned by calling the Prune function passing as the rst argument any terminal t, and True as the second argument. The tness value of the chromosome is the value of the objective function.

Algorithm 6 Decoder

1: T ← ∅ . T is the routing tree

2: for v ∈ V do

3: Make-Set(v)

4: end for

5: Sort(E) .by the corresponding allele in the chromosome C

6: for (u, v) ∈ E do

7: if Find-Set(u) != Find-Set(v) then

8: T ← T ∪ {(u, v)}

9: Union(u, v)

10: end if

11: end for

12: return Prune(t, T , true) .For any t ∈ S

The overall idea of Algorithm 7 is to recursively traverse all the paths starting from u, when a vertex v with no more remaining paths is found, i.e., it is the end of a path. The procedure only maintains the path if it is a terminal; otherwise, the path is discarded since such a path connects a non-terminal node. Variable c, on Line 2, saves the size of the solution; for each vertex v adjacent to u in T , the function Prune is called with v as its rst argument, which will return the size of the path, and the boolean variable hasT erminal0 is set to true if and only if the subpath starting in v contains a terminal.

At the notication of an event ending, the BRKGA removes the notifying node from the set of terminal nodes. The pruning erases the unneeded nodes from the solution.

Referências

Documentos relacionados

A categoria analítica de gênero vem sendo, por um lado, um instrumento de análise crítica aos pressupostos que informam os principais paradigmas da teoria social no sentido não

Alguns ensaios desse tipo de modelos têm sido tentados, tendo conduzido lentamente à compreensão das alterações mentais (ou psicológicas) experienciadas pelos doentes

The probability of attending school four our group of interest in this region increased by 6.5 percentage points after the expansion of the Bolsa Família program in 2007 and

No campo, os efeitos da seca e da privatiza- ção dos recursos recaíram principalmente sobre agricultores familiares, que mobilizaram as comunidades rurais organizadas e as agências

Para tanto foi realizada uma pesquisa descritiva, utilizando-se da pesquisa documental, na Secretaria Nacional de Esporte de Alto Rendimento do Ministério do Esporte

Os controlos à importação de géneros alimentícios de origem não animal abrangem vários aspetos da legislação em matéria de géneros alimentícios, nomeadamente