Skip to content

NearestPair is a computational geometry project that efficiently finds the closest pair of points in a given set. This implementation leverages optimized algorithms such as the Divide and Conquer approach to achieve better performance than brute-force methods.

Notifications You must be signed in to change notification settings

ch4rum/NearestPair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nearest Pair Finder

 
Description
   
Features
   
Usage
   
Contribution
 

πŸ‘Ύ Description

The Nearest Pair Finder is a Python script that implements an efficient algorithm to find the closest pair of points in a 2D space. It uses a divide-and-conquer approach to achieve optimal performance, making it suitable for large datasets.

πŸŽ‰ Features:

  • Efficient divide-and-conquer algorithm for finding the nearest pair of points.

  • Supports input files with 2D point coordinates.

  • Visualizes the points and highlights the nearest pair using Matplotlib.

  • Logs the process and results for debugging and analysis.

  • Compatible with Python 3 and major operating systems.

πŸ’» Usage

First download the code

git clone --no-checkout http://github.com/ch4rum/NearestPair.git

To run the script, you can use the following command:

python3 main.py -f <archive>
  • -f o --file <archive> Specifies the input file containing 2D points.

To exit the session, you can run ctrl + c.

πŸ› οΈ Requeriments

  • Python 3
  • Libraries:
    • webbrowser
    • argparse
    • matplotlib
    • os
    • time
    • signal
    • sys
    • os
    • pwn
    • math
    • datetime

You can install the neccesary dependencies by running.

# In windows & some linux
pip install pwntools matplotlib

# For Arch Linux and some derivatives
sudo pacman -S --noconfirm python-pwntools python-matplotlib

πŸ“§ Contributions

If you want to contribute to this little script, feel free to make a fork and send your improvements via pull requests.

About

NearestPair is a computational geometry project that efficiently finds the closest pair of points in a given set. This implementation leverages optimized algorithms such as the Divide and Conquer approach to achieve better performance than brute-force methods.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages