# A Small World Graph Approach for an Efficient Indoor Positioning System

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

#### 2.1. Scenario Analysis and Fingerprint

#### 2.2. Computational Cost Reduction

#### 2.3. Efficiency without Loss of Information

## 3. IPS Using Hierarchical Navigable Small World Graphs

Algorithm 1: HNSW graph generation and search overview. | |

▷ Global Variables: | |

1: trainingDataset; | {Complete KNN training dataset} |

2: hnswGraph; | {HNSW multilayer graph} |

3: topLayer; | {Maximum, top layer of the hnswGraph} |

4: entryPoint; | {Entry point for the hnswGraph} |

5: mL; | {Normalization factor for level definition} |

6: ef; | {Number of nearest neighbors to use} |

▷ Function: | |

7: hnswGraphGeneration() | {Generate hnswGraph from trainingDataset} |

Action: | |

8: for each element newElement from trainingDataset do | |

9: maxLayer ← ⌊−ln(uniform(0 ... 1)) × mL⌋; | {Compute the maximum layer of the element} |

10: if entryPoint = = nil then | {First inserted element.} |

11: topLayer ← maxLayer; | |

12: entryPoint ← newElement; | {Sets the entry point for the hnswGraph} |

13: next; | |

14: end if | |

{Search the nearestNode already in hnswGraph starting from the topLayer until maxLayer} | |

15: nearestNodes = entryPoint; | |

16: for currentLayer ← topLayer ... maxLayer do | |

17: nearestNodes ← searchLayer(newElement, nearestNodes, currentLayer); | |

18: end for | |

{Insert the newElement in all of the layers from maxLayer to layer 0} | |

19: for currentLayer ← maxLayer ... 0 do | |

20: nearestNodes ← searchLayer(newElement, nearestNodes, currentLayer); | |

21: neighbors ← selecNeighbors(newElement, nearestNodes, currentLayer); | |

22: insertElement(newElement, currentLayer, neighbors); | |

23: end for | |

24: if maxLayer > topLayer then | |

25: topLayer ← maxLayer; | |

26: entryPoint ← newElement; | {Set entry point for hnswGraph to newElement} |

27: end if | |

28: end for | |

▷ Function: | |

29: hnswSearch(element) | {Search nearest nodes for element from trainingDataset} |

Action: | |

30: {Search the element in hnswGraph starting from the topLayer until 0} | |

31: nearestNodes = entryPoint; | |

32: for currentLayer ← topLayer . . . 0 do | |

33: nearestNodes ← searchLayer(newElement, currentLayer, nearestNodes); | |

34: end for | |

35: return nearestNodes; | |

▷ Function: | |

36: searchLayer(element, nearestNodes, layer) | {Search the ef nearest nodes for element in layer} |

37: | {using nearestNodes as enter points.} |

Action: | |

38: nearestNodes ← {Greedy graph search algorithm as described in [16]} | |

39: return nearestNodes; |

## 4. Performance Evaluation

#### 4.1. Methodology and Datasets

- Synthetic Indoor Positioning Dataset
- SmartCampus Indoor Positioning Dataset
- UJI Indoor Localization Dataset

#### 4.1.1. Synthetic Indoor Positioning Dataset

#### 4.1.2. SmartCampus Indoor Positioning Dataset

- Automatic student attendance record keeping;
- Checking whether a student is in the classroom he is supposed to be;
- Entry and exit control of students from the school;
- Where the student sits inside the classroom;
- Interaction among students and friend groups.

#### 4.1.3. UJI Indoor Localization Dataset

^{2}with three different buildings comprising 4 to 5 floors. There is a total of 520 routers with a total of 21,049 samples. The data were collected by more than 20 users with 25 different mobile device models.

#### 4.2. Impact of the Number of Samples on the Classification

#### 4.3. Impact of the Number of Access Points

#### 4.4. Impact of the Number of Samples on the Model Fitting

#### 4.5. SmartCampus Dataset Experiments

#### 4.6. UJI Dataset Experiments

