Constraint Programming for Wireless Sensor Networks

82
ACTA UNIVERSITATIS UPSALIENSIS UPPSALA 2015 Digital Comprehensive Summaries of Uppsala Dissertations from the Faculty of Science and Technology 1219 Constraint Programming for Wireless Sensor Networks FARSHID HASSANI BIJARBOONEH ISSN 1651-6214 ISBN 978-91-554-9144-4 urn:nbn:se:uu:diva-241378

Transcript of Constraint Programming for Wireless Sensor Networks

Page 1: Constraint Programming for Wireless Sensor Networks

ACTAUNIVERSITATIS

UPSALIENSISUPPSALA

2015

Digital Comprehensive Summaries of Uppsala Dissertationsfrom the Faculty of Science and Technology 1219

Constraint Programming forWireless Sensor Networks

FARSHID HASSANI BIJARBOONEH

ISSN 1651-6214ISBN 978-91-554-9144-4urn:nbn:se:uu:diva-241378

Page 2: Constraint Programming for Wireless Sensor Networks

Dissertation presented at Uppsala University to be publicly examined in 2446,Lägerhyddsvägen 2, Uppsala, Friday, 13 March 2015 at 13:00 for the degree of Doctor ofPhilosophy. The examination will be conducted in English. Faculty examiner: Dr. Ken Brown(University College Cork).

AbstractHassani Bijarbooneh, F. 2015. Constraint Programming for Wireless Sensor Networks.Digital Comprehensive Summaries of Uppsala Dissertations from the Faculty of Science andTechnology 1219. 80 pp. Uppsala: Acta Universitatis Upsaliensis. ISBN 978-91-554-9144-4.

In recent years, wireless sensor networks (WSNs) have grown rapidly and have had a substantialimpact in many applications. A WSN is a network that consists of interconnected autonomousnodes that monitor physical and environmental conditions, such as temperature, humidity,pollution, etc. If required, nodes in a WSN can perform actions to affect the environment.

WSNs present an interesting and challenging field of research due to the distributed natureof the network and the limited resources of the nodes. It is necessary for a node in a WSN to besmall to enable easy deployment in an environment and consume as little energy as possible toprolong its battery lifetime. There are many challenges in WSNs, such as programming a largenumber of nodes, designing communication protocols, achieving energy efficiency, respectinglimited bandwidth, and operating with limited memory. WSNs are further constrained due to thedeployment of the nodes in indoor and outdoor environments and obstacles in the environment.

In this dissertation, we study some of the fundamental optimisation problems related tothe programming, coverage, mobility, data collection, and data loss of WSNs, modelled asstandalone optimisation problems or as optimisation problems integrated with protocol design.Our proposed solution methods come from various fields of research including constraintprogramming, integer linear programming, heuristic-based algorithms, and data inferencetechniques.

Keywords: Constraint programming, wireless sensor networks, optimisation,macroprogramming, task mapping

Farshid Hassani Bijarbooneh, Department of Information Technology, Computing Science,Box 337, Uppsala University, SE-75105 Uppsala, Sweden.

© Farshid Hassani Bijarbooneh 2015

ISSN 1651-6214ISBN 978-91-554-9144-4urn:nbn:se:uu:diva-241378 (http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-241378)

Page 3: Constraint Programming for Wireless Sensor Networks

Dedicated to my family and all my great friends

Page 4: Constraint Programming for Wireless Sensor Networks
Page 5: Constraint Programming for Wireless Sensor Networks

Acknowledgements

I would like to express my special gratitude and thanks to my advisors JustinPearson, Prof. Pierre Flener, and Edith Ngai. You have been a tremendous helpand support for me throughout every step of my PhD. Under your supervision,I was constantly encouraged and pushed forward. Your advice and patiencewas crucial to my success.

I have had the privilege of collaborating with exceptional researchers dur-ing my PhD. My very special thanks go to my frequent co-authors AnimeshPathak and Wei Du, who not only have been a great help in my research, buthave also been excellent friends. It is a great honour knowing you and work-ing with you. Thank you Atis Elsts for bringing great meaning to my PhD byactually including my work in your macroprogramming platform and usingmy results in real-life sensor network projects. Additionally, I would like toexpress my special appreciation for my other co-authors, namely Prof. BengtJonsson, Valérie Issarny, Prof Xiaoming Fu, Prof. Jiangchuan Liu, Martin Ja-cobsson, and Konstantinos Sagonas. I am also grateful to Ken Brown and LuisQuesada for their excellent research directions and hospitality, when I visitedthe Cork Constraint Computation Centre, now called Insight Centre for DataAnalytics, at University College Cork, Ireland.

I would like to say many thanks to Roland Bol and Ivan Christoff for ac-cepting me to MSc studies at Uppsala University, which led to this PhD. Yourdecision brought me on a very long and joyful journey: without it, I would nothave been here today.

I had the special opportunity to see the ASTRA group on constraint pro-gramming grow larger with new PhD students and post-doc fellows throughoutmy PhD. I enjoyed working at the ASTRA group. Especially my appreciationgoes to Jun He, Joseph Scott, Maria Andreina Francisco Rodriguez, and Jean-Noël Monette, who always supported me with their thoughts and constructivediscussions, and have been great friends for me. I have also always lookedforward to your seminars with delicious cakes and cookies. Many thanks toProf. Christian Schulte, Guido Tack, Mats Carlsson for their discussions andmany constructive comments during my seminars and on my publications.

I would like to specially thank all members of my PhD parent project (Pro-FuN). Thank you for your constructive suggestions and discussions during theseminars.

I have made many wonderful friends during my PhD, friends who alwaysstood by my side and supported me. There are many names to mention andI wish I could name everyone here, but I believe you know who you are and

Page 6: Constraint Programming for Wireless Sensor Networks

you know how much I appreciate your precious friendship. Thank you somuch for being my friends and helping me to improve. There has been a verydifficult time during my PhD when my cat Niuniu had an extremely harshaccident. I must specifically thank Edith Ngai, Palle Raabjerg, Ryoko Asai,and Virginia Grande for visiting me and helping me to take care of Niuniu.I am so grateful to you.

My special thanks also go to Palle Raabjerg and Sofia Cassel for helpingme to translate my dissertation summary into Swedish.

Finally, I send many appreciation to my family for their love and supportthese many years throughout my PhD education.

Farshid Hassani Bijarbooneh

This research has been funded by the Swedish Foundation for Strategic Re-search (SSF) under research grant RIT08-0065 for the project ProFuN. TheAssociation for Constraint Programming (ACP) has provided financial sup-port for my attendance to the ACP summer schools 2010 and the doctoralprogram of the CP 2010, the 16th international conference on principles andpractice of constraint programming.

Page 7: Constraint Programming for Wireless Sensor Networks

List of Papers

This dissertation is based on the following papers, which are referred to in thetext by their Roman numerals.

I F. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Energy-efficienttask-mapping for data-driven sensor network macroprogramming usingconstraint programming. In R. Dell and K. Wood, editors, Proceedingsof ICS 2011, the 12th INFORMS Computing Society Conference, pages199–209. INFORMS Computing Society, 2011.

II F. H. Bijarbooneh, P. Flener, E. C.-H. Ngai, and J. Pearson. Anoptimisation-based approach for wireless sensor deployment in mobilesensing environments. In P. Duhamel and P. Lorenz, editors,Proceedings of WCNC 2012, the 10th IEEE Wireless Communicationsand Networking Conference, pages 2108–2112. IEEE CommunicationsSociety, 2012.

III F. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Optimisingquality of information in data collection for mobile sensor networks. InX. Gu and H. Wang, editors, Proceedings of IWQoS 2013, the 21stIEEE/ACM International Symposium on Quality of Service, pages163–172. IEEE Communications Society, 2013.

IV F. H. Bijarbooneh, A. Pathak, J. Pearson, V. Issarny, and B. Jonsson. Aconstraint programming approach for managing end-to-endrequirements in sensor network macroprogramming. In O. Postolacheand M. van Sinderen, editors, Proceedings of SensorNets 2014, the 3rdInternational Conference on Sensor Networks, pages 28–40.SciTePress, 2014.

V F. H. Bijarbooneh, W. Du, E. Ngai, and X. Fu. Energy-efficient sensorselection for data quality and load balancing in wireless sensornetworks. In J. Liu and X. Wang, editors, Proceedings of IWQoS 2014,the 22nd IEEE/ACM International Symposium on Quality of Service,pages 338–343. IEEE Communications Society, 2014.

Page 8: Constraint Programming for Wireless Sensor Networks

VI F. H. Bijarbooneh, W. Du, E. Ngai, X. Fu, and J. Liu. Cloud-assisteddata fusion and sensor selection for internet-of-things. In C. Lin, J. Liu,K. Ramakrishnan, and E. C.-H. Ngai, editors, IEEE Internet of Things,Special Issue on Cloud Computing for IoT. IEEE CommunicationsSociety, Submitted in December 2014.

Reprints were made with permission from the publishers. All papers are verba-tim copies of the original papers but are reformatted to the one-column formatof this dissertation.

Page 9: Constraint Programming for Wireless Sensor Networks

List of Papers Not Included

In addition to the papers that constitute this dissertation, I have co-authoredthe following papers. They are omitted from this dissertation as they areeither demo papers or an early version of a later conference paper.

VII F. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Energy-efficienttask-mapping for data-driven sensor network macroprogramming usingconstraint programming. In T. Mancini and J. Pearson, editors, ModRef2010, the 9th International Workshop on Constraint Modelling andReformulation, held at CP 2010, the 16th international conference onprinciples and practice of constraint programming., 2010. Availablefromhttp://uu.diva-portal.org/smash/record.jsf?pid=diva2:377275.

VIII F. H. Bijarbooneh and M. Jacobsson. Macroprogramming of wirelesssensor networks using task graphs and constraint solving. In SNCNW2012, the 8th Swedish National Computer Networking Workshop,2012. Available fromhttp://uu.diva-portal.org/smash/record.jsf?pid=diva2:571112.

IX A. Elsts, F. H. Bijarbooneh, M. Jacobsson, and K. Sagonas. Demoabstract: ProFuN TG: A tool using abstract task graphs to facilitate thedevelopment, deployment and maintenance of wireless sensor networkapplications. In EWSN 2015, the 12th European Conference onWireless Sensor Networks, Poster and Demo Session, Lecture Notes inComputer Science. Springer, 2015. Accepted in December 2014.

Page 10: Constraint Programming for Wireless Sensor Networks
Page 11: Constraint Programming for Wireless Sensor Networks

Comments on my Participation

Paper I: I am the principal author of this paper. I proposed the ideas, modelledthe problem, performed the experiments, and was the lead writer of the paper.My co-authors contributed to the discussions.

Paper II: I am the principal author of this paper. I proposed the ideas, mod-elled the problem, performed the experiments, and was the lead writer of thepaper. My co-authors contributed to the discussions, but Edith Ngai also con-tributed in writing the introduction and the related work section.

Paper III: I am the principal author of this paper. I proposed the ideas, mod-elled the problem, designed the algorithms, performed the experiments, andwas the lead writer of the paper. My co-authors contributed to the discussions,but Edith Ngai also contributed in writing the introduction.

Paper IV: I am the principal author of this paper. I proposed the ideas, mod-elled the problem, designed the algorithms, performed the experiments, andwas the lead writer of the paper. My co-authors contributed to the discussions,but Animesh Pathak also contributed in writing the introduction and back-ground.

Papers V and VI: I am the principal author of these papers. I proposed theideas, modelled the problem, designed the algorithms, performed the experi-ments, and was the lead writer of the paper. My co-author contributed to thediscussions. Wei Du also contributed the idea and design of the belief propa-gation algorithm in Matlab, as well as the design and idea of the greedy andrandom search algorithms in Matlab (I have developed the C++ versions of thegreedy and random algorithms).

Page 12: Constraint Programming for Wireless Sensor Networks

Sammanfattning på svenska

Nu för tiden är internet en oskiljaktig del av det dagliga livet. Internet an-vänds till många typer av kommunikation (t.ex. email, meddelandehantering,video, streaming och övervakning). Internet är bara tillgängligt om den under-liggande infrastrukturen, inklusive hårdvara och kommunikationsmedia, exis-terar. Infrastrukturen kan vara antingen trådbunden eller trådlös, och bör varaimplementerad i sensorområden för att möjliggöra kommunikation. Det finnsmånga områden där infrastrukturen inte finns än, eller där det är för kostsamtatt bygga upp den. Men det kan ändå hända att vi är intresserade av att stud-era några aspekter av dessa områden. Därför måste vi implementera ett annatkommunikationsparadigm som klarar av långsiktig kommunikation med min-imal fysisk tillgång till den utplacerade hårdvaran. Idag är sådan infrastruk-tur känt som ett trådlöst sensornätverk (eng. “wireless sensor network” ellerWSN).

Ett WSN är ett nätverk som består av många sammankopplade, självstyrandenoder som övervakar fysiska och miljömässiga förhållanden, såsom temper-atur, luftfuktighet, föroreningar, osv. Om det behövs kan noderna i ett WSNutföra åtgärder som påverkar deras omgivning. De kan kommunicera med an-dra noder samt utföra beräkningar. Noderna är ofta utrustade med sensorerför att kunna samla in uppgifter om omgivningen. Dessa uppgifter bearbetassedan lokalt eller överförs genom nätverket till en central plats, en s.k. bassta-tion (eng. “base station”), för vidare analys.

Trådlösa sensornätverk är ett intressant och utmanande forskningsområdepå grund av nätverkens distribuerade natur och nodernas begränsade resurser.En nod måste vara liten för att lätt kunna utplaceras i olika miljöer, och denmåste förbruka så lite energi som möjligt för att maximera batteriets livslängd.Det finns många utmanande aspekter av trådlösa sensornätverk, såsom pro-grammering av ett stort antal noder, design av kommunikationsprotokoll, ochenergieffektivitet, begränsad bandbredd och begränsad minne. WSNs är vi-dare begränsade av utplacering av sensornoder i olika inomhus- och utomhus-miljöer och hindrar i miljön.

I denna avhandling studerar vi några fundamentala optimeringsproblemsom relaterar till programmering, täckning, mobilitet, datainsamling och dataför-lust i trådlösa sensornätverk, modellerade som fristående optimeringsproblemeller integrerade med protokolldesign. Vår föreslagna lösningsmetod kommerfrån olika forskningsområden, inklusive villkorsprogrammering (eng. “con-straint programming”, CP), heltalsprogrammering (eng. “integer linear pro-gramming”, ILP), heuristikbaserade algoritmer, och tekniker för datainferens.Vi gör följande i denna avhandling:

Page 13: Constraint Programming for Wireless Sensor Networks

• Vi bidrar till task-mapping-problemet för trådlösa sensornätverk genomatt implementera vår modell som ett villkorsprogram (CP). Vår CP-modell uppnår minst en storleksordning uppsnabbning jämfört med ILP-modellen i [97] för realistiska instanser av verkliga tillämpningar.En förväntad effekt av detta arbete är att CP kan vara långt mer effektivtän ILP för att lösa problemet på ett optimalt vis när det finns routing-villkor.

• Vi presenterar en ILP-modell för utplacering av noder i en samverkandesensormiljö med både mobiltelefoner och stationära sensorer. Vi utvärderarresultaten mot slumpmässig och likformig utplacering. Vår modell upp-når optimala resultat inom korta beräkningstider för små och mellanstorasensornätverk, och uppnår nära optimala resultat för stora sensornätverk.En förväntad effekt av detta arbete är att det visar att täckningsproblemkan modelleras och lösas mycket effektivt med ILP.

• Vi presenterar en ny informationskvalitets-medveten (quality of infor-mation, QoI) datainsamlingsmetod som använder frivilliga mobilanvän-dare för att insamla data från omgivande sensorer. Vi formulerar opti-meringsproblemet och föreslår en girig algoritm för att maximera QoIper kommunikationsoverhead från insamlade data.En förväntad effekt av detta arbete är att det visar att det räcker meden god heuristikbaserad metod för ett NP-svårt problem med klustringav noder och datainsamlingsplanering. I vår lösning ligger det objektivavärdet nära det ILP-relaxerade problemets optimala objektiva värde.

• Vi formulerar task-mapping-problemet som uppkommer ur behovet atttillfredsställa end-to-end-villkor i WSN-makroprogrammering. Vi an-vänder en CP-formulering för att lösa problemet för paketfördröjningar.Vi utökar vår metod ytterligare för att hantera situationer där man villtillåta task-replicating för att förbättra latensprestanda.En förväntad effekt av detta arbete är att det är möjligt att använda CPför att lösa optimeringsproblem med obestämdhet, och det ger en metodför att garantera end-to-end-villkor för trådlösa sensornätverk.

• Vi presenterar en ny datainsamlingsmetod (kallad ASBP) som utnytt-jar högt korrelerade spatiotemporala data i nätverket och använder “be-lief propagation” (BP) för att rekonstruera data som förlorats genompaketförlust och strategin för att välja sensorer. Vi formulerar prob-lemet med optimering av aktiva sensorer, och föreslår två metoder föratt lösa det: villkorsprogrammering, respektive en heuristikbaserad girigalgoritm. Vi jämför våra resultat med state-of-the-art inom compressivesensing [71], och visar att vår metod genererar markant färre fel i predik-tion av data.En förväntad effekt av detta arbete är att det tillhandahåller ett protokollför WSNs som förbättrar dataprediktion med vår teknik för BP-inferens.

Page 14: Constraint Programming for Wireless Sensor Networks
Page 15: Constraint Programming for Wireless Sensor Networks

Contents

Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

Sammanfattning på svenska . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171.1 Research Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.2 Contributions and Expected Impacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.3 Outline of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2 Constraint Programming and Integer Linear Programming . . . . . . . . . . . . . . . . . . . 212.1 Decision Variables and Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.2 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.3 Model and Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.3.1 Constraint Satisfaction Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.3.2 Constrained Optimisation Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.3.3 Propagators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272.3.4 Systematic Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.3.5 Integer Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.3.6 CP and ILP Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3 Wireless Sensor Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.1 System Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

3.1.1 Sensor Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.1.2 Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363.1.3 Routing Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373.1.4 Comparison with Traditional Distributed Computing . . . 39

3.2 Application Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403.2.1 Node-Level Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403.2.2 Macroprogramming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4 Optimisation Challenges in Wireless Sensor Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 434.1 Optimal Sensor Deployment and Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434.2 Topology Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.3 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.4 Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5 Summary of the Papers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Page 16: Constraint Programming for Wireless Sensor Networks

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Appendix A: Additional Material for Paper I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Energy-Efficient Task-Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Appendix B: Additional Material for Paper II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70Abstract Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70The CP Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

The Search Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73Upper Bound on the Number of Deployed Sensors . . . . . . . . . . . . . . . . . . . . . 74

Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Appendix C: Background Material for Paper IV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Maximum and Minimum of Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Standard Normal Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

Page 17: Constraint Programming for Wireless Sensor Networks

1. Introduction

Nowadays, the internet is an inseparable part of our daily life. We use theinternet for many forms of communication (e.g., email, messaging, video andstreaming, monitoring). The internet is available only if the underlying infras-tructure, including the hardware and the medium for communication, exists.The infrastructure can be either wired or wireless and should be deployed inthe sensing field in order to communicate. There are many areas where in-frastructure is not built yet or is too costly to build. However, we might beinterested in measuring different parameters from these areas. Therefore, an-other paradigm of communication has to be implemented that can easily bedeployed and can further support long-term communication with minimumphysical access to the deployed hardware. Today, such infrastructure is knownas wireless sensor networks (WSNs).

A WSN is a network that consists of interconnected autonomous nodes(connection is either wired or wireless) that monitor physical and environ-mental conditions, such as temperature, humidity, pollution, etc. If required,nodes in a WSN can perform actions to affect the environment. The nodesin a WSN are capable of performing computations and communication. Thenodes are also equipped with sensors to be able to collect environmental data.These data are then processed locally or transmitted cooperatively through thenetwork to a main location, called a base station, for further analysis.

WSNs present an interesting and challenging field of research due to thedistributed nature of the network and the limited resources of the sensor nodes.It is necessary for a node in a WSN to be small to enable easy deployment inan environment and consume as little energy as possible to prolong its bat-tery lifetime. There are many challenges in WSNs, such as programming alarge number of sensor nodes, designing communication protocols, achievingenergy efficiency, respecting limited bandwidth, and operating with limitedmemory. WSNs are further constrained due to the deployment of the sensornodes in various indoor and outdoor environments and the obstacles in theenvironment.

In this dissertation, we study some of the fundamental optimisation prob-lems related to the programming, coverage, mobility, data collection, and dataloss of WSNs, modelled as standalone optimisation problems or as optimisa-tion problems integrated with protocol design. Our proposed solution methodscome from various fields of research including constraint programming (CP),integer linear programming (ILP), heuristic-based algorithms, and data infer-ence techniques.

17

Page 18: Constraint Programming for Wireless Sensor Networks

Structure of the chapter. We first introduce the challenges and researchquestions that we address throughout this dissertation (see Section 1.1), andwe then give the contributions made in this dissertation (see Section 1.2). Fi-nally, we express the outline of the rest of this dissertation (see Section 1.3).

1.1 Research QuestionsA wide variety of challenges need to be addressed in order to implement therequirements of WSN applications. These challenges can be categorised intothree classes, namely system, communication protocol, and service [5, 128]:

• The system challenge involves the programming and development ofnew platforms, operating systems, and storage schemes on sensor nodes.

• The communication protocol challenges involves enabling communica-tion between sensor nodes.

• The service challenge involves developing methods to enhance an appli-cation and improve the performance of the network.

These classes of challenges raise many questions and problems to be solvedin WSNs, where optimising a metric subject to constraints is the goal (e.g.,minimising energy consumption of sensor nodes given some communicationprotocols).

In this dissertation, we identify optimisation problems that arise while ad-dressing the challenges in the classes above, and we find a suitable optimisa-tion technique to solve those problems. The main research questions that weaddress in this dissertation are as follows:

Question 1. How can we facilitate and simplify the programming of WSNs?How do we map the tasks that are to be run by sensor nodes to different sensornodes in the network? How to we maximise the network lifetime by mappingthe tasks to the sensor nodes? How do we handle the routes and energy spentby routing the data to the sink?

Question 2. How can we guarantee some requirements on end-to-end commu-nication in WSNs (e.g., guarantee an end-to-end packet delivery delay withina given time limit)? How do we address uncertainty in optimisation problemsfor managing end-to-end requirements in WSNs?

Question 3. In an environment where mobile nodes are moving freely, howcan we satisfy a given coverage requirement by deploying stationary sensornodes? If yes, how can we minimise the number of deployed sensor nodes?What are the best locations to deploy stationary sensor nodes?

Question 4. In an environment where mobile nodes are moving freely tocollect data from stationary sensor nodes, how can we maintain quality of in-

18

Page 19: Constraint Programming for Wireless Sensor Networks

formation? If yes, how do we create clusters? How do we schedule the datacollection such that data with highest quality are collected earlier? how canwe maximise the data utility in such a system?

Question 5. If the data collected by the sensor nodes is spatio-temporally cor-related, then what is the best method for data collection to persevere the energyof the sensor nodes? Is it possible to predict accurately the missing data duringdata collection? How can we minimise the error of data loss prediction?

Questions 1 and 2 are addressing only system challenges, and questions 3,4, and 5 are addressing both communication protocol and service challengesin WSNs.

1.2 Contributions and Expected ImpactsConsidering the research questions mentioned in Section 1.1, we make thefollowing contributions in this dissertation:

• We contribute to the WSN task-mapping problem by implementing ourmodel as a constraint program (CP) and integer linear program (ILP).We consider routing constraints in our model including the energy spentby a sensor node for routing the data. Our CP model achieves at leastan order of magnitude speedup compared to the ILP model of [97] forrealistic instances of real-world applications. (Question 1 and Paper I)One expected impact of this paper is that in the presence of routingconstraints CP might be much more efficient in solving the problem tooptimality than ILP.

• We present an integer linear programming model for sensor deploymentin a collaborative sensing environment with both mobile phones and sta-tionary sensors. We evaluate the results against random and uniformdeployment. Our model achieves optimal results within a short compu-tation time for small and moderate-size networks, and it achieves nearoptimal results for large sensor networks. (Question 2 and Paper II)One expected impact of this paper is that it shows coverage problems aremodelled and solved very efficiently using ILP. Additionally, our solu-tion promotes collaboration between mobile phones and stationary sen-sors, which can improve the performance of traditional WSNs in manydifferent applications.

• We present a novel quality of information (QoI) aware data collectionscheme that utilises voluntary mobile users to collect data from their sur-rounding sensors. We formulate the optimisation problem and proposea greedy algorithm for maximising the QoI and minimising the commu-nication overhead for the data collection. (Question 3 and Paper III)One expected impact of this paper is that it shows that for an NP-hard

19

Page 20: Constraint Programming for Wireless Sensor Networks

problem of clustering the sensor nodes and scheduling data collection, agood heuristic-based approach is suitable, where the objective value ofour solution is close to the optimal objective value of the relaxed ILPproblem.

• We formulate the task-mapping problem arising from the need to satisfyend-to-end constraints in WSN macroprogramming, and we use a CPformulation to solve the problem for packet delays. We further extendthe approach to address situations where replication of tasks is allowedto improve latency performance. (Question 4 and Paper IV)One expected impact of this paper is that it is possible to use CP tosolve optimisation problems with uncertainty, and it provides a methodfor guaranteeing end-to-end requirements for WSNs.

• We present a novel data collection scheme (called ASBP) that utiliseshighly correlated spatio-temporal data in the network and uses beliefpropagation (BP) to reconstruct the data missing due to packet lossesand the sensor selection strategy. We formulate the active sensor selec-tion optimisation problem, and propose two approaches, namely con-straint programming and a heuristic-based greedy algorithm to solve theproblem. We compare our results with the state of the art compressivesensing [71] technique, and we show that our approach achieves a signif-icantly lower error in data prediction. (Question 5 and Papers V and VI)One expected impact of this paper is that it provides a protocol forWSNs that improves data prediction using our BP inference technique.Additionally, our techniques can be applied for generic sensor networkapplications to improve the data quality and reduce communication over-head.

1.3 Outline of the ThesisThe rest of this dissertation is organised as following:

• Chapter 2 gives the necessary background material on CP for being ableto read Papers I to VI.

• Chapter 3 gives the necessary background material on wireless sensornetworks (WSNs) for being able to read Papers I to VI.

• Chapter 4 gives a brief summary on optimisation problems in WSNs andrelated works.

• Chapter 5 gives a summary and the contributions of Papers I to VI.• Chapter 6 concludes this dissertation.• Appendices A, B, and C give additional and background material on

Papers I, II, and IV.

20

Page 21: Constraint Programming for Wireless Sensor Networks

2. Constraint Programming and Integer LinearProgramming

We briefly introduce the fields of constraint programming and integer linearprogramming. This introduction provides the necessary background for thereader to study Papers I to VI.

Constraint programming (CP, e.g., see [8]) is a technology to model andsolve combinatorial problems. Combinatorics is a branch of mathematicsstudying the enumeration, combination, and permutation of sets of elementsand the mathematical relations that characterise their properties [4,121]. Com-binatorial problems arise in many areas of computer science and applicationdomains, such as scheduling, routing, resource allocation, and configuration.

Using CP, a combinatorial problem is modelled and described by deci-sion variables (Section 2.1) and constraints (Section 2.2). The advantage andbeauty of CP is that constraints are written in a high-level declarative lan-guage, meaning that we only need to express what the constraints are, ratherthan how they operate. CP also makes a clear distinction between the modeland the search procedure (Section 2.3), in that the model does not need tochange in order to solve the problem with a different search strategy. Thereare commonly two approaches to search in CP, namely systematic search andlocal search. This dissertation only deals with solving CP problems using sys-tematic search.

In this dissertation, in addition to using CP we also solve combinatorialproblems using greedy algorithms and integer linear programming. A greedyalgorithm is an algorithm that iteratively selects a locally optimal choice givena heuristic. Greedy algorithms may fail to find a solution or may fail to find thebest solution to the problem but they are often computationally less expensivecompared to other approaches [38]. Similar to CP, integer linear program-ming (ILP) is a technology for modelling and solving combinatorial problems.However, in ILP the relationship between variables and the objective functionis expressed using only linear constraints [87].

Structure of the chapter. We first introduce the concepts of variables anddomains in CP (Section 2.1), and we then describe the modelling aspect of CPusing constraints (Section 2.2). Finally, we express how model and search arebundled together in order to solve a CP problem (Section 2.3).

21

Page 22: Constraint Programming for Wireless Sensor Networks

2.1 Decision Variables and DomainsThe decision variables, or simply variables, in a combinatorial problem de-note unknown values that need to be determined in order to solve the problem.Variables can have different types (e.g., integer, float, Boolean, set, etc). Themost commonly used types in CP are the integer, Boolean, and set types. Thefloat variable type is more common in linear programming, since the simplexmethod used to solve these problems is more tailored toward rational num-bers [87].

Each variable can take a value within a finite set of values, which is calledthe domain of the variable. Solving a combinatorial problem requires findingsuitable values in the domains of the variables such that some relationshipsbetween variables hold.

In a CP model, the domain of the variable x is denoted with D(x) and is afinite set of values. A variable is called assigned if its domain is a singleton,and undecided if its domain contains more than one value. A variable x as-signed the value d is written as x �→ d. For a given set of variables, we have anassignment if every variable in the set is assigned. An assignment a on a setof n variables is denoted by:

a = {x1 �→ d1,x2 �→ d2, . . . ,xn �→ dn}or

a(x1) = d1,a(x2) = d2, . . . ,a(xn) = dn

2.2 ConstraintsA constraint expresses a relation on one or more variables, and the relationspecifies the valid combinations of values for the variables.

A constraint C is denoted by a pair 〈X ,R〉 where X = 〈x1,x2, . . . ,xn〉 is thetuple of all variables involved in C, and R is a relation on the variables X . SetR is a subset of the Cartesian product of the domain of all variables involvedin C: R ⊆ D(x1)×D(x2)×·· ·×D(xn).

An assignment a on the variables 〈x1,x2, . . . ,xn〉 of constraint C is called asolution if and only if it satisfies the relationship R specified by C:

〈a(x1),a(x2), . . . ,a(xn)〉 ∈ R

and we say solution a belongs to constraint C (written as a |=C).For example, for the constraint C = 〈{x,y},x < y〉 where x,y ∈ {1, . . . ,5},

the assignment a = {x �→ 2,y �→ 5} is a solution, since we have 2 < 5.A store s is a function mapping variables to their current domains. A store

s is a solution store to a constraint C if and only if all domains have singlevalues constituting a solution to C. For example, let the variables x1 and x2have the domains {1, . . . ,5}. Let SX ,D denote the set of all possible stores on

22

Page 23: Constraint Programming for Wireless Sensor Networks

the variables X = {x1,x2} with domains being subsets of D = {1, . . . ,5}, thatis SX ,D is the set of stores from X to 2D. We have s = {x1 �→ {2,4},x2 �→{2,3,5}} is one store on variables X , because s ∈ SX ,D.

Store s1 is stronger than store s2, denoted by s1 � s2, if s1(x) ⊆ s2(x) forall variables x ∈ X , and store s1 is strictly stronger than store s2, denoted bys1 ≺ s2, if s1(x)⊆ s2(x) for all variables x ∈ X and there exists a variable y ∈ Xwith s1(y) � s2(y). For example, store s1 = {x1 �→ {2,4},x2 �→ {2,3,5}} isstronger (also strictly stronger) than store s2 = {x1 �→ {2,4,5},x2 �→ {2,3,5}}(that is s1 � s2 and s1 ≺ s2), because s1(x1) = {2,4} ⊂ {2,4,5} = s2(x1) ands1(x2) = {2,3,5} ⊆ {2,3,5}= s2(x2).

Constraint C is satisfiable if at least one solution to C exists, otherwise it isunsatisfiable.

Example 1. The ALLDIFFERENT constraint is a commonly used constraint inCP. The constraint ALLDIFFERENT enforces that variables X = 〈x1,x2, . . . ,xn〉are taking pairwise different values, with relation:

{〈x1,x2, . . . ,xn〉 | ∀i : xi ∈ D(xi)∧∀ j = i : xi = x j}Given three variables x,y,z with D(x) = D(y) = D(z) = {1,2,3}, there are sixsolutions to the constraint ALLDIFFERENT(x,y,z):

{〈1,2,3〉,〈1,3,2〉,〈2,1,3〉,〈2,3,1〉,〈3,1,2〉,〈3,2,1〉}where 〈1,2,3〉 represents the assignment {x �→ 1,y �→ 2,z �→ 3}. If instead wehad D(x) = D(y) = D(z) = {1,2} then the constraint ALLDIFFERENT(x,y,z)would not be satisfiable.

Example 2. The EXTENSIONAL constraint [99], also known as the user-defined or ad-hoc constraint, is used often in this dissertation. Extensionalconstraints provide a way to specify all solutions to the constraint, using ei-ther a deterministic finite automaton or a tuple set (TABLE constraint). A tupleset is a set containing tuples in the form 〈t1, t2, . . . , tn〉, where each tuple is asolution to the constraint. The tuple set variation of the EXTENSIONAL con-straint on the array X of n variables is defined by:

TABLE(X ,T )

where

T = {〈x11,x

12, . . . ,x

1n〉,〈x2

1,x22, . . . ,x

2n〉, . . . ,〈xr

1,xr2, . . . ,x

rn〉} (2.1)

The tuple set T in (2.1) expresses r valid combinations of values for the vari-ables in array X .

Let D(x) = D(y) = D(z) = {1,2,3}, then the ALLDIFFERENT constraintin Example 1 can also be expressed using a TABLE constraint:

TABLE({x,y,z},{〈1,2,3〉,〈1,3,2〉,〈2,1,3〉,〈2,3,1〉,〈3,1,2〉,〈3,2,1〉})

23

Page 24: Constraint Programming for Wireless Sensor Networks

The constraints mentioned in Examples 1 and 2 are called global con-straints. A global constraint captures a relation between an arbitrary numberof variables (see chapter 6 of [105]). Global constraints are a key part to CPeffectiveness, in that they provide a way to express declaratively many compli-cated non-linear relations on variables. Also, global constraints facilitate thework of the constraint solver (further explained in Section 2.3.6) by providinga better view of the structure of the problem.

In integer linear programming, the only available constraints are linear con-straints, defined in the form of:

|X |∑i=1

ai · xi ∼ b

where ai is a constant coefficient of the variable xi, b is a constant, and ∼ isthe equality or inequality relation [87].

2.3 Model and SearchThe central idea of constraint programming is that the modeller defines thecombinatorial problem in terms of variables and their domains, and the re-lationships between the variables in terms of constraints. The variables andconstraints form the model in CP, which abstracts the details of constraintsolving from the modeller. The model is then given to a constraint solverin conjunction with an optional search strategy, which is either predefined forthe constraint solver or custom defined.

The model and search in a constraint solver can address two kinds of combi-natorial problems, namely constraint satisfaction problems (see Section 2.3.1)and constrained optimisation problems (see Section 2.3.2). We further explaina propagator, which implements a constraint in a CP solver (see Section 2.3.3).The process of finding a solution to a CP problem using systematic search isexplained in Section 2.3.4. A summary of ILP is given in Section 2.3.5, and asummary of different CP and ILP solvers is introduced in Section 2.3.6.

2.3.1 Constraint Satisfaction ProblemsGiven a set of variables and constraints, the goal of a constraint satisfactionproblem (CSP) is to find a solution that satisfies all the constraints. For aCSP there are three possible goals: (1) finding one solution, (2) finding allsolutions, and (3) showing that no solution exists. One of these goals is desireddepending on the nature of the combinatorial problem.

Formally, a CSP is defined as a triple 〈X ,D,C〉, where X = 〈x1,x2, . . . ,xn〉is a finite n-tuple of variables, D is the domain of the variables X , and C isa finite set of constraints on X . In a CSP, constraint Ci is denoted with the

24

Page 25: Constraint Programming for Wireless Sensor Networks

8 0Z0L0Z0Z7 Z0Z0Z0L06 0ZQZ0Z0Z5 Z0Z0Z0ZQ4 0L0Z0Z0Z3 Z0Z0L0Z02 QZ0Z0Z0Z1 Z0Z0ZQZ0

1 2 3 4 5 6 7 8

Figure 2.1. The solution X = 〈6,1,5,2,8,3,7,4〉 to the 8-queens problem.

tuple 〈Vi,Ri〉, where Vi is a subset of all variables (Vi ⊆ X), and Ri is a relationon the variables Vi. The assignment a is a solution to the CSP if and only if∀i : a(xi) ∈ D(xi) and it belongs to all constraints C of the CSP (∀i : a |=Ci).

Example 3. The n-queens problem is a generalisation of the 8-queens prob-lem. The German chess player Max Bezzel published the 8-queens puzzle in1848 [16]. In n-queens (n ≥ 4) the queens are to be placed on an n×n chess-board such that no queen attacks other queens (no two queens are on the samerow, column, or diagonal). To model the n-queens problem using a CSP, wefirst define our set of variables and their domains.

Decision variables. Let X = 〈x1,x2, . . . ,xn〉 be the variables, where xi = jrepresents that the queen of row i is placed at column j.

Domains. Due to our choice of the variables X , a queen can be placed atany column from 1 to n. Hence, ∀i : D(xi) = {1, . . . ,n}.

Constraints. The constraints should enforce that no queens can be placedin the same column and diagonal. The requirement that no two queens canbe placed in the same row is achieved for free by the choice of the variables.Therefore, the constraints are:

C1 : ALLDIFFERENT(x1,x2, . . . ,xn)C2 : ALLDIFFERENT(x1 −1,x2 −1, . . . ,xn −n)C3 : ALLDIFFERENT(x1 +1,x2 +1, . . . ,xn +n)

where constraint C1 enforces that no two queens should be placed on the samecolumn, and constraints C2,C3 enforce that no two queens should be placed onthe same diagonal from north-east to south-west and from north-west to south-east respectively. Figure 2.1 shows a solution to the 8-queens problem.

25

Page 26: Constraint Programming for Wireless Sensor Networks

