
β
Description
β
β
Features
β
β
Usage
β
β
Contribution
β
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.
-
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.
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
.
- 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
If you want to contribute to this little script, feel free to make a fork and send your improvements via pull requests.