## 5. Applicability of the Proposed Solution

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Liu, H.; Darabi, H.; Banerjee, P.; Liu, J. Survey of Wireless Indoor Positioning Techniques and Systems. IEEE Trans. Syst. Man Cybern. Part C
**2007**, 37, 1067–1080. [Google Scholar] [CrossRef] - Boukerche, A.; Oliveira, H.A.B.F.; Nakamura, E.F.; Loureiro, A.A.F. Localization systems for wireless sensor networks. IEEE Wirel. Commun.
**2007**, 14, 6–12. [Google Scholar] [CrossRef] - Boukerche, A.; Oliveira, H.A.; Nakamura, E.F.; Loureiro, A.A. Vehicular Ad Hoc Networks: A New Challenge for Localization-Based Systems. Comput. Commun.
**2008**, 31, 2838–2849. [Google Scholar] [CrossRef] - Lima, M.W.S.; de Oliveira, H.A.F.; dos Santos, E.M.; de Moura, E.S.; Costa, R.K.; Levorato, M. Efficient and Robust WiFi Indoor Positioning Using Hierarchical Navigable Small World Graphs. In Proceedings of the 2018 IEEE 17th International Symposium on Network Computing and Applications (NCA), Cambridge, MA, USA, 1–3 November 2018; pp. 1–5. [Google Scholar]
- Li, G.; Geng, E.; Ye, Z.; Xu, Y.; Lin, J.; Pang, Y. Indoor Positioning Algorithm Based on the Improved RSSI Distance Model. Sensors
**2018**, 18, 2820. [Google Scholar] [CrossRef] [Green Version] - Fang, S.H.; Lin, T. Principal Component Localization in Indoor WLAN Environments. IEEE Trans. Mob. Comput.
**2012**, 11, 100–110. [Google Scholar] [CrossRef] - Yim, J. Introducing a decision tree-based indoor positioning technique. Expert Syst. Appl.
**2008**, 34, 1296–1302. [Google Scholar] [CrossRef] - Khodayari, S.; Maleki, M.; Hamedi, E. A RSS-based fingerprinting method for positioning based on historical data. In Proceedings of the 2010 International Symposium on Performance Evaluation of Computer and Telecommunication Systems (SPECTS’10), Ottawa, ON, Canada, 11–14 July 2010; pp. 306–310. [Google Scholar]
- Tao, X.; Li, X.; Ma, J.; Lu, J. Cluster filtered KNN: A WLAN-based indoor positioning scheme. In Proceedings of the 2008 International Symposium on a World of Wireless, Mobile and Multimedia Networks(WOWMOM), Newport Beach, CA, USA, 23–26 June 2008; pp. 1–8. [Google Scholar] [CrossRef]
- Li, B.; Salter, J.; Dempster, A.G.; Rizos, C. Indoor positioning techniques based on wireless LAN. In Proceedings of the Lan, First IEEE International Conference on Wireless Broadband and Ultra Wideband Communications, Sydney, Australia, 13–16 March 2006; pp. 13–16. [Google Scholar]
- Lin, T.N.; Lin, P.C. Performance comparison of indoor positioning techniques based on location fingerprinting in wireless networks. In Proceedings of the 2005 International Conference on Wireless Networks, Communications and Mobile Computing, Maui, HI, USA, 13–16 June 2005; Volume 2, pp. 1569–1574. [Google Scholar] [CrossRef]
- Kuo, S.P.; Tseng, Y.C. Discriminant Minimization Search for Large-Scale RF-Based Localization Systems. IEEE Trans. Mob. Comput.
**2011**, 10, 291–304. [Google Scholar] [CrossRef] - Assayag, Y.; Oliveira, H.; Souto, E.; Barreto, R.; Pazzi, R. Indoor Positioning System Using Dynamic Model Estimation. Sensors
**2020**, 20, 7003. [Google Scholar] [CrossRef] [PubMed] - Chen, Y.; Yang, Q.; Yin, J.; Chai, X. Power-efficient access-point selection for indoor location estimation. IEEE Trans. Knowl. Data Eng.
**2006**, 18, 877–888. [Google Scholar] [CrossRef] [Green Version] - Youssef, M.A.; Agrawala, A.; Shankar, A.U. WLAN location determination via clustering and probability distributions. In Proceedings of the First IEEE International Conference on Pervasive Computing and Communications, Fort Worth, TX, USA, 26 March 2003; pp. 143–150. [Google Scholar] [CrossRef]
- Malkov, Y.A.; Yashunin, D.A. Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs. arXiv
**2016**, arXiv:1603.09320. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Guidoni, D.L.; Boukerche, A.; Villas, L.A.; de Souza, F.S.; Oliveira, H.A.; Loureiro, A.A. A Small World Approach for Scalable and Resilient Position Estimation Algorithms for Wireless Sensor Networks. In Proceedings of the 10th ACM International Symposium on Mobility Management and Wireless Access, Paphos, Cyprus, 21–22 October 2012; ACM: New York, NY, USA, 2012; pp. 71–78. [Google Scholar] [CrossRef]
- Torres-Sospedra, J.; Montoliu, R.; Martínez-Usó, A.; Avariento, J.P.; Arnau, T.J.; Benedito-Bordonau, M.; Huerta, J. UJIIndoorLoc: A new multi-building and multi-floor database for WLAN fingerprint-based indoor localization problems. In Proceedings of the 2014 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Busan, Korea, 27–30 October2014; pp. 261–270. [Google Scholar] [CrossRef]
- Bahl, P.; Padmanabhan, V.N. RADAR: An in-building RF-based user location and tracking system. In Proceedings of the IEEE INFOCOM 2000. Conference on Computer Communications. Nineteenth Annual Joint Conference of the IEEE Computer and Communications Societies (Cat. No.00CH37064), Tel Aviv, Israel, 26–30 March 2000; Volume 2, pp. 775–784. [Google Scholar] [CrossRef]
- Bahl, P.; Padmanabhan, V.N.; Balachandran, A. Enhancements to the RADAR user location and tracking system. Microsoft Res.
**2000**, 2, 775–784. [Google Scholar] - Roos, T.; Myllymäki, P.; Tirri, H.; Misikangas, P.; Sievänen, J. A Probabilistic Approach to WLAN User Location Estimation. Int. J. Wirel. Inf. Netw.
**2002**, 9, 155–164. [Google Scholar] [CrossRef] - Haeberlen, A.; Flannery, E.; Ladd, A.M.; Rudys, A.; Wallach, D.S.; Kavraki, L.E. Practical Robust Localization over Large-scale 802.11 Wireless Networks. In Proceedings of the 10th Annual International Conference on Mobile Computing and Networking, Philadelphia, PA, USA, 26 September–1 October 2004; ACM: New York, NY, USA, 2004; pp. 70–84. [Google Scholar] [CrossRef] [Green Version]
- Zafari, F.; Gkelias, A.; Leung, K.K. A Survey of Indoor Localization Systems and Technologies. IEEE Commun. Surv. Tutor.
**2019**, 21, 2568–2599. [Google Scholar] [CrossRef] [Green Version] - Man, D.; Bing, L.; Lv, J. Indoor Localization Algorithm based on Attribute-Independent Weighted Naive Bayesian. In Proceedings of the 2020 International Conference on Cyberspace Innovation of Advanced Technologies, Guangzhou, China, 4–6 December 2020. [Google Scholar]
- Pinto, B.H.O.U.V.; de Oliveira, H.A.B.F.; Souto, E.J.P. Factor Optimization for the Design of Indoor Positioning Systems Using a Probability-Based Algorithm. J. Sens. Actuator Netw.
**2021**, 10, 16. [Google Scholar] [CrossRef] - Kunhoth, J.; Karkar, A.; Al-Maadeed, S.; Al-Ali, A. Indoor positioning and wayfinding systems: A survey. Hum. Centric Comput. Inf. Sci.
**2020**, 10, 18. [Google Scholar] [CrossRef] - Duque Domingo, J.; Gómez-García-Bermejo, J.; Zalama, E.; Cerrada, C.; Valero, E. Integration of Computer Vision and Wireless Networks to Provide Indoor Positioning. Sensors
**2019**, 19, 5495. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Li, B.; Muñoz, J.P.; Rong, X.; Chen, Q.; Xiao, J.; Tian, Y.; Arditi, A.; Yousuf, M. Vision-Based Mobile Indoor Assistive Navigation Aid for Blind People. IEEE Trans. Mob. Comput.
**2019**, 18, 702–714. [Google Scholar] [CrossRef] - Youssef, M.; Agrawala, A. The Horus WLAN location determination system. In Proceedings of the 3rd International Conference on Mobile Systems, Applications, and Services, Seattle, WA, USA, 6–8 June 2005; pp. 205–218. [Google Scholar]
- Salamah, A.H.; Tamazin, M.; Sharkas, M.A.; Khedr, M.; Mahmoud, M. Comprehensive Investigation on Principle Component Large-Scale Wi-Fi Indoor Localization. Sensors
**2019**, 19, 1678. [Google Scholar] [CrossRef] [Green Version] - Torres-Sospedra, J.; Richter, P.; Moreira, A.; Mendoza-Silva, G.; Lohan, E.; Trilles, S.; Matey-Sanz, M.; Huerta, J. A Comprehensive and Reproducible Comparison of Clustering and Optimization Rules in Wi-Fi Fingerprinting. IEEE Trans. Mob. Comput.
**2020**. [Google Scholar] [CrossRef] - Torres-Sospedra, J.; Quezada-Gaibor, D.; Mendoza-Silva, G.M.; Nurmi, J.; Koucheryavy, Y.; Huerta, J. New Cluster Selection and Fine-grained Search for k-Means Clustering and Wi-Fi Fingerprinting. In Proceedings of the 2020 International Conference on Localization and GNSS (ICL-GNSS), Tampere, Finland, 2–4 June 2020; pp. 1–6. [Google Scholar] [CrossRef]
- Zhang, C.; Qin, N.; Xue, Y.; Yang, L. Received Signal Strength-Based Indoor Localization Using Hierarchical Classification. Sensors
**2020**, 20, 1067. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Li, A.; Fu, J.; Shen, H.; Sun, S. A Cluster-Principal-Component-Analysis-Based Indoor Positioning Algorithm. IEEE Internet Things J.
**2021**, 8, 187–196. [Google Scholar] [CrossRef] - Ren, J.; Wang, Y.; Niu, C.; Song, W.; Huang, S. A Novel Clustering Algorithm for Wi-Fi Indoor Positioning. IEEE Access
**2019**, 7, 122428–122434. [Google Scholar] [CrossRef] - Gu, F.; Valaee, S.; Khoshelham, K.; Shang, J.; Zhang, R. Landmark Graph-Based Indoor Localization. IEEE Internet Things J.
**2020**, 7, 8343–8355. [Google Scholar] [CrossRef] - Zhang, L.; Valaee, S.; Xu, Y.; Ma, L.; Vedadi, F. Graph-Based Semi-Supervised Learning for Indoor Localization Using Crowdsourced Data. Appl. Sci.
**2017**, 7, 467. [Google Scholar] [CrossRef] [Green Version] - Chen, Y.C.; Chiang, J.R.; Chu, H.H.; Huang, P.; Tsui, A.W. Sensor-assisted Wi-fi Indoor Location System for Adapting to Environmental Dynamics. In Proceedings of the 8th ACM International Symposium on Modeling, Analysis and Simulation of Wireless and Mobile Systems, Alicante, Spain, 16–20 November 2020; ACM: New York, NY, USA, 2005; pp. 118–125. [Google Scholar] [CrossRef] [Green Version]
- Omohundro, S.M. Five Balltree Construction Algorithms; Number ICSI Technical Report TR-89-063; International Computer Science Institute Berkeley: Berkeley, CA, USA, 1989. [Google Scholar]
- Bentley, J.L. Multidimensional Binary Search Trees Used for Associative Searching. Commun. ACM
**1975**, 18, 509–517. [Google Scholar] [CrossRef] - Muja, M.; Lowe, D.G. Scalable nearest neighbor algorithms for high dimensional data. IEEE Trans. Pattern Anal. Mach. Intell.
**2014**, 36, 2227–2240. [Google Scholar] [CrossRef] - Houle, M.E.; Nett, M. Rank-based similarity search: Reducing the dimensional dependence. IEEE Trans. Pattern Anal. Mach. Intell.
**2015**, 37, 136–150. [Google Scholar] [CrossRef] - Dong, W.; Moses, C.; Li, K. Efficient k-nearest neighbor graph construction for generic similarity measures. In Proceedings of the 20th International Conference on World Wide Web, Hyderabad, India, 28 March–1 April 2011; pp. 577–586. [Google Scholar]
- Malkov, Y.; Ponomarenko, A.; Logvinov, A.; Krylov, V. Approximate nearest neighbor algorithm based on navigable small world graphs. Inf. Syst.
**2014**, 45, 61–68. [Google Scholar] [CrossRef] - Klus, L.; Quezada-Gaibor, D.; Torres-Sospedra, J.; Lohan, E.S.; Granell, C.; Nurmi, J. RSS Fingerprinting Dataset Size Reduction Using Feature-Wise Adaptive k-Means Clustering. In Proceedings of the 2020 12th International Congress on Ultra Modern Telecommunications and Control Systems and Workshops (ICUMT), Brno, Czech Republic, 5–7 October 2020; pp. 195–200. [Google Scholar] [CrossRef]
- Salvador-Meneses, J.; Ruiz-Chavez, Z.; Garcia-Rodriguez, J. Compressed kNN: K-Nearest Neighbors with Data Compression. Entropy
**2019**, 21, 234. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Ponomarenko, A.; Malkov, Y.; Logvinov, A.; Krylov, V. Approximate nearest neighbor search small world approach. In Proceedings of the International Conference on Information and Communication Technologies & Applications, Azerbaijan, Baku, 12–14 October 2011. [Google Scholar]
- Pugh, W. Skip lists: A probabilistic alternative to balanced trees. Commun. ACM
**1990**, 33, 668–676. [Google Scholar] [CrossRef] - Boytsov, L.; Naidan, B. Engineering Efficient and Effective Non-metric Space Library. In Proceedings of the Similarity Search and Applications—6th International Conference, SISAP 2013, A Coruña, Spain, 2–4 October 2013; pp. 280–293. [Google Scholar] [CrossRef]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res.
**2011**, 12, 2825–2830. [Google Scholar] - Kohavi, R. A study of cross-validation and bootstrap for accuracy estimation and model selection. IJCAI
**1995**, 14, 1137–1145. [Google Scholar] - Friis, H.T. A Note on a Simple Transmission Formula. Proc. IRE
**1946**, 34, 254–256. [Google Scholar] [CrossRef] - Rappaport, T. Wireless Communications: Principles and Practice, 2nd ed.; Prentice Hall PTR: Upper Saddle River, NJ, USA, 2001. [Google Scholar]
- Plets, D.; Joseph, W.; Vanhecke, K.; Tanghe, E.; Martens, L. Simple Indoor Path Loss Prediction Algorithm and Validation in Living Lab Setting. Wirel. Pers. Commun.
**2013**, 68, 535–552. [Google Scholar] [CrossRef] [Green Version] - Huang, B.; Liu, J.; Sun, W.; Yang, F. A Robust Indoor Positioning Method based on Bluetooth Low Energy with Separate Channel Information. Sensors
**2019**, 19, 3487. [Google Scholar] [CrossRef] [Green Version] - Apple. AirTag—Lose Your Knack for Losing Things. Available online: https://www.apple.com/airtag/ (accessed on 8 July 2021).
- Tile. Find Your Keys, Wallet & Phone. Available online: https://www.thetileapp.com/ (accessed on 8 July 2021).
- Ali, M.; Hur, S.; Park, Y. LOCALI: Calibration-Free Systematic Localization Approach for Indoor Positioning. Sensors
**2017**, 17, 1213. [Google Scholar] [CrossRef] [PubMed] [Green Version]