0

0

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

10

10

11

11

12

12

13

13

14

14

8

7

6

2

53

4

1

Figure 2.2. The minimal solution with s = 15, X = 〈11,8,7,7,10,9,0,0〉, andY = 〈11,6,8,11,6,0,8,0〉, to the square packing problem of size n = 8.

2.3.2 Constrained Optimisation ProblemsGiven a set of variables and constraints, the goal of a constrained optimisa-tion problem (COP) is to find a solution that satisfies all the constraints andmaximises (or minimises) an objective function. An objective function is anexpression defined on the variables of the problem that should be either max-imised or minimised.

Formally, a COP is defined as a quadruple 〈X ,D,C,O〉, where, similarto a CSP, X = 〈x1,x2, . . . ,xn〉 is a finite tuple of variables with D(xi) de-noting the domain of the variable xi, C is a finite set of constraints on X ,and O is the objective function. An objective function O is defined as O :D(x1)× D(x2)× ·· · × D(xn) → R that assigns a value to each assignmentof values to the variables. An optimal solution to a minimisation COP is asolution d that minimises the value of O(d(x1),d(x2), . . . ,d(xn)). Note thatwithout loss of generality the objective function is here always minimised, asa maximisation COP can be modelled by minimising the negative value of theobjective function −O.

Example 4. The square packing problem involves packing all squares withsizes 1× 1 to n× n into a smallest enclosing square of size s× s, such thatno two squares overlap [111]. This problem is a variation of many real-worldproblems [82,107]. Figure 2.2 shows a minimal solution to the square packingproblem of size n = 8 with s = 15.

Decision variables. The variables are the arrays X and Y of coordinatesof the lower-left corners of the squares, and the side size s of the enclosing

26

Page 27: Constraint Programming for Wireless Sensor Networks

square, where:X = 〈x1,x2, . . . ,xn〉Y = 〈y1,y2, . . . ,yn〉

where xi,yi represent the coordinates of the lower-left corners of the square ofsize i× i.

Domains. A naive upper bound on the size s of the enclosing square can beobtained if all squares are aligned. The size of the enclosing square is then thesum of all square side sizes:

max(D(s)) = 1+2+ · · ·+n =n · (n+1)

2

Therefore, the domain of the variables xi,yi, and s is the range {0, . . . , n·(n+1)2 }.

Constraints. There are two types of constraints for this problem: place-ment constraints and non-overlapping constraints. The placement constraintsenforce that squares are placed within the enclosing square:

∀i ∈ {1, . . . ,n} : xi + i ≤ s ∧ yi + i ≤ s

Using the geometrical packing constraint NOOVERLAP (also known as DIFFN) [14],we can enforce the no-overlapping constraints on the squares:

NOOVERLAP(X ,w,Y,h)

where w and h are arrays of known widths and heights of the items. In thiscase, the items are squares and ∀i ∈ {1, . . . ,n} : w(i) = h(i) = i.

Objective function. The objective in this problem is to minimise the valueof the variable s.

2.3.3 PropagatorsSolving a CSP or COP only through search is very costly (the search spacecomplexity is exponential in the number of available choices on the domainof the variables [40]). To reduce potentially the size of the search space, weperform an inference step called propagation at every node of the search tree.The purpose of propagation is to shrink the domains of the variables as muchas possible by removing inconsistent values with regard to the constraints inthe model. Propagation is performed by propagators, which are algorithmspre-implemented in a CP solver. A propagator enforces a level of consistencyfor the constraint it implements by removing inconsistent values from the do-mains of its variables.

Levels of consistency. The size of the search space is directly related to thedomain sizes of the variables. Propagators help reducing the size of the searchspace by shrinking the domains of the variables as much as possible. How-ever, propagators are running several times during the search, and thus they

27

Page 28: Constraint Programming for Wireless Sensor Networks

impose computation cost throughout the search. Therefore, there is a trade-offbetween how effectively a propagator removes inconsistent values from thedomain of its variables versus the propagator computation complexity. As aresult, propagators are implemented to achieve different levels of consistencywhen removing inconsistent values from the domains of variables [8]. Eachlevel of consistency requires different computation cost, which is choosablewhen the modeller uses a constraint in the model. Three of the most commonlevels of consistency are:

Value consistency. Also known as forward-checking consistency, it has thelowest computation complexity. Whenever a variable is assigned a value, thepropagator removes any inconsistent values from the domains of the remainingvariables according to the constraint it implements.

Bound consistency. Also known as interval consistency, it has a moder-ate computation complexity. A propagator maintains a bound-consistent con-straint store for a constraint c if and only if for every variable x and the lowerbound and upper bound of the domain of x, there exist values in the domains ofthe other variables such that all these values form a solution to the constraintc. This level of consistency is called bound(D) consistency.

Domain consistency. Also known as generalised arc consistency, it has thehighest computation complexity. A propagator maintains a domain-consistentstore for a constraint c if and only if for every variable x and every value in thedomain of x, there exist values in the domains of the other variables such thatall these values form a solution to the constraint c.

A propagator is a function operating on stores, and achieves a level of con-sistency on the domains of the variables involved in the constraint it imple-ments. Propagators must have the following properties:

• Contracting. Propagators must be contracting, meaning that they canremove values from domains, but can never add values.

• Correctness. Propagators can never remove a solution for the constraintthey implement.

• Checking. Propagators must be able to distinguish solutions from non-solutions.

Formally, a propagator p ∈ S → S for a constraint C is a function from storesto stores which is:

1. Contracting: A propagator results only in stronger stores, though notnecessarily strictly stronger ones. For all s ∈ S : p(s)� s.

2. Monotonic: Strength-ordered stores remain ordered. For all s1,s2 ∈ S, ifs1 � s2 then p(s1)� p(s2).

3. Solution identification: For a solution to a constraint C, no domain isshrunk: p(s) = s, for any solution store s to C. For a non-solution to C,some domain becomes empty and the propagator fails.

Together, these requirements guarantee the correctness and checking proper-ties of a propagator [109]. Propagators alone usually cannot solve a combina-

28

Page 29: Constraint Programming for Wireless Sensor Networks

0 ≤ X < 3

3 ≤ X < 6

6 ≤ X

Figure 2.3. Root node and three alternative branches created on the variable X .

torial problem, and they must be called by a search procedure, which exploresa search tree by branching and backtracking.

2.3.4 Systematic SearchSystematic search is a process to find a solution (or solutions) to a CSP orCOP: it consists of branching and exploration. A brancher specifies the shapeof the search tree, and exploration defines how to to traverse the tree. Forexample, depth-first search and branch-and-bound (best-solution) search aretwo of the most common CP methods of systematic search used in solvingCSPs and COPs respectively.

In a search tree, each node represents a partial solution, and the edgesbetween the nodes represent transformations from one state to another [78].The aim of a brancher is to define these transformations between nodes in thesearch tree and order them in such a way that the exploration strategy visitsnodes where the store of the variables is more likely to contain a solution. Thebrancher achieves this by first selecting a variable (or a subset of the variables)according to a heuristic, called variable ordering, and then enforcing con-straints on the selected variables per branch, according to a heuristic, calledvalue ordering.

At each node in the search tree, the brancher creates two or more branches(also called alternatives, or guesses, or decisions). Figure 2.3 shows the rootnode and three alternative branches created on the variable X . Branching mustmaintain the following conditions on the store:

• Contracting. The resulting store at each branch is strictly stronger thanthe store before branching.

• Non-overlapping. The intersection of the stores for all the branches atone node in the search tree is empty. Non-overlapping implies that nosolution can be found twice in the search tree. Figure 2.3 shows threealternatives such that no two alternatives are overlapping.

• Completeness. The union of the domains of the selected variables on allalternatives is equal to the domains of the variables before the branching.Completeness implies that no solution is lost during search.

29

Page 30: Constraint Programming for Wireless Sensor Networks

Algorithm 1: First-fail branching heuristic with minimum-value choice1 First-fail (X ,D,C)2 if ∃x ∈ X : |D(x)|> 1 then

3 select random x such that

4 |D(x)|> 1 and |D(x)| is smallest

5 return 〈{px=min(D(x))},{px =min(D(x))}〉6 else

7 return 〈〉

The variable and value orderings are essential parts of CP search procedures,and it is necessary to choose good such heuristics in order to solve a problemefficiently. Constraint solvers provide many predefined variable and value or-derings. One of the most common variable orderings in CP is called first-fail.A first-fail brancher chooses a variable with the smallest domain size. Algo-rithm 1 lists a first-fail brancher with minimum-value choice. The first-failbrancher operates if there exists at least one unassigned variable (line 2), andit randomly selects one variable x with the minimum domain size (lines 3 and4), and then it returns two propagators representing the two choices for theleft and right branches (line 5). The left branch constrains x to be equal to theminimum of its former domain. The right branch constrains x to be not equalto that minimum. If there is no unassigned variable left, then the brancher re-turns the empty tuple of alternatives (line 7), indicating that we are either at asolution node (the assignment store at this node constitutes a solution) or at afailed node (some variable in the assignment store has an empty domain, andat least one propagator is failed at this node).

Branch-and-bound is an exploration strategy that is used for solving COPs.Algorithm 2 shows how branch-and-bound operates. In branch-and-bounda variable (here called obj) denotes the value of the objective function Ogiven the variables X = 〈x1,x2, . . . ,xn〉. The algorithm iteratively calls depth-first-search (DFS) to return a new solution store s to the underlying CSPand continues until there is no new solution found (line 2). If the valueof the objective function O for the newly found solution s is less than obj(line 3), then the new solution store s is stored in sol (line 4), and a new con-straint is added to the model that enforces the variable obj to be smaller thanO(s(x1),s(x2), . . . ,s(xn)) (line 5). This ensures that only those branches in thesearch space that can potentially improve the value of the objective functionare visited. If the solution store s is not a failed store (at least one solutionis found, line 6) the algorithm returns the best solution sol that minimises theobjective function O, and otherwise it returns the failed store s.

30

Page 31: Constraint Programming for Wireless Sensor Networks

Algorithm 2: Branch-and-bound exploration strategy for a minimisationCOP

1 Branch-and-bound (X ,D,C,O)Precondition: X = 〈x1,x2, . . . ,xn,obj〉 and C contains

O(x1,x2, . . . ,xn) = obj2 while s ← DFS(X,D,C) do

3 if O(s(x1),s(x2), . . . ,s(xn))< obj then

4 sol ← s5 C ←C∪{obj < O(s(x1),s(x2), . . . ,s(xn))}6 if s is not a failed store then

7 return sol

8 else

9 return failed store s

2.3.5 Integer Linear ProgrammingILP is a technique for solving optimisation problems with a linear objectivefunction, subject to linear equality and linear inequality constraints, in whichsome or all of the variables are restricted to be integers. An ILP problem incanonical form with only integer variables is expressed as [87, 88]:

Maximisen

∑i=1

ci · xi

Subject ton

∑i=1

ai, j · xi ≤ bi ∀ j,1 ≤ j ≤ n

xi ≥ 0, ∀i,1 ≤ i ≤ nxi ∈ Z

(2.2)

where the ai, j,bi,ci are constants and the xi are non-negative integer variables.An ILP problem, referred to as a primal problem, can be converted into a

dual problem. The dual form of the canonical ILP problem (2.2) is expressedas:

Minimisen

∑i=1

bi · yi

Subject ton

∑i=1

ai, j · yi ≥ ci ∀ j,1 ≤ j ≤ n

yi ≥ 0, ∀i,1 ≤ i ≤ nyi ∈ Z

The dual form of an ILP problem provides an upper bound to the optimalvalue of the primal problem. According to the strong duality theorem [87,88],if the primal problem has an optimal solution x = 〈x1,x2, . . . ,xn〉, then the dual

31

Page 32: Constraint Programming for Wireless Sensor Networks

problem also has an optimal solution y = 〈y1,y2, . . . ,yn〉, and:

n

∑i=1

ci · xi =n

∑i=1

bi · yi

The simplex method and interior-point method are the two main approachesfor solving integer linear programs. The interior-point method solves linearprograms with continuous variables in polynomial time. However, a linearprogram with integer variables (ILP) is known to be NP-hard [87, 88].

2.3.6 CP and ILP SolversA constraint solver is a toolkit for modelling and solving constraint problems.A CP solver provides a methodology for developers to specify the model andsearch parts of a CSP or COP. In the model, developers can use a declarativeway to specify the constraints, which are implemented by the solver. In thesearch, developers can describe the search heuristics (variable and value order-ing). A CP solver often provides methods for extending the solver by definingnew constraints and exploration strategies.

An ILP solver provides tools for modelling and solving constraint problemswith only linear objective function and constraints. In this dissertation, weused the following CP and ILP solvers:

• CP solvers. We used the Gecode solver, which provides a CP solverwith state-of-the-art performance while being modular and extensible [55].

• ILP solvers. We used several ILP solvers, namely Gurobi [59], SCIP [3],CPLEX [64], and lp_solve [15]. Gurobi and CPLEX are the state-of-the-art ILP solvers, while lp_solve was used to compare our results in Paper Iwith Pathak et al. [97].

32

Page 33: Constraint Programming for Wireless Sensor Networks

3. Wireless Sensor Networks

We live in an age of information and communication, and we process a largeamount of information daily, which is mostly communicated over the internet.There are generally two forms of electronic communication, namely wiredand wireless communication. Wireless communication1 comes with manystandards, such as 3G [72], 4G [86], WiFi (which itself comes with manystandards, such as IEEE 802.11 a/b/g/n), etc. There are many devices capableof performing wireless communication. However, there is a class of wirelessdevices called sensor nodes, which is very unique, in the sense that sensornodes are very small in size and are equipped with sensing capabilities. Sen-sor nodes are often battery powered, and operate on very low power to achievea very long lifetime.

Wireless sensor networks (WSNs) are distributed networks that consist ofa large number of sensor nodes capable of sensing habitat and environmentaldata, processing data, and communicating with each other [7].

The significance of WNSs comes from the fact that sensor nodes are easyto deploy and require little to no infrastructure for the network to operate.Sensor nodes are also capable of communicating with each other and trans-mitting data from one to another. This makes WSNs a good option for manyenvironment monitoring applications [44, 70, 115], and, more specifically, forhazardous environments, such as monitoring active volcanos for early indi-cations of outbreaks [122]. In industry, WSNs are widely used in structuralmonitoring (e.g., bridge vibration monitoring [69], and pipe blockage in oil-fields [133]), and emergency detection in building [132]. In health care, WSNshave potential applications, where patients wear clothes equipped with sensornodes to monitor vital signs [34], and, more specifically, sensor nodes are usedto detect seizures in epilepsy patients [77]. Wearable WSNs are also used insports, e.g., monitoring the core temperature of marathon runners [27]. Otherapplications include target tracking [1,60], tracking perishable goods like fruitand pharmaceuticals [25], as well as traffic and road management [62].

Structure of the chapter. We first introduce the WSN system structure, in-cluding details about sensor nodes, tasks, routing protocols, and a comparisonwith traditional distributed systems (Section 3.1). We then give backgroundinformation on the application development and programming of WSNs, in-cluding node-level programming and macroprogramming (Section 3.2).

1In this dissertation, we only refer to wireless communication over radio waves; however, thereexists wireless communication that does not use radio waves.

33

Page 34: Constraint Programming for Wireless Sensor Networks

Figure 3.1. Zolertia: a compact wireless sensor node.

3.1 System StructureToday, WSNs usually consist of many sensor nodes of various types, rang-

ing from extremely small Eco nodes [92], medium size Zolertia Z1 nodes [131](see Figure 3.1), and to much larger and computer-like Rasbery Pi nodes [101].In a WSN, a special node, called the sink or base station, is responsible forquerying and collecting the data from the sensor nodes. Depending on theapplication, the sink can instead act as a gateway and transmit the queriesbetween a computer and the sensor nodes.

Sensor nodes in a WSNs can be mobile, stationary, or a combination ofboth. In a stationary WSN, sensor nodes do not move throughout the lifetimeof the network. However, in a mobile WSN, some nodes are moving geo-graphically and in time, due to being carried by humans or mobile vehicles. Ina network with many mobile sensor nodes, it is often the case that a forwardingpath can be created from the nodes to the base station.

Depending on the application, the nodes in a mobile WSN can be smart-phones. For example, in participatory sensing [29] and mobile crowdsens-ing [53] may involve only smartphones as mobile devices for sensing. A net-work where the data path is dynamically created as nodes move in the environ-ment is called mobile ad hoc networks (MANETs) [12]. The techniques, usedfor communicating data in MANETs can be used in mobile WSNs. However,MANETs do not necessarily provide sensing capabilities.

In case the sensor nodes are spread in a large environment, such that twosensor nodes are most of the time out of transmission range sparse network,the sensor nodes have to store the information until forwarding opportunitiesarise as they pass each other or some stationary sensor nodes [49, 125]. Thistype of network where the sensor nodes store data and forward it as an oppor-tunity arises is called an opportunistic network.

In this dissertation, we consider both stationary and mobile sensor nodes.For example, Figure 3.2 shows a stationary network of 54 sensor nodes de-ployed in the Intel Berkeley Research Lab [80] for monitoring temperature,

34

Page 35: Constraint Programming for Wireless Sensor Networks

Figure 3.2. Stationary network of 54 sensor nodes deployed in the Intel BerkeleyResearch Lab. The background map is taken with permission from [104].

Figure 3.3. Mobile traces of 19 users in a state fair (North Carolina, USA). The back-ground map is taken with permission from [113].

humidity, and light intensity. Figure 3.3 shows a mobile network of 19 userswhile attending a state fair in North Carolina, USA [104]. The users collectenvironmental data and forward it as they pass stationary sensor nodes in theenvironment.

We give more background information on sensor nodes in Section 3.1.1and more details on programming sensor nodes with tasks in Section 3.1.2.Routing protocols are explained in Section 3.1.3. We compare WSNs with thetraditional distributed computing in Section 3.1.4.

3.1.1 Sensor NodesSensor nodes are equipped with a very-low-powered processing unit, as wellas sensors and radio transceivers for communication. A sensor node may come

35

Page 36: Constraint Programming for Wireless Sensor Networks

with many sensors, such as for temperature, humidity, light intensity, air qual-ity, orientation, pressure, etc. For example, Figure 3.1 shows the ultra-compactwireless sensor node Eco [92], which comes with temperature, light intensity,and 3-axis accelerometer sensors.

In modern WSNs, a large number of sensor nodes are battery powered, andsensor node replacement might be very impractical, say because of the envi-ronment the sensor nodes are deployed in (e.g., a forest, oil refinery, nuclearpower plant, etc). Therefore, energy efficiency is a crucial aspect of WSNs.Unlike for mobile phones, tablets, and laptops, the battery of a sensor node ismeant to last for a very long time (up to several years), and some sensor nodesare able to extract energy from the environment (energy harvesting) [65].

In recent years, one of the main aspects of participatory sensing is to usemobile phones as a sensor platform [119]. Recent mobile phones are equippedwith short-range communication hardware such as bluetooth and other formsof near-field communication (NFC). This makes it possible for mobile phonesto communicate with stationary sensor nodes in WSNs while the mobile phonesand sensor nodes are located in close proximity of each other.

