Skip to content

K-D tree data structures implementation for efficient spatial searches and nearest neighbor queries

Notifications You must be signed in to change notification settings

aabolfazl/Particles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particles

Description

This project is implemented in C++ and uses CMake for building. It focuses on simulating and analyzing particles and their interactions. The project utilizes k-d tree data structures for efficient spatial searches and nearest neighbor queries. You can learn more about k-d trees here.

Using k-d trees has significantly improved the performance of our tests, reducing the test time from hours to just 4 seconds for the same test file.

K-D Trees

A k-d tree is a binary tree that is used to partition a k-dimensional space into regions. The tree is constructed by recursively partitioning the space into two half-spaces along the k-th dimension. The tree is used to efficiently perform nearest neighbor searches and range searches. Implementation of the k-d tree is available in the MoleculeTree class.

Tests

The project includes several test cases to ensure the functionality of the Particles class. The tests are written using the Google Test framework.

MoleculesTest

  • Description: Validates the atoms in the Particles class.
  • Assertions:
    • Checks that "O" and "H" are valid atoms.
    • Ensures that "C" is not a valid atom.
    • Verifies that the number of pages is 80.

PageTest

  • Description: Verifies the functionality of reading and processing molecular data from a file.
  • Assertions:
    • Reads data from a specified file and checks the consistency of neighbor molecules.
    • Ensures the count of consistent neighbor molecules matches the expected size.
    • Verifies the number of molecules in the file.
    • Checks the number of atoms in the file.
    • Ensures the number of pages is 80.

About

K-D tree data structures implementation for efficient spatial searches and nearest neighbor queries

Resources

Stars

Watchers

Forks