**Figure 1.**The two phases of a centralized fingerprint-based indoor positioning system implemented in a campus scenario: training and positioning.

**Figure 2.**A typical architecture for a fingerprint-based indoor positioning system running on a centralized server.

**Figure 4.**Example of a signal strength simulation: white lines are the walls of the rooms. X marks the position of the routers. In (

**a**), we have only a single router in the most bottom-left room, while in (

**b**,

**c**) we have two and three routers, respectively.

**Figure 5.**SmartCampus Architecture: a complete, large-scale, indoor positioning system testbed. All beacons send a Bluetooth advertisement packet every second. These packets are received by the scanners, which forward the data to the gateway using a 900 MHz, long-range, communication. The gateway sends the data to the central server, which can localize all of the beacons using the proposed graph-based technique.

**Figure 6.**SmartCampus Hardware: (

**a**) beacons with Bluetooth communication; one beacon is inside a bracelet, as used by the users; the other beacons are outside the bracelet (front and back), and opened to show hardware (front and back); and (

**b**) scanners with Bluetooth and 900 MHz long-range communication (front, opened, back, and installed on the ceiling). The gateway has a similar hardware footprint as of the scanners, and the server is not shown.

**Figure 7.**SmartCampus Testbed Floor Plan: an entire school composed of 60 rooms/halls were trained. Forty-two scanners were distributed throughout the school; 488 points were trained, about 2 m distant from each other; for each training point, about 2000 samples were collected, to a total of 1,020,446 samples.