3.1.2 TasksA task is a piece of code implementing part of an application of a network.Each sensor node in a WSN is assigned to perform one or several tasks. Beforea sensor node can be deployed, it must be programmed to perform the assignedtasks. There are three categories of tasks: sensing tasks, operative tasks, andactuator tasks [97].

A sensing task polls a sensor to collect data. For example, invoking a sensorto measure the temperature in a room is performed by a sensing task. Sensingtasks are only executable periodically, as they are limited by how often thehardware is capable of collecting new readings. An operative task performsoperations on data that has been gathered by the sensing tasks. For example,taking the temperature from differently positioned sensors in a room and com-puting the average is performed by an operative task. Operative tasks are oftenperformed when some data items from sensing tasks are collected. Hence, op-erative tasks are also running periodically. Finally, an actuator task performsan action to affect the environment, based on data processed by operative tasks.For example, consider a task that turns on a heater to warm a room. Actuatortasks are not periodic and their execution usually depends on the activation ofsome event (e.g., temperature falling below some threshold). Sensing tasksand actuator tasks can only run on sensor nodes with the appropriate sensorsor actuators attached, while operative tasks are free to run on any sensor nodewith sufficient computational resources.

The entire network repeats the same behaviour over a time period called around. The firing rate of a task is the number of times it is fired at each round.

36

Page 37: Constraint Programming for Wireless Sensor Networks

Humiditysampler

Average andthresholdcalculator

Humidityadjustment

Histogramcache

Humiditymonitoring

Sensing Tasks Operative Tasks Actuator Tasks

Data-driven task graph

Figure 3.4. Data-driven task graph for a WSN with humidity adjustment and monitor-ing.

For example, a sensing task for measuring temperature with the firing rate of2, runs every 30 seconds in a network with a round of one minute.

It is convenient to represent the tasks and the communication between tasksin terms of graphs. The nodes in the graph are the tasks, and the edges arethe communication between the tasks in terms of data flow. This type of taskgraph is called data-driven task graph [89, 91, 97].

For example, Figure 3.4 shows a data-driven task graph for humidity mon-itoring and adjustment. The humidity sensing task collects humidity data andforwards it to the tasks called average and threshold calculator and histogramcache. The average and threshold calculator task computes the average of thehumidity: if it is below some threshold, then it sends an event to the humid-ity adjustment task to turn on the humidifiers until the humidity is above thethreshold. The histogram cache task computes the frequency of each humid-ity value as the stream of raw data is received. The histogram data is thensent to the humidity monitoring task for plotting the distribution of humidity.The average and threshold calculator task can directly communicate with thehistogram cache task, to enable tracking of changes in the humidity averagevalue.

3.1.3 Routing ProtocolsFor a WSN to operate correctly, it is essential for the sensor nodes to be ableto communicate the data to some base station or actuator. This process of dataand information exchange among the sensor nodes and between the sensornodes and a base station is achieved using routing protocols [6,98]. In a WSN,each sensor has the capability to collect and route data either to other sensornodes, called multi-hop routing, or directly to a base station, called single-hop

37

Page 38: Constraint Programming for Wireless Sensor Networks

routing. In a multi-hop routing a sensor node that is forwarding the data fromthe other sensor nodes to the base station is called a relay node [118]. A basestation may be a stationary node or a mobile node in either case.

In this dissertation, we consider such data collection routing protocols.There are many challenging factors in designing a routing protocol for datacollection:

• Sensor node deployment. The sensor node deployment can be deter-ministic or randomised. In a deterministic deployment, it is possible toprecompute the routing paths. For example, in [20], the sensor nodesare all stationary and the base station can precompute all the possibleshortest routes to the sensor nodes, which is achieved using the Floydalgorithm [47]. In a randomised deployment, one approach is to usethe tree discovery protocol [11] (also see route computation in [56]) todetect the neighbour sensor nodes (sensor nodes that are within the trans-mission range) and build a data forwarding scheme based on localisedinformation.

• Energy consumption. WSN lifetime directly depends on the resid-ual energy of the sensor nodes, as a malfunctioning of a sensor nodecan cause the network to become disconnected, and requires additionalrerouting of packets and reorganisation of the network. Therefore, itis crucial in WSNs to design a protocol with minimum communicationoverhead, which makes the network lifetime as long as possible.

• Connectivity. The connectivity of a WSN network depends on thequality of the links created between the sensor nodes and the base sta-tion. The link quality is usually measured in packet delivery rate (PDR),which is the ratio of the number of successful transmissions to the totalnumber of transmissions at the destination. A low link quality results indata loss. Therefore, it is crucial to consider link quality in designing arouting protocol for data collection.

• Quality of information. Quality of information is a measure of thevalue of the sensed data, which is an application-specific metric affectedby multiple factors, such as the location of sensed data, sensing modal-ities, ambient noise levels, sensing channel conditions, fault status, andphysical process dynamics [26, 32].

In this dissertation, we deal with both multi-hop and single-hop data collec-tion routing protocols. Unlike mobile ad hoc networks or cellular networks,where it is possible to build a global addressing scheme, WSNs do not al-low protocols based on the internet protocol (IP) due to their high overhead.In general, depending on the network structure, routing in WSNs can be di-vided into flat-based routing, hierarchical-based routing, and location-basedrouting. In flat-based routing all sensor nodes come with equal capabilitiesand they are assigned equal roles or functionality in the network, as opposedto hierarchical-based routing, where sensor nodes are assigned different func-

38

Page 39: Constraint Programming for Wireless Sensor Networks

tionality. In location-based routing, the position of sensor nodes is exploitedto assist in routing the data.

A data collection routing protocol used in Papers III, V, and VI is called thecollection tree protocol (CTP) [56], and both flat-based routing and location-based routing can adopt this protocol. The main advantage of this protocol isthe quick discovery of and recovery from routing inconsistencies. CTP is alsoused in our simulations and comparison with our own quality-of-information-aware data collection protocol [21] (see Paper III).

3.1.4 Comparison with Traditional Distributed ComputingDistributed systems consist of multiple nodes collaborating to perform oneor several tasks. This sounds not so different from WSNs. However, thereare several critical aspects in which WSNs differ from traditional distributedsystems:

• Spatial awareness. In distributed systems, nodes are often tightly cou-pled, i.e., the nodes are located close to each other (same circuit board,room, or building), and there is a dedicated interconnected network main-taining the communication between the nodes. In contrast, sensor nodesin WSNs often discover their neighbours and dynamically form a routefor communicating with the base station. When the sensor nodes areaware of the network topology and their locations, it becomes essentialto exploit the location at the application level as well, in order to utilisespecific goals (e.g., the task to compute the average humidity can beplaced on a specific sensor node depending on the location of each sen-sor node in order to minimise the communication overhead). However,in traditional distributed systems it is not necessary to utilise locationinformation at the application level.

• System input and output. In traditional distributed systems, the nodesare autonomous, and the user can access and use the remote resources asa single coherent system. The user can provide a set of input data (e.g.,matrices of integers) and perform an operation on the data to return theoutput (e.g., the product of the matrices). This process in distributedsystems relies on an external input of the data, even though the processof computing the output is performed internally by the system. WSNs bycontrast are reactive systems, where the operation relies on the data andevents triggered within the network (e.g., temperature drops below somethreshold activate the heaters). Such a reactive environment requiresspecialised levels of abstraction in both the design and the programmingof the network. We discuss these abstractions further in Section 3.2.2.

• Optimisation goals. There are two major concerns in traditional dis-tributed systems: the time and space required to perform the operationsand compute the output; and the communication costs between the links.

39

Page 40: Constraint Programming for Wireless Sensor Networks

However, in WSNs the nodes are running on battery and transmitting thedata is the main source of energy consumption. Therefore, the focus inWSNs is to devise smart strategies to preserve energy as much as possi-ble in order to increase the lifetime of the network.

3.2 Application DevelopmentWSNs have a wide range of applications. Developing applications for WSNsrequires writing a program for every sensor node, as well as compiling anddeploying the code on the sensor nodes.

The program written at the sensor node level must satisfy some local andglobal requirements for the whole network to operate according to the appli-cation design. The local requirements are that local tasks (sensing, operative,and actuator) are performing correctly. The global requirements are that thesensor nodes respond correctly to the messages received from other sensornodes (routing and coordination). In the early years of WSNs, these com-plicated programming requirements limited the application development ofWSNs to computer scientists. However, in order for WSNs to be accessible toa wider range of developers, it is necessary to simplify the application devel-opment process of WSNs, and to provide better programming tools for sensornetworks. In this section, we investigate two major classes of programmingmodels for WSNs, namely node-level (or node-centric) programming (Sec-tion 3.2.1) and macroprogramming (Section 3.2.2).

3.2.1 Node-Level ProgrammingIn the early days of WSNs, due to the similarities between sensor networksand distributed systems, WSN development was approached in the same wayas distributed systems. This required application developers to specify theirrequired functionality at the level of individual sensor nodes, using low-levelprogramming languages, such as nesC [54], which is an extension to the Cprogramming language.

Node-level programming specifies the local behaviour of sensor nodes in aWSN by focusing on providing high-level abstractions. In recent years, therehave been many efforts to build a common intermediate language to abstractaway the details of concurrency and communication while maintaining enoughdetail to allow optimisation by the compiler. Intermediate languages such asTML [89], Hood [123], Logical Neighborhoods [84], and TinyLIME [37] areexamples of such approaches.

Given an intermediate language, the developer is able to write code to readthe data from the local sensing interfaces, maintain and monitor the sensornode’s local resources, create events, send messages addressed to other sensornodes using their node ID or location, and process incoming messages from

40

Page 41: Constraint Programming for Wireless Sensor Networks

other nodes. However, provided with all the advantages of intermediate lan-guages, the developer is still responsible for the tedious task of ensuring thatthe WSN as a whole satisfies the desired requirements of the application, andthat each individual sensor node is operating locally and globally according tothe desired behaviour.

Considering the large size and heterogeneity of WSNs, and the limiteddistributed programming knowledge of the actual developers of WSNs, theparadigm of node-level programming is not a convenient approach for devel-oping applications of WSNs. These shortcomings of intermediate node-levellanguages triggered the quest for the programming of sensor networks as awhole, called macroprogramming, which we explain next.

3.2.2 MacroprogrammingMacroprogramming enables developers to specify the high-level collaborativebehaviour of WSNs at the system level, where the low-level details of thenetwork such as state maintenance or message passing are intentionally hiddenfrom the programmer. As a result, macroprogramming is emerging as a viabletechnique for developing complex embedded applications, as demonstrated byseveral efforts [10, 58, 90, 93] currently underway in this field.

Macroprogramming provides developers with a tool to design and spec-ify the requirements of WSNs in terms of data-driven task graphs (see Sec-tion 3.1.2). In a data-driven task graph the tasks interact with each other onlyusing the data items that they produce or consume. From the developer pointof view, the application development is simplified to programming only tasks(or using predefined tasks that are ready to use) and specifying the data flowand the requirements on how the tasks are mapped to different sensor nodes orregions in the network.

Figure 3.5 compares the macroprogramming approach with node-level pro-gramming, where in the former the developers only reason at a high level ofabstraction and the compiler is responsible for converting the high-level ab-straction into the individual node-level code. This process delegates a largeamount of tedious node-level programming to the compiler.

In the macroprogramming context, the process of compilation is a semantic-preserving transformation of the high-level application specification (given bythe data-driven task graph) into a distributed software system collaborativelyhosted by the individual sensor nodes (see [96] for more details on the com-pilation process). In addition, macroprogramming also provides tools for thedeveloper to specify performance goals for the deployed system (e.g., latencyrequirements, energy load balancing, expected network lifetime), which areconsidered in the process of compilation to optimise the configuration of theindividual sensor nodes and allocate different functionality to them.

41

Page 42: Constraint Programming for Wireless Sensor Networks

Figure 3.5. Macroprogramming versus node-level programming. The Figure is takenwith permission from [94].

42

Page 43: Constraint Programming for Wireless Sensor Networks

4. Optimisation Challenges in Wireless SensorNetworks

This dissertation covers modelling and solving various optimisation problemsfor wireless sensor networks. As mentioned in Chapter 3, there are many chal-lenges imposed on WSNs due to the limited resources of sensor nodes, suchas energy, bandwidth, computation power, and memory. Furthermore, the de-ployment of sensor nodes in an environment introduces additional challengingfactors, such as connectivity, link quality, robustness, mobility, and event cov-erage.

Many optimisation problems arise in WSNs following these limitations im-posed by the sensor nodes and the environment [47, 57, 114]. In this chapter,we categorise the optimisation challenges in WSNs, and explain those thatwe cover in this dissertation in more detail, including the related work. Weconsider the following categories of optimisation problems in WSNs:

• Optimal sensor deployment and coverage (see Section 4.1).• Topology control (see Section 4.2).• Scheduling (see Section 4.3).• Routing (see Section 4.4).

4.1 Optimal Sensor Deployment and CoverageA major requirement in monitoring applications of WSNs is to achieve a satis-factory level of coverage. These coverage problems can be divided into threesubcategories.

Coverage problems, also known as layout problems. Find the placementof sensor nodes to cover a given area, such that network connectivity is guar-anteed, and the number of deployed sensor nodes is minimised. This problemis a variation of art gallery problem originally attributed to Chvátal by VictorKlee in 1973, was studied further in the WSN literature [45], and is known tobe NP-hard: it involves placing the smallest number of guards in an area suchthat every point in the area can be observed by the guards. An approximationalgorithm based on geometry calculations is presented in [45].

Many heuristic and metaheuristic based algorithms are proposed for cover-age problems. Frat et al. [45] devise approximation algorithms to tackle thisproblem with obstacles. Fidanova et al. [50] propose an ant colony algorithm.Rotar et al. [106] use an evolutionary algorithm with a hyperplane (points in

43

Page 44: Constraint Programming for Wireless Sensor Networks

space that have better performance than any other individual within the cur-rent population). Recent related work also considers the placement of multiplesink and relay nodes [33, 100, 116]. In Paper II we present an ILP model foran extension of this problem with mobile nodes that solves the problem forlarge instances, and also finds the exact locations for the minimum numberof stationary sensor nodes to be deployed. For further related work consultPaper II.

Sensor location problems (SLP). Find the best locations to place a givennumber of sensor nodes in order to satisfy the requirement of event detec-tion. Cavalier et al. [30] propose a heuristic-based algorithm and formulate theproblem by considering a planar region and a fixed number of sensor nodes.They position the sensor nodes such that the probability of detecting an eventis maximised. Much related work in this area considers the problem as amaximal breach path problem (a path that minimises the maximum distancebetween every point on the path and its nearest sensor node) [43, 81]

Available covered regions identification problems. Given a sensor de-ployment, identify the regions that are not covered by the sensor nodes. Huanget al. [63] propose an exact polynomial-time algorithm to detect in a given sen-sor deployment if all regions are covered by at least a given number of sensornodes, while detecting which regions are not covered. Many variations of thisproblem consider maximising the lifetime of the network while maintainingthe covered regions. Shu et al. [110] solves this optimisation problem by bal-ancing the power consumption of the sensor nodes.

4.2 Topology ControlThe topology control problem in WSNs involves situations where we are in-terested in choosing a subset of the sensor nodes in the network, such thatsome constraints are satisfied. The selected subset of sensor nodes is calledthe backbone of the network and must be connected so that communication ismaintained with the base station [120]. Depending on the application of theWSN, selecting a backbone has some benefits: (1) reduced traffic by perform-ing data aggregation and processing the data locally, (2) simplified routing, asonly the backbone sensor nodes are forwarding the data to the base station,and (3) saved energy, as it becomes possible to turn off the sensor nodes thatare not part of the backbone.

The problem called connected dominating set (CDS) [124] is used to modelthe topology control problem. Let the topology of the network be representedby a graph G = (V,E), where the vertices V represent the sensor nodes, andthe edges E represent the wireless links between sensor nodes. The CDS ofG is a subset of vertices V ′ ⊆ V such that every vertex in V ′ is connected byat least one link to another vertex in V ′, and for every vertex that is not in V ′

44

Page 45: Constraint Programming for Wireless Sensor Networks

there exists at least one edge with a vertex in V ′. The problem of finding aCDS of minimum size is called minimum CDS (mCDS) [42].

Yuanyuan et al. [130] propose a distributed CDS algorithm that has O(|V |)time complexity and performs O(|V |) transmissions. A generalised CDS prob-lem is called kmCDS (k-connected m-dominating set), which achieves faulttolerance by considering at least k different paths between any pair of verticesin the dominating set, and there must be at least m links between any vertexin the dominating set and the vertex that are not in the dominating set. Wu etal. [126] propose a distributed algorithm for solving the kmCDS problem.

Donghyun et al. [68] propose centralised and distributed algorithms forsolving the mCDS problem with energy efficiency constraints. In Papers Vand VI we present a CP model for finding an mCDS such that the monitoringdata from inactive sensor nodes can be predicted with a high accuracy, and theenergy consumption is minimised.

4.3 SchedulingThere are generally two strategies for sensor nodes to access the medium forcommunication, namely scheduled access and random (or contention-based)access [127]. Scheduled strategies are common for ensuring collision-freemedium access, such as time division multiple access (TDMA). Other strate-gies such as carrier sense multiple access (CSMA) are based on channel con-tention. The optimisation problem that arises in this context is the graphcolouring optimisation problem, which requires minimising the number ofcolours used to colour the vertices in a graph such that no two neighbour ver-tices use the same colour. In the WSN context, this ensures that two neighboursensor nodes can communicate without causing interference. In terms of timecomplexity, the graph colouring problem is NP-complete [35].

This problem is addressed in many papers, such as [52, 67, 112]. Thesepapers focus on providing a distributed algorithm for solving the schedulingproblem. In Paper III, we consider a special case of scheduling by maximis-ing the quality of information for data collection in WSNs, and propose aheuristic-based algorithm to maximise the quality of information achieved byscheduling data collection using mobile nodes.

4.4 RoutingIn a multi-hop WSN many sensor nodes also forward (or relay) the data fromother sensor nodes toward the base station, and the routing problem involvesfinding paths to forward the data such that some metric is optimised (e.g.,the minimum number of hop counts, or a path with maximum link quality).

45

Page 46: Constraint Programming for Wireless Sensor Networks

Routing problems are widely studied for WSNs. Below, we discuss two maincategories of routing optimisation problems for WSNs.

Shortest path and spanning tree based problems. These problems arewidely used in WSNs, and involve finding either a shortest-path tree (SPT)from a sensor node to the base station, or finding a minimum spanning tree(MST) in the network graph. In both models the assumption is that each link(an edge on the network graph) has a cost associated with it, and usually thecost represents the power consumed in transmitting a packet over the link.Many distributed algorithms have been devised based on the algorithms byDijkstra, Floyd, Bellman-Ford, or Chandy-Misra to tackle this routing prob-lem [76, 108, 129].

