# nanoflann
**Wikidata**: [Q124844885](https://www.wikidata.org/wiki/Q124844885)  
**Source**: https://4ort.xyz/entity/nanoflann

## Summary
nanoflann is a header-only C++ library for building KD-trees optimized for fast nearest neighbor searches in point clouds and datasets. It is widely used in robotics, computer vision, and scientific computing due to its efficiency and minimal dependencies.

## Key Facts
- nanoflann is classified as software and is distributed as a header-only C++ library.
- The latest stable version is 1.4.0, released on January 2, 2022.
- Previous stable versions include 1.3.2 (November 5, 2020), 1.3.1 (October 11, 2019), and 1.3.0 (August 28, 2018).
- The source code is hosted at https://github.com/jlblancoc/nanoflann.
- It supports efficient KD-tree construction and querying with no external dependencies.
- Designed for use in performance-critical applications such as SLAM (Simultaneous Localization and Mapping) in robotics.
- Created and maintained by Jose Luis Blanco Claraco.

## FAQs
### Q: What is nanoflann used for?
A: nanoflann is used for performing fast nearest neighbor searches using KD-trees, commonly applied in fields like robotics, computer vision, and spatial data analysis.

### Q: Is nanoflann free to use?
A: Yes, nanoflann is open-source software and can be freely used under its license terms.

### Q: How do I install or integrate nanoflann into my project?
A: Since it's a header-only library, you only need to include the relevant headers in your C++ project without linking against binaries.

## Why It Matters
nanoflann plays a critical role in high-performance computational geometry tasks where rapid access to spatial data is essential. Its design allows developers to efficiently implement algorithms requiring proximity queries—such as k-nearest neighbors (k-NN)—without introducing heavy runtime dependencies. This makes it particularly valuable in real-time systems like robotic navigation and 3D mapping pipelines, where speed and low overhead are crucial. As part of modern C++ toolkits for scientific computing, nanoflann enables scalable solutions across large datasets while maintaining ease of integration.

## Notable For
- Being a lightweight, header-only implementation of KD-trees tailored for performance-sensitive environments.
- Supporting both L1 and L2 distance metrics out-of-the-box.
- Having no third-party dependencies beyond standard C++ libraries.
- Widely adopted within prominent projects including Mobile Robot Programming Toolkit (MRPT).
- Maintained actively since early 2014 with regular updates improving stability and compatibility.

## Body
### Overview
nanoflann is a compact C++ template library designed for creating KD-trees to enable ultra-fast nearest neighbor searches. It focuses on simplicity, portability, and efficiency, making it ideal for embedding in larger software systems.

### Development History
The library was created by Jose Luis Blanco Claraco and has been publicly developed on GitHub since at least May 2014. Over time, multiple stable releases have introduced improvements in API clarity, bug fixes, and expanded compiler support.

#### Version Timeline
Below are selected key stable versions with their release dates:
- **v1.1.8** – Released May 1, 2014
- **v1.1.9** – Released October 2, 2015
- **v1.2.0** – Released May 16, 2016
- **v1.2.3** – Released December 20, 2016
- **v1.3.0** – Released August 28, 2018
- **v1.3.2** – Released November 5, 2020
- **v1.4.0** – Released January 2, 2022

Each version includes documented changes tracked via GitHub releases.

### Technical Features
- Header-only distribution simplifies deployment.
- Supports compile-time customization through templates.
- Compatible with Eigen matrix types and STL containers.
- Thread-safe during query operations when trees are pre-built.
- Offers radius search and k-nearest neighbor search functionalities.

### Integration & Usage
Due to its minimal footprint and absence of build scripts, integrating nanoflann typically involves copying the `nanoflann.hpp` file into a project’s include path. Users instantiate KDTreeSingleIndexAdaptor or similar classes depending on dataset type and requirements.

### Community Adoption
It is utilized in several well-known open-source frameworks, especially those involving mobile robotics and sensor data processing, such as MRPT (Mobile Robot Programming Toolkit). This reflects its reliability and suitability for academic and industrial research alike.

## References

1. [Release 1.1.8. 2014](https://github.com/jlblancoc/nanoflann/releases/tag/v1.1.8)
2. [Release 1.1.9. 2015](https://github.com/jlblancoc/nanoflann/releases/tag/v1.1.9)
3. [Release 1.2.0. 2016](https://github.com/jlblancoc/nanoflann/releases/tag/v1.2.0)
4. [Release 1.2.1. 2016](https://github.com/jlblancoc/nanoflann/releases/tag/v1.2.1)
5. [Release 1.2.2. 2016](https://github.com/jlblancoc/nanoflann/releases/tag/v1.2.2)
6. [Release 1.2.3. 2016](https://github.com/jlblancoc/nanoflann/releases/tag/v1.2.3)
7. [Release 1.3.0. 2018](https://github.com/jlblancoc/nanoflann/releases/tag/v1.3.0)
8. [Release 1.3.1. 2019](https://github.com/jlblancoc/nanoflann/releases/tag/v1.3.1)
9. [Release 1.3.2. 2020](https://github.com/jlblancoc/nanoflann/releases/tag/v1.3.2)
10. [Release 1.4.0. 2022](https://github.com/jlblancoc/nanoflann/releases/tag/v1.4.0)
11. [Release 1.4.1. 2022](https://github.com/jlblancoc/nanoflann/releases/tag/v1.4.1)
12. [Release 1.4.2. 2022](https://github.com/jlblancoc/nanoflann/releases/tag/v1.4.2)
13. [Release 1.4.3. 2022](https://github.com/jlblancoc/nanoflann/releases/tag/v1.4.3)
14. [Release 1.5.0. 2023](https://github.com/jlblancoc/nanoflann/releases/tag/v1.5.0)
15. [Release 1.5.1. 2023](https://github.com/jlblancoc/nanoflann/releases/tag/v1.5.1)
16. [Release 1.5.2. 2023](https://github.com/jlblancoc/nanoflann/releases/tag/v1.5.2)
17. [Release 1.5.3. 2023](https://github.com/jlblancoc/nanoflann/releases/tag/v1.5.3)
18. [Release 1.5.4. 2024](https://github.com/jlblancoc/nanoflann/releases/tag/v1.5.4)
19. [Release 1.5.5. 2024](https://github.com/jlblancoc/nanoflann/releases/tag/v1.5.5)
20. [Release 1.6.0. 2024](https://github.com/jlblancoc/nanoflann/releases/tag/v1.6.0)
21. [Release 1.6.1. 2024](https://github.com/jlblancoc/nanoflann/releases/tag/v1.6.1)
22. [Release 1.6.2. 2024](https://github.com/jlblancoc/nanoflann/releases/tag/v1.6.2)
23. [Release 1.6.3. 2025](https://github.com/jlblancoc/nanoflann/releases/tag/v1.6.3)
24. [Release 1.7.0. 2025](https://github.com/jlblancoc/nanoflann/releases/tag/v1.7.0)
25. [Release 1.7.1. 2025](https://github.com/jlblancoc/nanoflann/releases/tag/v1.7.1)
26. [Release 1.8.0. 2025](https://github.com/jlblancoc/nanoflann/releases/tag/v1.8.0)
27. [Release 1.9.0. 2025](https://github.com/jlblancoc/nanoflann/releases/tag/v1.9.0)