**Figure 8.**Scalability test results from a dataset containing 196 access points (attributes) and varying the number of samples. (

**a**) Total time including the brute force and (

**b**) without the brute force method.

**Figure 9.**Scalability test results from a dataset containing 196 access points (attributes) and varying the number of samples. (

**a**) Positioning error obtained by the experimented methods; (

**b**) impact of the number of access points on classify time.

**Figure 10.**Scalability evaluation including the (

**a**) model fitting time; (

**b**) the total time (fit+classification).

**Figure 11.**(

**a**) Positioning error and (

**b**) total time (fitting + classification) when using the real-world SmartCampus dataset and increasing the number of samples with $K=3$.

**Figure 12.**(

**a**) Fitting time and (

**b**) classification time evaluation results when using the real-world SmartCampus dataset and increasing the number of samples with $K=3$.

**Figure 13.**(

**a**) Positioning error and (

**b**) total time (fitting + classification) when using the real-world UJI indoor dataset and varying the k value.

Positioning Dataset/Feature | Synthetic | SmartCampus | UJI |
---|---|---|---|

Number of Routers | 196 | 42 | 520 |

Number of Rooms | 378 | 60 | 123 |

Number of Training Points | 5390 | 488 | 493 |

Number of Samples per TPs | 50 | $\sim 2000$ (avg) | $\sim 10$ (avg) |

Total Number of Samples | ∼270,000 | ∼1,020,000 | ∼21,000 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Lima, M.; Guimarães, L.; Santos, E.; Moura, E.; Costa, R.; Levorato, M.; Oliveira, H.
A Small World Graph Approach for an Efficient Indoor Positioning System. *Sensors* **2021**, *21*, 5013.
https://doi.org/10.3390/s21155013

**AMA Style**

Lima M, Guimarães L, Santos E, Moura E, Costa R, Levorato M, Oliveira H.
A Small World Graph Approach for an Efficient Indoor Positioning System. *Sensors*. 2021; 21(15):5013.
https://doi.org/10.3390/s21155013

**Chicago/Turabian Style**

Lima, Max, Leonardo Guimarães, Eulanda Santos, Edleno Moura, Rafael Costa, Marco Levorato, and Horácio Oliveira.
2021. "A Small World Graph Approach for an Efficient Indoor Positioning System" *Sensors* 21, no. 15: 5013.
https://doi.org/10.3390/s21155013