Much work in this area combines routing with minimising energy con-sumption, while the intermediate relay nodes aggregate the data. Cristescuet al. [36] show that the joint problem of routing and data aggregation is NP-hard and use a heuristic-based algorithm that combines MST and SPT to find abest route. Furthermore, minimising the total energy consumption may causesome sensor nodes to deplete their energy faster than others and may causethe network to become disconnected. Therefore, Gagarin et al. [51] proposeto minimise the maximum energy spent by the sensor nodes and model theproblem as a minimum-degree spanning tree (MDST) problem, which theyshow is NP-hard. Papers I, III, IV, V, and VI incorporate routing constraints intheir respective optimisation problems.

Flow-based routing problems. Routing problems in WSNs can be formu-lated as a multi-commodity flow problem (MCFP) [48, 85]. A commodity isa source-destination pair, and if several commodities share network resourcesthen we have a multicommodity flow. In an MCFP, the commodities maynot share a source or destination, but they share the same links. A standardflow problem for WSNs includes two types of constraints, namely the flowconservation constraint and the capacity constraint. The flow conservationconstraint enforces that the data transmitted by a sensor node is equal to thetotal amount of data it receives plus the total amount of data it generates. Thecapacity constraint states that the flow transmission by a sensor node is sub-ject to a given capacity (e.g., for every sensor node, the total energy consumedfor transmission of the data over the lifetime of the network must be at mostthe initial energy of the sensor nodes). The flow problem is then to find flowsthat maximise the network lifetime. Karakostas [66] gives a polynomial timeapproximation scheme for MCFP with continuous flows. Chang et al. [31]propose an ILP formulation for solving this problem. Bodlaender et al. [28]show that MCFP with integer flows is NP-hard, and they propose an approx-imation algorithm for solving this problem. A distributed algorithm for thisproblem is discussed in [79].

46

Page 47: Constraint Programming for Wireless Sensor Networks

5. Summary of the Papers

Paper IF. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Energy-efficient task-mapping for data-driven sensor network macroprogramming using constraintprogramming. In R. Dell and K. Wood, editors, Proceedings of ICS 2011, the12th INFORMS Computing Society Conference, pages 199–209. INFORMSComputing Society, 2011. DOI: 10.1287/ics.2011.0016

SummaryWe present a constraint programming (CP) model for the task-mapping prob-lem in a multi-hop heterogeneous WSN. The task graph and the general mod-elling framework are the same as those in [10,97]. The task-mapping probleminvolves mapping the tasks to the sensor nodes in the target network beforethe deployment, subject to some requirements. We require to maximise thenetwork lifetime, hence minimising the maximum energy spent by the sensornodes for routing the data to the base station. Although, we statically generateall possible routes, our CP model ensures that the data-flow in the resultingmapping goes through routes that require minimum transmission energy bythe sensor nodes in the network. In our evaluations, we use realistic instancesof two real-world applications of the problem: the monitoring of heating, ven-tilation, and air conditioning [41] and highway traffic management [62].

ContributionsWe contribute to the WSN task-mapping problem by implementing our modelas a constraint program and as an integer linear program (ILP). Our CP modelachieves at least an order of magnitude speedup compared to the ILP modelof [97] for realistic instances of real-world applications.

47

Page 48: Constraint Programming for Wireless Sensor Networks

Paper IIF. H. Bijarbooneh, P. Flener, E. C.-H. Ngai, and J. Pearson. An optimisation-based approach for wireless sensor deployment in mobile sensing environ-ments. In P. Duhamel and P. Lorenz, editors, Proceedings of WCNC 2012,the 10th IEEE Wireless Communications and Networking Conference, pages2108–2112. IEEE Communications Society, 2012.DOI: 10.1109/WCNC.2012.6214140

SummaryWe consider a collaborative sensing system that enables mobile phones andstationary sensors to perform sensing together. Mobile phones can collectsensing data at different locations as they are carried by their users, who aremoving freely in the sensing field. Stationary sensors can complement therelatively dynamic sensing performance of the mobile phones. We considera meshed network infrastructure that supports wireless communication stan-dards, such as 3G, WiFi, and Zigbee, for mobile phones and wireless sensors toreport their data. The stationary sensors can be deployed at different locationsto monitor the environment and human activities. Our goal is to minimise thedeployment cost of stationary sensors, while maintaining satisfactory sensingquality (average of sensor measurements compared with the ground truth) inthe collaborative sensing system. Moreover, we target one-time deploymentof the sensors to avoid extra costs of re-configuration and re-deployment.

We evaluate the sensing coverage, number of sensors, and computation timeof our approach. We model the problem by integer linear programming, con-sidering the sensing coverage of both the mobile phones and the wireless sen-sors. Our approach provides satisfactory sensing coverage as specified by theapplication requirements, while minimising the number of wireless sensors indeployment. We evaluate our model using real mobility traces collected fromDisney World Orlando [75, 102] and we compare our results against randomand uniform deployment.

ContributionsOur main contribution is to model and solve the one-time deployment problemfor large-scale sensor networks. We present an integer linear programmingmodel for sensor deployment in a collaborative sensing environment with bothmobile phones and stationary sensors. Our model achieves optimal resultswithin short computation time for small and moderate-size networks, and itachieves near optimal results for large sensing fields.

48

Page 49: Constraint Programming for Wireless Sensor Networks

Paper IIIF. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Optimising qualityof information in data collection for mobile sensor networks. In X. Gu andH. Wang, editors, Proceedings of IWQoS 2013, the 21st IEEE/ACM Interna-tional Symposium on Quality of Service, pages 163–172. IEEE Communica-tions Society, 2013. DOI: 10.1109/IWQoS.2013.6550277

SummaryWe present a novel quality-of-information (QoI) aware data collection proto-col (QoIACP) for wireless sensor networks with mobile users. The protocol isdesigned to optimise data utility, which measures the normalised QoI value ofcollected data per transmission. A hybrid methodology is used in our QoIACPprotocol with a distributed neighbourhood discovery protocol, but centralisedclustering and data collection scheduling for coordination among multiple mo-bile users. We formulate the optimisation problem and propose a clusteringalgorithm and a scheduling algorithm for the data collection in order to max-imise the total data utility. A relaxation of the problem constraints is used tomodel the problem with integer linear programming (ILP); this model is thensolved to optimality to provide a usually non-sharp upper bound on the qual-ity of our results. We evaluate our QoIACP protocol by extensive simulationsusing real mobility traces. We also compare our QoIACP protocol with anextended implementation of the CTP protocol [56].

The simulation results demonstrate that our QoIACP protocol can achievevery high data utility, as close as 4% to the upper bound on an optimal solution.It obtains much higher QoI (more than 25%) and data utility (more than 11%)than the CTP protocol. The communication overhead of mobile users remainsthe same between QoIACP and CTP, while the sensors in QoIACP may haveslightly higher communication overhead for reporting sensing data with highQoI.

ContributionsThe contributions are threefold: (1) We present a novel QoI-aware data col-lection scheme that utilises voluntary mobile users to collect data from theirsurrounding sensors. (2) We formulate the optimisation problem and proposea greedy algorithm for maximising the QoI and minimising the communica-tion overhead for the data collection. (3) We conduct extensive simulationswith real mobility traces to evaluate the QoI and communication overhead ofour proposed approach.

49

Page 50: Constraint Programming for Wireless Sensor Networks

Paper IVF. H. Bijarbooneh, A. Pathak, J. Pearson, V. Issarny, and B. Jonsson. A con-straint programming approach for managing end-to-end requirements in sen-sor network macroprogramming. In O. Postolache and M. van Sinderen, ed-itors, Proceedings of SensorNets 2014, the 3rd International Conference onSensor Networks, pages 28–40. SciTePress, 2014.DOI: 10.5220/0004715200280040

SummaryWe consider managing end-to-end requirements (e.g., minimising the latencybetween the sensing of a phenomenon and the resulting action) in WSN macro-programming, which is shown to be especially useful in specifying a widerange of sense-and-respond applications [95]. We base our work on the Ab-stract Task Graph (ATaG) macroprogramming language [10], following thedata-driven macroprogramming paradigm.

We formulate the problem of task-mapping with end-to-end requirementsas a constraint program while honouring end-to-end requirements encounteredduring sensor network macroprogramming. We provide a generic approach onsatisfying end-to-end requirements efficiently. We also address the case whencopies of some tasks are permitted in order to increase performance guaran-tees. Our evaluation, performed on a realistic highway traffic application [117]task graph for the special case of managing end-to-end latency, shows thatthis problem can indeed be solved efficiently using our approach, althoughincreased computation time is needed for tighter bounds.

ContributionsThe contributions of this paper are threefold: (1) The formulation of the task-mapping problem arising out of the need to satisfy end-to-end constraints inWSN macroprogramming; (2) Constraint programming techniques to solvethe latency problem; and (3) Extension of the approach to address situationswhere replication of tasks is allowed to improve latency performance.

50

Page 51: Constraint Programming for Wireless Sensor Networks

Paper VF. H. Bijarbooneh, W. Du, E. Ngai, and X. Fu. Energy-efficient sensor selec-tion for data quality and load balancing in wireless sensor networks. In J. Liuand X. Wang, editors, Proceedings of IWQoS 2014, the 22nd IEEE/ACM In-ternational Symposium on Quality of Service, pages 338–343. IEEE Commu-nications Society, 2014. DOI: 10.1109/IWQoS.2014.6914338

andPaper VIF. H. Bijarbooneh, W. Du, E. Ngai, X. Fu, and J. Liu. Cloud-assisted datafusion and sensor selection for internet-of-things. In C. Lin, J. Liu, K. Ra-makrishnan, and E. C.-H. Ngai, editors, IEEE Internet of Things, Special Is-sue on Cloud Computing for IoT. IEEE Communications Society, Submittedin December 2014.

SummaryIn Paper V, we present a novel adaptive sensing belief propagation (ASBP)protocol for energy-efficient data collection in wireless sensor networks, wherethe data is collected in several rounds by active sensors (sensors that are turnedon by the ASBP protocol to collect data in each round). The ASBP protocolis designed to take advantage of data quantisation and spatio-temporal corre-lation of the data in order to prolong the lifetime of the network. ASBP solvesan optimisation problem to select a minimal set of active sensor nodes thatmaximises data utility and achieves energy load balancing. The data utilitymeasures the path quality (the packet reception probability over a path in thenetwork) and correlation of the data for the active sensor nodes. In our proto-col, belief propagation (BP) iteratively infers values of the missing data fromthe stream of active sensor readings. The accuracy of BP is adjustable basedon the minimum number of active sensors.

We formulate and solve the active sensor selection optimisation problemusing constraint programming (CP), and compare it with our heuristic-basedgreedy algorithm. We evaluate the performance of our ASBP protocol by ex-tensive simulations using real data collected at an Intel lab sensor deploymentand their link quality estimates [80]. The simulation results show that ourASBP protocol can improve energy efficiency up to 80%, with the optimal CPactive sensor selection, while maintaining on average 6% error in the BP datainference.

In Paper VI, we extend the study in Paper V by improving the accuracyof our BP algorithm, and we compare our results with the state of the artcompressive sensing approach [71].

51

Page 52: Constraint Programming for Wireless Sensor Networks

ContributionsThe contributions of Paper V are threefold: (1) We present a novel data collec-tion scheme (ASBP) that utilises highly correlated spatio-temporal data in thenetwork and uses belief propagation (BP) to reconstruct the missing data dueto packet losses and the sensor selection strategy. (2) We formulate the activesensor selection optimisation problem, and propose two approaches, namelyconstraint programming (CP) and a heuristic-based greedy algorithm to solvethe problem. The CP approach solves the problem to optimality. (3) We con-duct extensive simulation with a real deployment of a sensor network and thecollected data to evaluate the impact of our proposed approach on the overallenergy consumption, data utility, and accuracy (error prediction of the missingdata).

In addition to the contributions above, in Paper VI we show that our im-proved BP algorithm performs significantly better than the state of the artcompressive sensing approach [71].

52

Page 53: Constraint Programming for Wireless Sensor Networks

6. Conclusion

In this dissertation, we studied some of the fundamental optimisation problemsrelated to the programming of WSNs, their coverage, mobility, data collection,and data loss, modelled as standalone optimisation problems or optimisationproblems integrated with protocol design. Our solution method comes fromvarious fields of research including constraint programming (CP), integer lin-ear programming (ILP), heuristic-based algorithms, and data inference tech-niques.

We made the following contributions in this dissertation:• We contributed to the WSN task-mapping problem by implementing our

model as a constraint program (CP) and integer linear program (ILP).Our CP model achieves at least an order of magnitude speedup comparedto the ILP model of [97] for realistic instances of real-world applications.(Paper I)

• We presented an integer linear programming model for sensor deploy-ment in a collaborative sensing environment with both mobile phonesand stationary sensors. We modelled the problem using integer linearprogramming, and evaluated the results against random and uniform de-ployment. Our model achieves optimal results within a short compu-tation time for small and moderate-size networks, and it achieves nearoptimal results for large sensing fields. (Paper II)

• We presented a novel quality of information (QoI) aware data collectionscheme that utilises voluntary mobile users to collect data from theirsurrounding sensors. We formulated the optimisation problem and pro-posed a greedy algorithm for maximising the QoI and minimising thecommunication overhead for the data collection. (Paper III)

• We formulated the task-mapping problem arising from the need to sat-isfy end-to-end constraints in WSN macroprogramming, and we used aCP formulation to solve the problem for packet delays. We further ex-tended the approach to address situations where replication of tasks isallowed to improve latency performance. (Paper IV)

• We presented a novel data collection scheme (called ASBP) that utiliseshighly correlated spatio-temporal data in the network and uses beliefpropagation (BP) to reconstruct the data missing due to packet losses andthe sensor selection strategy. We formulated the active sensor selectionoptimisation problem, and proposed two approaches, namely constraintprogramming (CP) and a heuristic-based greedy algorithm to solve theproblem. We compared our results with the state of the art compressive

53

Page 54: Constraint Programming for Wireless Sensor Networks

sensing [71] technique, and we showed that our approach achieves asignificantly lower error in data prediction. (Papers V and VI)

In addition to the contributions above, we gave some expected impacts of thisdissertation in Section 1.2.

We conclude that the techniques used in solving optimisation problems inWSNs vary greatly, and they do not necessarily perform equally. For example,CP is the only approach able to solve effectively the task-mapping problemwith end-to-end requirements, whereas for coverage problems ILP performsbetter. Therefore, understanding the nature of the problem and the underlyingconstraints is the key to solve optimisation problems in WSNs efficiently.

54

Page 55: Constraint Programming for Wireless Sensor Networks

References

[1] T. F. Abdelzaher, B. M. Blum, Q. Cao, Y. Chen, D. Evans, J. George,S. George, L. Gu, T. He, S. Krishnamurthy, L. Luo, S. H. Son, J. A. Stankovic,R. Stoleru, and A. D. Wood. Envirotrack: Towards an environmentalcomputing paradigm for distributed sensor networks. In Proceedings ofICDCS 2004, the 24th International Conference on Distributed ComputingSystems, 24-26 March 2004, Hachioji, Tokyo, Japan, pages 582–589. IEEEComputer Society, 2004.

[2] M. Abramowitz and I. A. Stegun. Handbook of Mathematical Functions: WithFormulas, Graphs, and Mathematical Tables. Courier Dover Publications,1972.

[3] T. Achterberg. SCIP: Solving constraint integer programs. MathematicalProgramming Computation, 1(1):1–41, July 2009.http://mpc.zib.de/index.php/MPC/article/view/4.

[4] M. Aigner. Combinatorial Theory. Classics in Mathematics. Springer BerlinHeidelberg, 1996.

[5] I. F. Akyıldız, W. Su, Y. Sankarasubramaniam, and E. Çayırcı. Wireless sensornetworks: A survey. Computer Networks, 38(4):393–422, 2002.

[6] J. N. Al-Karaki and A. E. Kamal. Routing techniques in wireless sensornetworks: A survey. IEEE Journal of Wireless Communications, 11(6):6–28,Dec 2004.

[7] J. Amaro, F. Ferreira, R. Cortesao, N. Vinagre, and R. Bras. Low cost wirelesssensor network for in-field operation monitoring of induction motors. InProceedings of ICIT 2010, the IEEE International Conference on IndustrialTechnology, pages 1044–1049, March 2010.

[8] K. R. Apt. Principles of Constraint Programming. Cambridge UniversityPress, 2003.

[9] B. C. Arnold, N. Balakrishnan, and H. Nagaraja. A First Course in OrderStatistics, volume 54 of Classics in Applied Mathematics. Society forIndustrial and Applied Mathematics (SIAM), Philadelphia, PA, 2008.Unabridged republication of the 1992 original.

[10] A. Bakshi, V. K. Prasanna, J. Reich, and D. Larner. The abstract task graph: Amethodology for architecture-independent programming of networked sensorsystems. In Proceedings of EESR 2005: the workshop on End-to-End,Sense-and-Respond systems, applications, and services, pages 19–24.USENIX Association, Berkeley, CA, USA, 2005.

[11] S. Banerjee and S. Khuller. A clustering scheme for hierarchical control inmulti-hop wireless networks. In Proceedings of the 20th Annual JointConference of the IEEE Computer and Communications Societies, volume 2 ofINFOCOM, pages 1028–1037, 2001.

[12] S. Basagni, M. Conti, S. Giordano, and I. Stojmenovic. Mobile Ad HocNetworking. John Wiley & Sons, 2004.

55

Page 56: Constraint Programming for Wireless Sensor Networks

[13] N. Beldiceanu, M. Carlsson, and T. Petit. Deriving filtering algorithms fromconstraint checkers. In M. Wallace, editor, Proceedings of CP 2004, volume3258 of LNCS, pages 107–122. Springer-Verlag, 2004.

[14] N. Beldiceanu and E. Contejean. Introducing global constraints in CHIP.Mathematical and Computer Modelling, 20(12):97–123, Dec 1994.

[15] M. Berkelaar, K. Eikland, and P. Notebaert. lp_solve, 2014. Available fromhttp://lpsolve.sourceforge.net.

[16] M. Bezzel. Proposal of 8-queens problem. Berliner Schachzeitung, 3:363,1848.

[17] F. H. Bijarbooneh, W. Du, E. Ngai, and X. Fu. Energy-efficient sensorselection for data quality and load balancing in wireless sensor networks. InJ. Liu and X. Wang, editors, Proceedings of IWQoS 2014, the 22nd IEEE/ACMInternational Symposium on Quality of Service, pages 338–343. IEEECommunications Society, 2014.

[18] F. H. Bijarbooneh, W. Du, E. Ngai, X. Fu, and J. Liu. Cloud-assisted datafusion and sensor selection for internet-of-things. In C. Lin, J. Liu,K. Ramakrishnan, and E. C.-H. Ngai, editors, IEEE Internet of Things, SpecialIssue on Cloud Computing for IoT. IEEE Communications Society, Submittedin December 2014.

[19] F. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Energy-efficienttask-mapping for data-driven sensor network macroprogramming usingconstraint programming. In T. Mancini and J. Pearson, editors, ModRef 2010,the 9th International Workshop on Constraint Modelling and Reformulation,held at CP 2010, the 16th international conference on principles and practiceof constraint programming., 2010. Available fromhttp://uu.diva-portal.org/smash/record.jsf?pid=diva2:377275.

[20] F. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Energy-efficienttask-mapping for data-driven sensor network macroprogramming usingconstraint programming. In R. Dell and K. Wood, editors, Proceedings of ICS2011, the 12th INFORMS Computing Society Conference, pages 199–209.INFORMS Computing Society, 2011.

[21] F. H. Bijarbooneh, P. Flener, E. Ngai, and J. Pearson. Optimising quality ofinformation in data collection for mobile sensor networks. In X. Gu andH. Wang, editors, Proceedings of IWQoS 2013, the 21st IEEE/ACMInternational Symposium on Quality of Service, pages 163–172. IEEECommunications Society, 2013.

[22] F. H. Bijarbooneh, P. Flener, E. C.-H. Ngai, and J. Pearson. Anoptimisation-based approach for wireless sensor deployment in mobile sensingenvironments. In P. Duhamel and P. Lorenz, editors, Proceedings of WCNC2012, the 10th IEEE Wireless Communications and Networking Conference,pages 2108–2112. IEEE Communications Society, 2012.

[23] F. H. Bijarbooneh and M. Jacobsson. Macroprogramming of wireless sensornetworks using task graphs and constraint solving. In SNCNW 2012, the 8thSwedish National Computer Networking Workshop, 2012. Available fromhttp://uu.diva-portal.org/smash/record.jsf?pid=diva2:571112.

56

Page 57: Constraint Programming for Wireless Sensor Networks

[24] F. H. Bijarbooneh, A. Pathak, J. Pearson, V. Issarny, and B. Jonsson. Aconstraint programming approach for managing end-to-end requirements insensor network macroprogramming. In O. Postolache and M. van Sinderen,editors, Proceedings of SensorNets 2014, the 3rd International Conference onSensor Networks, pages 28–40. SciTePress, 2014.

[25] D. J. Bijwaard, W. A. van Kleunen, P. J. Havinga, L. Kleiboer, and M. J. Bijl.Industry: Using dynamic WSNs in smart logistics for fruits and pharmacy. InProceedings of SenSys 2011, the 9th ACM Conference on EmbeddedNetworked Sensor Systems, pages 218–231, New York, NY, USA, 2011. ACMPress.

[26] C. Bisdikian. On sensor sampling and quality of information: A starting point.In Proceedings of PerCom 2007, the 5th Annual IEEE InternationalConference on Pervasive Computing and Communications, PerComWorkshops, pages 279–284, 2007.

[27] C. A. Boano, M. Lasagni, and K. Romer. Non-invasive measurement of corebody temperature in marathon runners. In Proceedings of BSN 2013, the IEEEInternational Conference on Body Sensor Networks, pages 1–6. IEEECommunications Society, May 2013.

[28] H. Bodlaender, R. Tan, T. van Dijk, and J. van Leeuwen. Integer maximumflow in wireless sensor networks with energy constraint. In J. Gudmundsson,editor, Algorithm Theory SWAT, volume 5124 of Lecture Notes in ComputerScience, pages 102–113. Springer Berlin Heidelberg, 2008.

[29] J. A. Burke, D. Estrin, M. Hansen, A. Parker, N. Ramanathan, S. Reddy, andM. B. Srivastava. Participatory sensing. Center for Embedded NetworkSensing, 2006.

[30] T. M. Cavalier, W. A. Conner, E. del Castillo, and S. I. Brown. A heuristicalgorithm for minimax sensor location in the plane. European Journal ofOperational Research, 183(1):42–55, 2007.

[31] J.-H. Chang and L. Tassiulas. Maximum lifetime routing in wireless sensornetworks. IEEE/ACM Transactions on Networking, 12(4):609–619, 2004.

[32] Z. Charbiwala, S. Zahedi, Y. Kim, Y. Cho, and M. Srivastava. Toward qualityof information aware rate control for sensor networks. In Proceedings of the4th International Workshop on Feedback Control Implementation and Designin Computing Systems and Networks, April 2009.

[33] F. Chen and R. Li. Sink node placement strategies for wireless sensornetworks. Wireless Personal Communications, 68(2):303–319, 2013.

[34] O. Chipara, C. Lu, T. C. Bailey, and G.-C. Roman. Reliable clinical monitoringusing wireless sensor networks: Experiences in a step-down hospital unit. InProceedings of SenSys 2010, the 8th ACM Conference on EmbeddedNetworked Sensor Systems, pages 155–168, New York, NY, USA, 2010. ACM.

[35] T. Cormen, C. Leiserson, R. Rivest, and C. Stein. Introduction to Algorithms.The MIT Press, third edition, 2009.

[36] R. Cristescu, B. Beferull-Lozano, M. Vetterli, and R. Wattenhofer. Networkcorrelated data gathering with explicit communication: NP-completeness andalgorithms. IEEE/ACM Transactions on Networking, 14(1):41–54, 2006.

57

Page 58: Constraint Programming for Wireless Sensor Networks

[37] C. Curino, M. Giani, M. Giorgetta, A. Giusti, A. Murphy, and G. Picco.TinyLIME: Bridging mobile and sensor networks through middleware. InProceedings of PerCom 2005, the 3rd IEEE International Conference onPervasive Computing and Communications, pages 61–72, March 2005.

[38] B. Davey and H. Priestley. Introduction to Lattices and Order. CambridgeMathematical Textbooks. Cambridge University Press, 1990.

[39] H. David and H. Nagaraja. Order Statistics. Wiley Series in Probability andStatistics. Wiley-Interscience [John Wiley & Sons], Hoboken, NJ, thirdedition, 2003.

[40] R. Dechter. Tractable structures for constraint satisfaction problems. InHandbook of Constraint Programming, chapter 7, pages 209–244. Elsevier,2006.

[41] M. Demirbas. Wireless sensor networks for monitoring of large publicbuildings. Technical Report 26, SUNY Buffalo, NY, USA, 2005. Available athttp://www.cse.buffalo.edu/tech-reports/2005-26.pdf.

[42] D.-Z. Du. Connected Dominating Set: Theory and Applications, volume 77 ofSpringer Optimization and Its Applications. Springer, 2012.

[43] A. Duttagupta, A. Bishnu, and I. Sengupta. Maximal breach in wireless sensornetworks: Geometric characterization and algorithms. In M. Kutylowski,J. Cichon, and P. Kubiak, editors, Algorithmic Aspects of Wireless SensorNetworks, volume 4837 of Lecture Notes in Computer Science, pages126–137. Springer Berlin Heidelberg, 2008.

[44] V. Dyo. Evolution and sustainability of a wildlife monitoring sensor network.In Proceedings of SenSys 2010, the 8th ACM Conference on EmbeddedNetworked Sensor Systems, pages 127–140. ACM Press, 2010.

[45] A. Efrat, S. Har-Peled, and J. Mitchell. Approximation algorithms for twooptimal location problems in sensor networks. In Proceedings of BroadNets2005, the 2nd International Conference on Broadband Networks, pages714–723 Vol. 1. IEEE Computer Society, Oct 2005.

[46] A. Elsts, F. H. Bijarbooneh, M. Jacobsson, and K. Sagonas. Demo abstract:ProFuN TG: A tool using abstract task graphs to facilitate the development,deployment and maintenance of wireless sensor network applications. InEWSN 2015, the 12th European Conference on Wireless Sensor Networks,Poster and Demo Session, Lecture Notes in Computer Science. Springer, 2015.

[47] J. Evans. Optimization Algorithms for Networks and Graphs. Taylor &Francis, second edition, 1992.

[48] S. Even, A. Itai, and A. Shamir. On the complexity of timetable andmulticommodity flow problems. The Society for Industrial and AppliedMathematics (SIAM) Journal on Computing, 5(4):691–703, 1976.

[49] K. Fall. A delay-tolerant network architecture for challenged internets. InProceedings of SIGCOMM 2003, the Conference on Applications,Technologies, Architectures, and Protocols for Computer Communications,pages 27–34, New York, NY, USA, 2003. ACM Press.

[50] S. Fidanova, P. Marinov, and E. Alba. Ant algorithm for optimal sensordeployment. In K. Madani, A. Dourado Correia, A. Rosa, and J. Filipe,editors, Computational Intelligence, volume 399 of Studies in ComputationalIntelligence, pages 21–29. Springer Berlin Heidelberg, 2012.

58

Page 59: Constraint Programming for Wireless Sensor Networks

[51] A. Gagarin, S. Hussain, and L. Yang. Distributed search for balanced energyconsumption spanning trees in wireless sensor networks. In Proceedings ofWAINA 2009, the IEEE 23rd International Conference on AdvancedInformation Networking and Applications Workshops, pages 1037–1042. IEEEComputer Society, May 2009.

[52] S. Gandham, M. Dawande, and R. Prakash. Link scheduling in sensornetworks: distributed edge coloring revisited. In Proceedings of INFOCOM2005, the 24th IEEE Annual Joint Conference of the Computer andCommunications Societies, volume 4, pages 2492–2501. IEEECommunications Society, March 2005.

[53] R. Ganti, F. Ye, and H. Lei. Mobile crowdsensing: current state and futurechallenges. IEEE Communications Magazine, 49(11):32–39, November 2011.

[54] D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler. ThenesC language: A holistic approach to networked embedded systems. InProceedings of PLDI 2003, the ACM SIGPLAN Conference on ProgrammingLanguage Design and Implementation, pages 1–11, New York, NY, USA,2003. ACM Press.

[55] Gecode Team. Gecode: A generic constraint development environment, 2015.Available from http://www.gecode.org/.

[56] O. Gnawali, R. Fonseca, K. Jamieson, D. Moss, and P. Levis. Collection treeprotocol. In Proceedings of SenSys 2009, the 7th ACM Conference onEmbedded Networked Sensor Systems, pages 1–14. ACM Press, 2009.

[57] A. Gogu, D. Nace, A. Dilo, and N. Meratnia. Review of Optimization Problemsin Wireless Sensor Networks, chapter 7, pages 153–180. TelecommunicationsNetworks – Current Status and Future Trends. InTech, 2012.

[58] R. Gummadi, O. Gnawali, and R. Govindan. Macro-programming wirelesssensor networks using KAIROS. In V. K. Prasanna, S. S. Iyengar, P. G.Spirakis, and M. Welsh, editors, Proceedings of DCOSS 2005, the 1st IEEEInternational Conference on Distributed Computing in Sensor Systems,volume 3560 of Lecture Notes in Computer Science, pages 126–140. SpringerBerlin, Heidelberg, 2005.

[59] Gurobi Optimization, Inc. Gurobi optimizer reference manual, 2015.Available from http://www.gurobi.com.

[60] T. He, S. Krishnamurthy, L. Luo, T. Yan, L. Gu, R. Stoleru, G. Zhou, Q. Cao,P. Vicaire, J. A. Stankovic, T. F. Abdelzaher, J. Hui, and B. Krogh. VigilNet:An integrated sensor network system for energy-efficient surveillance. ACMTransactions on Sensor Networks, 2(1):1–38, 2006.

[61] R. V. Hogg, E. A. Tanis, and M. J. M. Rao. Probability and StatisticalInference. Macmillan New York, 1977.

[62] T. T. Hsieh. Using sensor networks for highway and traffic applications. IEEEPotentials, 23(2):13–16, April 2004.

[63] C.-F. Huang and Y.-C. Tseng. The coverage problem in a wireless sensornetwork. In Proceedings of WSNA 2003, the 2nd ACM internationalconference on Wireless Sensor Networks and Applications, pages 115–121.ACM Press, 2003.

[64] IBM ILOG CPLEX Optimizer. Available from http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/, 2015.

59

Page 60: Constraint Programming for Wireless Sensor Networks

[65] A. Kansal and M. B. Srivastava. An environmental energy harvestingframework for sensor networks. In Proceedings of ISLPED 2003, theInternational Symposium on Low Power Electronics and Design, pages481–486. IEEE Computer Society, 2003.

[66] G. Karakostas. Faster approximation schemes for fractional multicommodityflow problems. In Proceedings of SODA 2002, the 13th Annual ACM-SIAMSymposium on Discrete Algorithms, pages 166–173, Philadelphia, PA, USA,2002. Society for Industrial and Applied Mathematics.

[67] R. Kawano and T. Miyazaki. Distributed data aggregation in multi-sink sensornetworks using a graph coloring algorithm. In Proceedings of AINAW 2008,the 22nd International Conference on Advanced Information Networking andApplications – Workshops, pages 934–940, March 2008.

[68] D. Kim, Y. Wu, Y. Li, F. Zou, and D.-Z. Du. Constructing minimum connecteddominating sets with bounded diameters in wireless networks. IEEETransactions on Parallel and Distributed Systems, 20(2):147–157, Feb 2009.

[69] S. Kim, S. Pakzad, D. Culler, J. Demmel, G. Fenves, S. Glaser, and M. Turon.Health monitoring of civil infrastructures using wireless sensor networks. InProceedings of IPSN 2007, the 6th International Symposium on InformationProcessing in Sensor Networks, pages 254–263, April 2007.

[70] Y. Kim, T. Schmid, Z. M. Charbiwala, J. Friedman, and M. B. Srivastava.NAWMS: nonintrusive autonomous water monitoring system. In Proceedingsof SenSys 2008, the 6th ACM Conference on Embedded Networked SensorSystems, pages 309–322. IEEE Communications Society, 2008.

[71] L. Kong, M. Xia, X.-Y. Liu, M.-Y. Wu, and X. Liu. Data loss andreconstruction in sensor networks. In Proceedings of INFOCOM 2013, the32nd IEEE International Conference on Computer Communications, pages1654–1662. IEEE Computer Society, April 2013.

[72] J. Korhonen. Introduction to 3G Mobile Communications. Artech House, Inc.,Norwood, MA, USA, 2001.

[73] M. Z. Lagerkvist. Techniques for Efficient Constraint Propagation. RoyalInstitute of Technology (KTH), Stockholm, Sweden, November 2008.Licentiate Thesis.

[74] J.-J. Lee, B. Krishnamachari, and C.-C. Kuo. Impact of heterogeneousdeployment on lifetime sensing coverage in sensor networks. In Proceedingsof SECON 2004, the 1st Annual IEEE Communications Society Conference onSensor Mesh and Ad Hoc Communications and Networks, pages 367–376.IEEE Communications Society Press, 2004.

[75] K. Lee, S. Hong, S. J. Kim, I. Rhee, and S. Chong. SLAW: A new mobilitymodel for human walks. In Proceedings of INFOCOM 2009, the 28th IEEEInternational Conference on Computer Communications, pages 855–863.IEEE Communications Society Press, April 2009.

[76] L. Li and J. Halpern. Minimum-energy mobile wireless networks revisited. InProceedings of ICC 2001, the IEEE International Conference onCommunications, volume 1, pages 278–283. IEEE Communications Society,Jun 2001.

60

Page 61: Constraint Programming for Wireless Sensor Networks

[77] K. Lorincz, B.-r. Chen, G. W. Challen, A. R. Chowdhury, S. Patel, P. Bonato,and M. Welsh. Mercury: A wearable sensor network platform for high-fidelitymotion analysis. In Proceedings of SenSys 2009, the 7th ACM Conference onEmbedded Networked Sensor Systems, pages 183–196, New York, NY, USA,2009. ACM Press.

[78] G. Luger. Artificial Intelligence: Structures and Strategies for ComplexProblem Solving. Pearson Addison Wesley, fifth edition, 2004.

[79] R. Madan and S. Lall. Distributed algorithms for maximum lifetime routing inwireless sensor networks. IEEE Transactions on Wireless Communications,5(8):2185–2193, Aug 2006.

[80] S. Madden. Intel lab data, 2004. Available fromhttp://www.select.cs.cmu.edu/data/labapp3/index.html, 2014.

[81] S. Meguerdichian, F. Koushanfar, M. Potkonjak, and M. Srivastava. Coverageproblems in wireless ad-hoc sensor networks. In Proceedings of INFOCOM2001, the 12th Annual Joint Conference of the IEEE Computer andCommunications Societies., volume 3, pages 1380–1387. IEEECommunications Society Press, 2001.

[82] M. Moffitt, A. Ng, I. Markov, and M. Pollack. Constraint-driven floorplanrepair. In Proceedings of DAC 2006, the 43rd ACM/IEEE Design AutomationConference, pages 1103–1108. IEEE Communications Society Press, 2006.

[83] J.-N. Monette, P. Flener, and J. Pearson. Towards solver-independentpropagators. In M. Milano, editor, Proceeedings of the CP 2012, the 18thinternational conference on Principles and Practice of ConstraintProgramming, Lecture Notes in Computer Science, pages 544–560. SpringerBerlin Heidelberg, 2012.

[84] L. Mottola and G. P. Picco. Logical neighborhoods: A programmingabstraction for wireless sensor networks. In P. Gibbons, T. Abdelzaher,J. Aspnes, and R. Rao, editors, Distributed Computing in Sensor Systems,volume 4026 of Lecture Notes in Computer Science, pages 150–168. SpringerBerlin Heidelberg, 2006.

[85] S. O. Murphy, K. N. Brown, and C. Sreenan. Problem decomposition forevacuation simulation using network flow. In Proceedings of DS-RT 2012, the16th IEEE/ACM International Symposium on Distributed Simulation and RealTime Applications, pages 101–108, Washington, DC, USA, 2012. IEEEComputer Society.

[86] N. Nakajima and Y. Yamao. Development for 4th generation mobilecommunications. Wireless Communications and Mobile Computing,1(1):3–12, 2001.

[87] G. L. Nemhauser and L. A. Wolsey. Integer and Combinatorial Optimization.Wiley-Interscience, New York, NY, USA, 1988.

[88] E. Nering and A. Tucker. Linear Programs and Related Problems. Computerscience and scientific computing. Academic Press, 1993.

[89] R. Newton, Arvind, and M. Welsh. Building up to macroprogramming: Anintermediate language for sensor networks. In Proceedings of IPSN 2005, the4th International Symposium on Information Processing in Sensor Networks,pages 37–44. IEEE Communications Society Press, April 2005.

61

Page 62: Constraint Programming for Wireless Sensor Networks

[90] R. Newton and M. Welsh. Region streams: Functional macroprogramming forsensor networks. In Proceeedings of DMSN 2004, the 1st InternationalWorkshop on Data Management for Sensor Networks, pages 78–87, New York,NY, USA, 2004. ACM Press.

[91] R. R. Newton, L. D. Girod, M. B. Craig, S. R. Madden, and J. G. Morrisett.Design and evaluation of a compiler for embedded stream programs. InProceedings of LCTES 2008, the ACM SIGPLAN-SIGBED Conference onLanguages, Compilers, and Tools for Embedded Systems, pages 131–140, NewYork, NY, USA, 2008. ACM Press.

[92] C. Park, J. Liu, and P. Chou. Eco: An ultra-compact low-power wirelesssensor node for real-time motion monitoring. In Proceedings of IPSN 2005,the 4th International Symposium on Information Processing in SensorNetworks, pages 398–403. IEEE Communications Society Press, April 2005.

[93] A. Pathak and M. K. Gowda. Srijan: A graphical toolkit for sensor networkmacroprogramming. In Proceedings of ESEC/FSE 2009, the7th Joint Meetingof the European Software Engineering Conference and the ACM SIGSOFTSymposium on The Foundations of Software Engineering, pages 301–302, NewYork, NY, USA, 2009. ACM Press.

[94] A. Pathak, L. Mottola, A. Bakshi, V. K. Prasanna, and G. P. Picco. Acompilation framework for macroprogramming networked sensors. InJ. Aspnes, C. Scheideler, A. Arora, and S. Madden, editors, DistributedComputing in Sensor Systems, volume 4549 of Lecture Notes in ComputerScience, pages 189–204. Springer Berlin Heidelberg, 2007.

[95] A. Pathak, L. Mottola, A. Bakshi, V. K. Prasanna, and G. P. Picco. Expressingsensor network interaction patterns using data-driven macroprogramming. InProceedings of PerCom 2007, the 5th Annual IEEE International Conferenceon Pervasive Computing and Communications, pages 255–260. IEEECommunications Society Press, March 2007.

[96] A. Pathak and V. K. Prasanna. Issues in designing a compilation frameworkfor macroprogrammed networked sensor systems. In Proceedings ofInterSense 2006, the 1st International Conference on Integrated Internet AdHoc and Sensor Networks, pages 1–8, New York, NY, USA, 2006. ACM Press.

[97] A. Pathak and V. K. Prasanna. Energy-efficient task mapping for data-drivensensor network macroprogramming. IEEE Transactions on Computers,59(7):955–968, July 2010.

[98] M. Patil and R. Biradar. A survey on routing protocols in wireless sensornetworks. In Proceedings of ICON 2012, the 18th IEEE InternationalConference on Networks, pages 86–91. IEEE Computer Society, Dec 2012.

[99] G. Pesant. A regular language membership constraint for finite sequences ofvariables. In M. Wallace, editor, Proceedings of CP 2004, the 10thInternational Conference on Principles and Practice of ConstraintProgramming, volume 3258 of LNCS, pages 482–495. Springer-Verlag, 2004.

[100] L. Quesada, K. N. Brown, B. OSullivan, L. Sitanayah, and C. J. Sreenan. Aconstraint programming approach to the additional relay placement problem inwireless sensor networks. In Proceedings of ICTAI 2013, the 25thInternational Conference on Tools with Artificial Intelligence, pages1052–1059. IEEE Computer Society, 2013.

62

Page 63: Constraint Programming for Wireless Sensor Networks

[101] Raspberry Pi, 2014. Available from http://www.raspberrypi.org.[102] I. Rhee, M. Shin, S. Hong, K. Lee, and S. Chong. On the Levy-Walk nature of

human mobility. In Proceedings of INFOCOM 2008, the 27th IEEEInternational Conference on Computer Communications, pages 924–932.IEEE Communications Society Press, April 2008.

[103] I. Rhee, M. Shin, S. Hong, K. Lee, S. Kim, and S. Chong. CRAWDAD: DailyGPS track log collected from Disney World, Florida, USA. Available fromhttp://crawdad.cs.dartmouth.edu/ncsu/mobilitymodels/GPS/Disney_World, 2009.

[104] I. Rhee, M. Shin, S. Hong, K. Lee, S. Kim, and S. Chong. CRAWDAD DailyGPS track log collected from State Fair, North Carolina, USA. Available fromhttp://crawdad.cs.dartmouth.edu/ncsu/mobilitymodels/GPS/NC_State_Fair, July 2009.

[105] F. Rossi, P. van Beek, and T. Walsh, editors. Handbook of ConstraintProgramming. Elsevier, 2006.

[106] C. Rotar, M. RÎsteiu, I. Ileana, and C.-T. Hutanu. Optimal sensors networklayout using evolutionary algorithms. In Proceedings of ICAI 2009, the 10thInternational Conference on Automation & Information, pages 88–93, StevensPoint, Wisconsin, USA, 2009. World Scientific and Engineering Academy andSociety.

[107] J. Roy and I. Markov. Eco-system: Embracing the change in placement. IEEETransactions on Computer-Aided Design of Integrated Circuits and Systems,26(12):2173–2185, Dec 2007.

[108] S. Sahni and X. Xu. Algorithms for wireless sensor networks. InternationalJournal of Distributed Sensor Networks, 1(1):35–56, 2005.

[109] C. Schulte. Course Notes Constraint Programming. Technical report, RoyalInstitute of Technology – KTH, Sweden, 2012. Available fromhttp://www.it.uu.se/edu/course/homepage/consprog/ht14/lectures/CourseNotes.pdf.

[110] T. Shu, M. Krunz, and S. Vrudhula. Power balanced coverage-timeoptimization for clustered wireless sensor networks. In Proceedings ofMobiHoc 2005, the 6th ACM International Symposium on Mobile Ad HocNetworking and Computing, pages 111–120, New York, NY, USA, 2005.ACM Press.

[111] H. Simonis and B. O’Sullivan. Search strategies for rectangle packing. InProceedings of CP 2008, the 14th International Conference on Principles andPractice of Constraint Programming, pages 52–66, Berlin, Heidelberg, 2008.Springer-Verlag.

[112] A. Sridharan and B. Krishnamachari. Max-min fair collision-free schedulingfor wireless sensor networks. In Proceedings of IPCCC 2004, the 23rd IEEEInternational Conference on Performance, Computing, and Communications,pages 585–590. IEEE Computer Society, 2004.

[113] N. C. state fair. Fairground maps, 2015. Available fromhttp://www.ncstatefair.org.

[114] J. Suomela. Optimisation problems in wireless sensor networks: localalgorithms and local graphs. PhD thesis, University of Helsinki, Faculty ofScience, Department of Computer Science, Finland, 2009.

63

Page 64: Constraint Programming for Wireless Sensor Networks

[115] M. Suzuki, S. Saruwatari, N. Kurata, and H. Morikawa. A high-densityearthquake monitoring system using wireless sensor networks. In Proceedingsof SenSys 2007, the 5th international conference on Embedded NetworkedSensor Systems, pages 373–374, New York, NY, USA, 2007. ACM Press.

[116] J. Tang, B. Hao, and A. Sen. Relay node placement in large scale wirelesssensor networks. Computer Communications, 29(4):490–501, Feb 2006.

[117] US Department of Transportation, Federal Highway Administration. Manualon uniform traffic control devices: Preemption and priority control of trafficcontrol signals. Available fromhttp://mutcd.fhwa.dot.gov/pdfs/2009r1r2/part4.pdf, 2012.

[118] A. Vallimayil, V. Dhulipala, K. Raghunath, and R. Chandrasekaran. Role ofrelay node in wireless sensor network: A survey. In Proceedings of ICECT2011, the 3rd International Conference on Electronics Computer Technology,volume 5, pages 160–167. IEEE Computer Society, April 2011.

[119] H. Wang, M. Uddin, G.-J. Qi, T. Huang, T. Abdelzaher, and G. Cao. PhotoNet:A similarity-aware image delivery service for situation awareness. InProceedings of IPSN 2011, the 10th International Conference on InformationProcessing in Sensor Networks, pages 135–136. IEEE CommunicationsSociety, April 2011.

[120] Y. Wang. Topology control for wireless sensor networks. In Y. Li, M. Thai,and W. Wu, editors, Wireless Sensor Networks and Applications, Signals andCommunication Technology, pages 113–147. Springer US, 2008.

[121] E. W. Weisstein. Combinatorics. From MathWorld–A Wolfram Web Resource.http://mathworld.wolfram.com/Combinatorics.html, 2014.

[122] G. Werner-Allen, K. Lorincz, M. Ruiz, O. Marcillo, J. Johnson, J. Lees, andM. Welsh. Deploying a wireless sensor network on an active volcano. IEEEJournal of Internet Computing, 10(2):18–25, March 2006.

[123] K. Whitehouse, C. Sharp, E. Brewer, and D. Culler. Hood: A neighborhoodabstraction for sensor networks. In Proceedings of MobiSys, the 2ndInternational Conference on Mobile Systems, Applications, and Services,pages 99–110, New York, NY, USA, 2004. ACM Press.

[124] J. Wu and H. Li. On calculating connected dominating set for efficient routingin ad hoc wireless networks. In Proceedings of DIALM 1999, the 3rdInternational Workshop on Discrete Algorithms and Methods for MobileComputing and Communications, pages 7–14, New York, NY, USA, 1999.ACM Press.

[125] X. Wu, K. N. Brown, and C. J. Sreenan. Data pre-forwarding for opportunisticdata collection in wireless sensor networks. ACM Transactions on SensorNetworks, 11(1):1–33, July 2014.

[126] Y. Wu and Y. Li. Construction algorithms for k-connected m-dominating setsin wireless sensor networks. In Proceedings of MobiHoc 2008, the 9th ACMInternational Symposium on Mobile Ad Hoc Networking and Computing,pages 83–90, New York, NY, USA, 2008. ACM Press.

[127] W. Ye and J. Heidemann. Medium access control in wireless sensor networks.In C. Raghavendra, K. M. Sivalingam, and T. Znati, editors, Wireless SensorNetworks, pages 73–91. Springer US, 2004.

64

Page 65: Constraint Programming for Wireless Sensor Networks

[128] J. Yick, B. Mukherjee, and D. Ghosal. Wireless sensor network survey.Computer Networks, 52(12):2292–2330, 2008.

[129] O. Yilmaz and K. Erciyes. Distributed weighted node shortest path routing forwireless sensor networks. In A. Özcan, N. Chaki, and D. Nagamalai, editors,Recent Trends in Wireless and Mobile Networks, volume 84 ofCommunications in Computer and Information Science, pages 304–314.Springer Berlin Heidelberg, 2010.

[130] Z. Yuanyuan, X. Jia, and H. Yanxiang. Energy efficient distributed connecteddominating sets construction in wireless sensor networks. In Proceedings ofIWCMC 2006, the International Conference on Wireless Communications andMobile Computing, pages 797–802, New York, NY, USA, 2006. ACM Press.

[131] Z. Z1, 2015. Available from http://www.zolertia.com/products/Z1.[132] Y. Zeng, S. O. Murphy, L. Sitanayah, T. Tabirca, T. Truong, K. Brown, and

C. Sreenan. Building fire emergency detection and response using wirelesssensor networks. In The 9th IT and T Conference. Dublin Institute ofTechnology, 2009.

[133] C. Zhang, A. Syed, Y. Cho, and J. Heidemann. Steam-powered sensing. InProceedings of SenSys 2011, the 9th ACM Conference on EmbeddedNetworked Sensor Systems, pages 204–217, New York, NY, USA, 2011. ACMPress.

65

Page 66: Constraint Programming for Wireless Sensor Networks

Appendix A.Additional Material for Paper I

In collaboration with Dr. Luis Quesada from the Cork Constraint ComputationCentre in Ireland, now called Insight Centre for Data Analytics, we have de-veloped improvements on our solution approach to the task-mapping problemof Paper I. In this appendix, we give the details of our additions and improve-ments to Paper I.

Energy-Efficient Task-MappingIn Paper I, we present a CP model for the task-mapping problem in a multi-hopheterogeneous WSN. We observe that our CP model outperforms an ILP for-mulation by at least one order of magnitude for the highway traffic instances.However, for the humidity, ventilation, and air conditioning (HVAC) instancesthe CP model is slower than the ILP formulation. This led us into investigat-ing the CP model further and we here propose an improvement that makesthis model perform faster than ILP on HVAC instances as well. Our improve-ment is based on exploiting the task graph structure and the energy spent forrouting data by the sensor nodes. We here introduce a new propagator calledmandatory node set (MNS). These results are not published yet due to timereasons.

Consider the notation in Section 3.1 of Paper I. The three-dimensional vec-tor energy[n,n′,n′′] denotes the energy spent by node n for routing one unit ofdata from node n′ to n′′. This implicitly associates every pair of sensor nodes n′and n′′ with a set of mandatory nodes, i.e., the set of sensor nodes whose con-sumption is greater than 0 when transmitting data from n′ to n′′. Let mn[n′,n′′]be the set of mandatory nodes associated with the ordered pair 〈n′,n′′〉: we saythat sensor node n1 is in mn[n′,n′′] if and only if energy[n,n′,n′′]> 0, that is:

mn[n′,n′′] = {n ∈ N | energy[n,n′,n′′]> 0}For example, Figure A.1 shows nodes n1 to n5 in a network, where nodesn3 and n4 are spending energy for routing the data from nodes n1 and n2 tonode n5: the mandatory node set for nodes n1 and n5 is mn[n1,n5] = {n3,n4};similarly the mandatory node set for nodes n2 and n5 is mn[n2,n5] = {n4}.

Our purpose is to take advantage of mandatory nodes for the early detectionof search failures given a partial assignment of tasks to sensor nodes. In our

66

Page 67: Constraint Programming for Wireless Sensor Networks

n4

n3

n2

n1

n5

Figure A.1. The routing for nodes n1 to n5, with mn[n1,n5] = {n3,n4} andmn[n2,n5] = {n4}.

model, we minimise the value of the cost c where energy[n]≤ c for all sensornodes n. Taking the energy constraint from Paper I, we have:

energy[n] = ∑(t ′,t ′′)∈A

f [t ′] · s[t ′, t ′′] · e[n,node[t ′],node[t ′′]] (∀n ∈ N)

Notice that the energy constraint has in fact a decomposition into ELEMENTand LINEAR constraints. The propagator for the ELEMENT constraint on eachedge (t ′, t ′′) spanning over several LINEAR constraints for each sensor noden would not detect a situation where any assignment from a task to a sensornode would cause the cost c to increase.

Given the set of mandatory nodes mn[n′,n′′], we define the set of the manda-tory nodes for an assignment to the edge (t ′, t ′′) in the task graph:

mnt[t ′, t ′′] =⋃

n′∈D(node[t ′]),n′′∈D(node[t ′′])

mn[n′,n′′]

Using the set of mandatory nodes allows us to devise the following property,which is essential in defining our pruning rule:

Property. An edge (t ′, t ′′) in the task graph indicates that in the mapping oftasks t ′ and t ′′ to sensor nodes n′ and n′′, at least one mandatory node in theset mnt[t ′, t ′′] will spend energy in routing data from sensor node n′ to sensornode n′′, if n′ = n′′ are in the assignment of node[t ′] and node[t ′′].

Given this property, we define the set of disjoint tasks dt[t] of all tasks thatmatch this property:

∀t ∈ T, dt[t] = {t ′ | (t, t ′) ∈ A ∧ D(node[t])∩D(node[t ′]) = /0}

Pruning Rule. Whenever a value is removed from the domain of task t, andthe set of disjoint tasks dt[t] is not empty (|dt[t]|> 0), we update the minimumof the domain of the energy cost c:

f [t] · ∑t ′∈dt[t]

s[t, t ′] · minn∈mnt[t,t ′]

energy[n,node[t],node[t ′]]≤ min(c) (A.1)

67

Page 68: Constraint Programming for Wireless Sensor Networks

If there exists at least one task t ′ in the set of disjoint tasks dt[t], then at leastone sensor node must pay the cost of routing the data generated by the task tfor task t ′. Therefore, in the mapping of the tasks t and t ′ to the nodes node[t]and node[t ′], at least one mandatory node in the set mnt[t, t ′] spends energyequal to minn∈mnt[t,t ′] energy[n,node[t],node[t ′]]. Hence the lower bound of thecost c can be increased by computing the minimum energy that must be spentfor routing the data multiplied by the size of the data and the firing rate of thetask t. In the special case where the elements of the energy matrix are 0 or 1(that is binary values), the value of the summation in the inequality (A.1) isequal to |dt[t]|.

We implement Pruning Rule A as a custom propagator called MNS forGecode [55]. Monette et al. [83] propose a rapid prototyping approach to gen-erate a propagator from its high-level description. We also use this approachto compare against the performance of our hand-written MNS propagator.

Table A.1 shows the results of our experiments with the original model ofPaper I versus the same model powered by the MNS propagator, the generatedpropagator MNSgenerated, both propagators, and the Gurobi ILP solver. Weonly compare our results with Gurobi solver here, because Gurobi solver pro-vides the shortest runtime among all the ILP solvers that we used in Paper I.In all cases the CP model is now faster than the ILP model of Paper I. We ob-serve that our custom propagator MNS performs equally with the propagatorMNSgenerated on the first three instances, while it outperforms MNSgenerated onall other instances. The combination of both the MNS and MNSgenerated prop-agators improves the runtimes on larger instances: this is expected because ofour dynamic search heuristic, which directs the search based on the maximumdegree of the variables in the constraints. Including both the MNS and theMNSgenerated propagators in the model implies an increase of the degree of thevariables, and hence improves the dynamics of our maximum-degree variableordering.

68

Page 69: Constraint Programming for Wireless Sensor Networks

HVAC Gecode Gecode+MNS Gecode+MNSgenerated

Gecode+MNS+MNSgenerated

Gurobi

〈|N|, |T|〉 timeopt cost timeopt cost timeopt cost timeopt cost timeopt cost

〈7,6〉 < 0.01 10 < 0.01 10 < 0.01 10 < 0.01 10 0.01 10〈11,9〉 < 0.01 60 < 0.01 60 < 0.01 60 < 0.01 60 0.01 60〈23,18〉 0.01 480 < 0.01 480 < 0.01 480 < 0.01 480 0.01 480〈34,26〉 0.02 1080 0.01 1080 0.01 1080 0.01 1080 0.02 1080〈43,33〉 0.05 1980 0.02 1980 0.03 1980 0.02 1980 0.03 1980〈54,41〉 0.09 3080 0.03 3080 0.05 3080 0.04 3080 0.06 3080〈66,50〉 0.16 4760 0.07 4760 0.10 4760 0.07 4760 0.11 4760〈74,56〉 0.26 6080 0.11 6080 0.15 6080 0.10 6080 0.18 6080〈86,65〉 0.42 8360 0.19 8360 0.27 8360 0.20 8360 0.37 8360〈97,73〉 0.67 10500 0.29 10500 0.39 10500 0.28 10500 0.59 10500〈106,80〉 0.93 12960 0.40 12960 0.57 12960 0.39 12960 0.81 12960

〈192,144〉 8.10 43120 3.76 43120 5.02 43120 3.68 43120 3.90 43120

Table A.1. HVAC instances solved using the original model of Paper I versus themodel with the MNS custom propagator, the model with the generated MNSgeneratedpropagator, the model including both the MNS and MNSgenerated propagators, andthe original ILP model solved with the Gurobi solver. The time unit is seconds, andthe boldface values indicate the best time to prove optimality for the correspondinginstance, where none are given beyond a tenth of a second.

69

Page 70: Constraint Programming for Wireless Sensor Networks

Appendix B.Additional Material for Paper II

We initially modelled the problem of Paper II using CP and submitted our re-sults to the IEEE International Conference on Tools with Artificial Intelligence(ICTAI) 2012, where it was only accepted as a poster paper (two pages in theproceedings), so we decided to decline the acceptance. We then developed theILP model of Paper II, which outperformed our CP model in runtime and gaveproofs of optimality in much shorter time. Therefore, we only published ourILP results in Paper II. For the record, the complete CP model and results aregiven below the way they were submitted to ICTAI 2012.

Abstract ModelWe model the optimisation problem as a sequence of constraint satisfactionproblems (CSPs), starting from an upper bound on the number of stationarysensors and lowering it whenever a CSP is solved before timing out on anamount of time allocated per CSP. Let S be the targeted number of deployedsensors of such a CSP. The main decision variables are as follows:

• Let p[k] denote the cell (i, j) of the sensing field where sensor k is placed,with 1 ≤ i, j ≤ N and 1 ≤ k ≤ S.

In order to express the coverage constraints, it is convenient to introduce addi-tional decision variables c for the coverage provided by the stationary sensors:

• Let c[(i, j),k] denote the coverage provided by sensor k at cell (i, j) ofthe sensing field, where 1 ≤ i, j ≤ N and 1 ≤ k ≤ S; the domain is the setof values in the sensing mask Z, plus the value 0 (if it is not in Z).

The channelling constraints between the coverage matrix c and the placementvector p are as follows:

∀i, j,α,β ,k (1 ≤ i, j,α,β ≤ N, 1 ≤ k ≤ S) :

p[k] = (α,β ) ⇔ c[(i, j),k] =

⎧⎪⎨⎪⎩

Z[i−α +B, j−β +B] if |i−α|< Band | j−β |< B

0 otherwise(B.1)

Figure B.1 depicts the channelling in constraints (B.1) for a sensing field ofsize N = 10 and the sensing mask of Figure B.2 with B = 4.

To force the S deployed sensors to satisfy the coverage required for all N2

cells, we constrain the sum for each cell (i, j) of the coverage provided by the

70

Page 71: Constraint Programming for Wireless Sensor Networks

18 24 28 30 28 24 18

24 32 41 45 41 32 24 18 24 28 30 28 24 18

28 41 57 67 57 41 28 24 32 41 45 41 32 24

30 45 67 100 67 45 30 28 41 57 67 57 41 28

28 41 57 67 57 41 28 30 45 67 100 67 45 30

24 32 41 45 41 32 24 28 41 57 67 57 41 28

18 24 28 30 28 24 18 24 32 41 45 41 32 24

18 24 28 30 28 24 18

p[k] = (α,β)

c[_,k] β

α

Z B

B

N =10

Figure B.1. Channelling of the sensing mask Z and the sensing field according to theposition of sensor k.

mobile phones and the coverage obtained by the stationary sensors, to be atleast the required coverage R[i, j]:

∀i, j (1 ≤ i, j ≤ N) : M[i, j]+S

∑k=1

c[(i, j),k]≥ R[i, j] (B.2)

Just like for the construction of M in preprocessing, we here use the additivecoverage model of [74].

The CP ModelWe now present our CP implementation of the abstract model. In the actualimplementation, the coordinate values (i, j) for the p[k] decision variables areflattened into i ·N+ j values, but we do not do so here for ease of presentation.

We express the channelling constraints (B.1) through regular expressions,which provides a convenient interface for the specification of extensional con-straints [13, 99]. Toward this, in order to simplify the presentation, we firstpad the matrix c on all sides with B− 1 extra rows and columns of decisionvariables. Let c′ be the padded coverage matrix, as illustrated in Figure B.3for a sensing field of size N = 10, a sensing mask with B = 4, and a particularsensor k placed at coordinates (6,9). (The reader can ignore the red and blueboxes of Figure B.3 at this moment.)

The regular expression r is as follows:

0∗Z[1,_]0N−1Z[2,_]0N−1 . . .Z[2·B−2,_]0N−1Z[2·B−1,_]0∗

where the first 0∗ allows the sensing mask to be placed at any cell (i, j) ofthe padded matrix c′, followed by Z[1,_], which denotes the first row of the

71

Page 72: Constraint Programming for Wireless Sensor Networks

1

1 18 24 28 30 28 24 18

24 32 41 45 41 32 24

28 41 57 67 57 41 28

30 45 67 100 67 45 30

28 41 57 67 57 41 28

24 32 41 45 41 32 24

18 24 28 30 28 24 18

Z : i

j

B

B

B

B

Figure B.2. Sensing mask Z based on the Euclidean distance metric forMaxCoverageRange = 400 m, CellSize = 100 m, and γ = 0.004, giving B = 4.

sensing mask Z, followed by N − 1 zeros, etc, followed by the last row ofZ, followed by any number of zeros (see Figure B.3). We then constrain eachslice c′[_,k] of the padded coverage matrix with the regular expression r, usinga collection of regular constraints:

∀k (1 ≤ k ≤ S) : regular(c′[_,k],r)

The regular expression r however cannot avoid placing the centre (with value100) of the sensing mask Z (that is, a sensor) on the padding decision variablesof c′. A sensor is required to be placed only within the original matrix c, sothe following constraints are added to force the centre of the sensing mask Zto be inside the non-padding area of c′:

∀(i, j),k ((i, j) ∈ padding area, 1 ≤ k ≤ S) : c′[(i, j),k] = 100

Finally, an element constraint is used to assure the channelling constraints (B.1)by indexing the padded coverage matrix c′ with the elements of the placementvector p, for getting the centre (with value 100) of the sensing mask:

∀k (1 ≤ k ≤ S) : element(c′[_,k], p[k],100)

Our usage of the regular constraint was inspired by the solution of the pen-tomino problem in [73].

The coverage matrix c is replaced by the padded coverage matrix c′ in thecoverage constraints (B.2), giving:

∀i, j (1 ≤ i, j ≤ N) : M[i, j]+S

∑k=1

c′[(i, j),k]≥ R[i, j]

These constraints do not apply to the padding area of the matrix c′, as zerocoverage outside the original grid is required.

72

Page 73: Constraint Programming for Wireless Sensor Networks

1

9

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 18 24 28 30 28 24 18 0

0 0 0 0 0 0 0 0 24 32 41 45 41 32 24 0

0 0 0 0 0 0 0 0 28 41 57 67 57 41 28 0

6 0 0 0 0 0 0 0 0 30 45 67 100 67 45 30 0

0 0 0 0 0 0 0 0 28 41 57 67 57 41 28 0

0 0 0 0 0 0 0 0 24 32 41 45 41 32 24 0

0 0 0 0 0 0 0 0 18 24 28 30 28 24 18 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

′c [_,k]

0*

Z[1,_]Z[2,_]Z[3,_]Z[4,_]Z[5,_]Z[6,_]Z[7,_]

B −1 N B −1

09

0909

09

09

09

0*

N

N

Figure B.3. The padded coverage matrix c′[_,k] for a particular sensor k, and theregular expression for a sensing field of size N = 10, and a sensing mask Z withB = 4. For the sake of clarity, the one-dimensional slice c′[_,k] is here represented intwo dimensions.

In our problem instances, the maximum coverage required by the sensors isequal to the maximum of the sensing mask Z (maxR = maxZ = 100), so thatwe never need to place two sensors at the same cell. As a result, an impliedconstraint that the placement decision variables are all different is added:

alldifferent(p) (B.3)

The CP model has (N +2 ·B−1)2 ·S+S decision variables, and N2 +2 ·S+4 · (B−1) · (N +B−1) ·S+1 constraints.

The Search ProcedureThe custom search procedure MaxMissing shown in Algorithm 3 selects aplacement decision variable p[k] (line 2) in left to right order, due to a fullvariable symmetry.

For the value selection strategy, we define the missing requirement at a cell(i, j) of the sensing field to be the current difference between the requiredcoverage and the sum of the coverage provided by both the mobile phones and

73

Page 74: Constraint Programming for Wireless Sensor Networks

Algorithm 3: The MaxMissing search procedure1 Procedure MaxMissing2 for k := 1 to S do

3 selectMax ((i, j) ∈ dom(p[k]))(R[i, j]−

(M[i, j]+

S

∑k′=1

min(dom

(c′[(i, j),k′]

))))

4 try p[k] = (i, j) or p[k] = (i, j) end try

the deployed stationary sensors:

∀i, j (1 ≤ i, j ≤ N) :

missing[i, j] = R[i, j] −(

M[i, j]+S

∑k=1

min(dom

(c′[(i, j),k]

)))

where dom(x) represents the current domain of decision variable x. Through-out the search, as we place a sensor on a cell, the missing requirement val-ues decrease. Our value selection strategy randomly selects (implemented asthe selectMax operator) coordinates with the maximum missing requirement(line 3), and tries to place the chosen sensor at the chosen cell (line 4).

Upper Bound on the Number of Deployed SensorsWe start search from the following upper bound on the number S of sensors tobe deployed:

Sup =

(⌈N −1Q−1

⌉+1

)2

(B.4)

where Q is the size of the largest square area that can be covered with fourcopies of the sensing mask, assuming there is max(R−M) missing require-ment.

For example, Figure B.4(a) shows the largest square area that can be cov-ered with four sensors of the mask Z of Figure B.2, with missing requirementmax(R−M) = 70. The overlapping area of the four sensing masks is shownin grey colour in Figure B.4(a). The size of the overlapping area depends onthe mask size B and the maximum of the missing requirement matrix (that is,max(R−M)).

The sensing field can be tiled with the overlapping area to achieve at leastthe missing requirement max(R−M). The tiling is done such that two over-lapping areas share the cells on the edges (the sensors are shared) as shown inFigure B.4(b). We need

⌈N−1Q−1

⌉tiles consisting of

⌈N−1Q−1

⌉+1 sensors in each

dimension of the sensing field to provide complete coverage. For example,

74

Page 75: Constraint Programming for Wireless Sensor Networks

100 100 100 100

100 100

100 100 100 100

100 100

100 100 100 100

100 100 100 100

Figure B.4. (a) The largest square area (shaded in grey) that can be covered with fourcopies of the sensing mask Z in Figure B.2, with B= 4 and maxR−M = 70. (b) Tilingthe overlapping area with Q = 5 over a sensing field of size N = 10

given a sensing field of size N = 10, and the overlapping area of size Q = 5in Figure B.4(a), we require at least

⌈10−15−1

⌉= 3 tiles of the overlapping area

(consisting of 4 sensors in each dimension of the sensing field) to cover com-pletely the sensing field, therefore the upper bound for the number of sensorsbecomes Sup = (3+1)2 = 16.

ExperimentsWe experiment with mobile traces collected by participating visitors to Dis-ney World (Orlando, Florida, USA) [75, 102, 103], where noise level and pic-tures are collected by mobile phone users. The instance data cover an areaof approximately 16 km by 8 km. For the first instance, we choose a squaresensing field of 1 km by 1 km at the centre of that area. This sensing fieldis divided into N2 = 100 cells of CellSize = 100 meters. In all other in-stances, we keep CellSize = 100 meters, and increase N by one, and there-fore the sensing field is expanded by CellSize

2 meters on each side. We alsoset MaxCoverageRange = 400 meters and γ = 0.004, resulting in the sensingmask of Figure B.2, with B = 4.

Our CP model is implemented in Gecode [55] (revision 3.5.0)1 and runsunder Linux OpenSuse 11.3 (64 bit) on an Intel Core i7 950 3.07 GHz with8 MB L2 cache and 3 GB RAM.1Available from http://www.gecode.org/

75

Page 76: Constraint Programming for Wireless Sensor Networks

We have implemented several other CP models, with much longer runtimesor less good solutions, and we here present our best model, seeing no point incomparing it to the poorer ones.

The selectMax random choice operator in line 3 of our search procedureintroduces a strong variation in the runtime results of the same instance. In allour instances, out of five runs, there is at least one run where a solution is foundin less than 10 seconds. Therefore, in our experiments we set the timeout to 10seconds for each run of a CSP. The optimisation is done by solving a sequenceof CSPs, and it restarts up to four times if a timeout occurs. Each restartbenefits from the improved bound on the number of sensors achieved by theprevious run of the same CSP.

On our data sets, the upper bound of (B.4) is an optimistic overestimate ofthe optimal number of sensors required for complete coverage (because ourcurrent upper bound only takes the maximum value of R−M into account,but not its other values). When N gets large (more than 30, where solverruns out of memory on the chosen hardware) the size and number of regularconstraints contributes a significant overhead to both posting the constraints ofthe problem and solving it (there are S such constraints, each over N2 decisionsvariables). This overhead can be reduced by reducing Sup to a smaller value.Experiments have shown that on our dataset the optimal number of sensorrequired is always at most N, therefore we have set our initial value of Sup toN.

Table B.1 presents the results of the experiments starting from grid sizeN = 10 up to N = 60. Column S shows the computed number of sensors to bedeployed. For N ≥ 56, memory runs out regardless of the value of the upperbound Sup. The total time to solve all the CSPs (including up to five timeoutsfor each CSP) is given in the Time column in seconds. No proof of optimalitywas achieved for any instances before timing out. We ran some experimentswith a longer timeout (up to 30 minutes), and there was not any significantimprovement in the solution quality. Thus, we set the timeout to 10 seconds.We strongly suspect that the solutions presented here are very close to theoptimal solution. Also note that the implied constraint (B.3) is crucial for allinstances, as it improves the runtimes by at least one order of magnitude. Incomparison, our direct ILP model presented in Paper II performs better thanthis CP model and solves larger instances in shorter time.

76

Page 77: Constraint Programming for Wireless Sensor Networks

N S Time N S Time N S Time

10 7 50.165 26 23 58.647 42 36 65.889

11 9 51.130 27 23 57.715 43 35 93.643

12 10 52.716 28 24 57.216 44 36 531.285

13 11 82.331 29 26 52.821 45 35 124.717

14 12 54.197 30 28 83.206 46 34 175.681

15 13 51.505 31 27 54.018 47 44 149.548

16 13 55.288 32 28 65.247 48 38 293.891

17 17 51.073 33 27 97.456 49 37 366.174

18 17 50.450 34 30 88.867 50 37 167.855

19 17 74.923 35 29 88.464 51 37 177.720

20 20 60.439 36 30 100.464 52 36 333.621

21 18 61.361 37 31 59.954 53 39 916.150

22 18 65.637 38 31 106.371 54 42 710.184

23 18 67.335 39 31 75.751 55 48 800.091

24 20 96.240 40 35 94.008 56 − −25 21 67.228 41 35 101.308

Table B.1. The experiment results represent the grid size N, and the computed numberS of sensors to be deployed. The total time to solve all the CSPs is given in the Timecolumn in seconds, where the total time is the sum of the runtimes of the CSPs in eachinstance. The total time Time includes the 10 second timeout at least for the five runsof the CSP with S−1 sensors. The solver runs out of memory on the chosen hardwarebefore reaching a solution for instances of size N ≥ 56, which is shown by ‘–’.

77

Page 78: Constraint Programming for Wireless Sensor Networks

Appendix C.Background Material for Paper IV

This appendix provides additional material required to read Paper IV. We firstexplain how we compute the cumulative distribution function (c.d.f) of theminimum and maximum of independent random variables (here we presenta different approach than the order statistics to compute the c.d.f). We thenexpress how we compute the c.d.f of the sum of normal random variables (ourmethod avoids computing the c.d.f of the normal distribution using numericalmethods).

Maximum and Minimum of Random VariablesAs shown in [9, 39], order statistics is a method to find the c.d.f of the k-thrandom variable in an ascendingly sorted list of n independent random vari-ables. The c.d.f of the maximum (minimum) random variable is then the c.d.fof the 1-st and n-th order statistic variable. However, here we show anothermethod to find the c.d.f of the maximum and minimum of independent randomvariables, which is more intuitive and simpler compared to the order statisticsmethod.

Let X1,X2, . . . ,Xn denote n independent random variables, with F1,F2, . . . ,Fndenoting the successive c.d.f of these random variables. We define the randomvariables X(1) and X(n) to denote the minimum and maximum of the n randomvariables:

X(1) = min{X1,X2, . . . ,Xn}X(n) = max{X1,X2, . . . ,Xn} (C.1)

Similarly, we let F(1) and F(n) denote the minimum and maximum c.d.f of therandom variables X(1) and X(n). According to (C.1) we have:

F(1)(t) = P(min{X1,X2, . . . ,Xn} ≤ t)F(n)(t) = P(max{X1,X2, . . . ,Xn} ≤ t)

where P(V ≤ t) represents the probability that the random variable V takes avalue that is at most t. Hence P(X(1) ≤ t) requires that the probability of theminimum of n random variables be at most t.

We compute F(1)(t) and F(n)(t) in terms of F1,F2, . . . ,Fn. We first com-pute the c.d.f of the minimum F(1)(t) of the random variables as required in

78

Page 79: Constraint Programming for Wireless Sensor Networks

Paper IV:

F(1)(t) = P(X(1) ≤ t)

= P(min{X1,X2, . . . ,Xn} ≤ t)= 1−P(min{X1,X2, . . . ,Xn}> t) (C.2)= 1−P(X1 > t ∧X2 > t ∧·· ·∧Xn > t) (C.3)

= 1−(

n

∏i=1

P(Xi > t)

)(C.4)

= 1−(

n

∏i=1

(1−P(Xi ≤ t))

)

= 1−(

n

∏i=1

(1−Fi(t))

)(C.5)

In Equation (C.2), the probability that the minimum of the random variablesis larger than t is equivalent to the probability that all the n random variablestake a value larger than t, hence the Equation (C.3). If the random variablesare independent, then the joint probability of the n random variables is equalto the product of their probabilities [61]: see Equation (C.4). We then rewriteEquation (C.4) to the c.d.f notation: see Equation (C.5). Similarly, the c.d.f ofthe maximum of n independent random variables is computed as follows:

F(n)(t) = P(X(n) ≤ t)

= P(max{X1,X2, . . . ,Xn} ≤ t)= P(X1 ≤ t ∧X2 ≤ t ∧·· ·∧Xn ≤ t)

=

(n

∏i=1

Fi(t)

)

Standard Normal DistributionWe consider the delay random variable in Paper IV to have normal distributionN(μ,σ2) with c.d.f Φμ,σ2 , where μ and σ are the mean and standard deviationof the normal distribution, respectively. However, in practice, the value ofΦμ,σ2 is only numerically computable as opposed to a given analytical term.We use the standard form of the normal distribution with mean 0 and variance1 (that is N(0,1)) to simplify the computations. The value of the c.d.f of anynormal distribution Φμ,σ2 can be computed as follows using only the standardnormal distribution [61]:

Φμ,σ2(t) = Φ0,1

(t −μσ2

)

79

Page 80: Constraint Programming for Wireless Sensor Networks

We then use the error function algorithm, called the stand-alone error funtion,from [2] to compute the value of the c.d.f of the standard normal distributionin Paper IV.

80

Page 81: Constraint Programming for Wireless Sensor Networks
Page 82: Constraint Programming for Wireless Sensor Networks

Acta Universitatis UpsaliensisDigital Comprehensive Summaries of Uppsala Dissertationsfrom the Faculty of Science and Technology 1219

Editor: The Dean of the Faculty of Science and Technology

A doctoral dissertation from the Faculty of Science andTechnology, Uppsala University, is usually a summary of anumber of papers. A few copies of the complete dissertationare kept at major Swedish research libraries, while thesummary alone is distributed internationally throughthe series Digital Comprehensive Summaries of UppsalaDissertations from the Faculty of Science and Technology.(Prior to January, 2005, the series was published under thetitle “Comprehensive Summaries of Uppsala Dissertationsfrom the Faculty of Science and Technology”.)

Distribution: publications.uu.seurn:nbn:se:uu:diva-241378

ACTAUNIVERSITATIS

UPSALIENSISUPPSALA

2015