- General Info
- Creator Info
- Features
- Technologies Used
- Setup
- Usage
- Screenshots
- Structure
- Project Status
- Room for Improvement
- Acknowledgements
- Contact
A simple program to solve the closest pair problem. The program will take a number of tuples, dimension, and set of points (randomize by system) as input and will output the closest pair of points. Program will also output the number of euclidean distance steps calculation, distance between the points, and execution time of each algorithm. This project is based on the Divide and Conquer Algorithm (Brute Force Algorithm is just for reference) and write in python programming language (Command Line Interface).
Nama | NIM | |
---|---|---|
Mohammad Rifqi Farhansyah | 13521166 | 13521166@std.stei.itb.ac.id |
- Output
the closest pair
of the points - Output the
number
of euclidean distance steps calculation - Show the
execution time
- Many
input item
(tuple, dimension, and range of the points) Colorful output
(classificate by the bracket type)- Save the output to a
txt
file
- python 3.9
- pip 22.3.1
- matplotlib 3.5.0
Note: The version of the libraries above is the version that we used in this project. You can use the latest version of the libraries.
- Download python 3.9 from here.
- Download pip 22.3.1 from here.
- Download matplotlib 3.5.0 from here.
- Install the libraries above.
- Clone this repository to your local directory by using this command:
git clone https://github.com/rifqifarhansyah/Tucil2_13521166.git
- Change your directory to the directory of this project.
- Go to the
src
directory. - Run the
main.py
file by using this command:
python main.py
- Enjoy the program!
- Input the number of tuples (number of points that you want to test). The number must greater than 1.
- Input the dimension of the points (the dimension must greater than 0).
- Input the range of the points (minimum and maximum value of the points).
- System will generate the points randomly.
- This program will write the set of points that have been generated randomly by system (placed in
src/input/input.txt
). - The program will show the closest pair of the points, number of euclidean distance steps calculation, and execution time of each algorithm.
- You can see the visualization of the points by choose
y
in theApakah Anda ingin menampilkan grafik? (y/n)
question. - The output file will automatically saved in
src/output/output.txt
.
Figure 1. Main Menu
Figure 2. The Closest Pair Solution (BF and DnC)
Figure 3. Example of the points visualization (in 3D)
Figure 4. Input txt file
Figure 5. Output txt file
β README.md
β
ββββdoc
β Tucil2_K2_13521166_MohammadRifqiFarhansyah.pdf
β
ββββimage
β 1000(2).png
β 1000(3).png
β 128(2).png
β 128(3).png
β 16(2).png
β 16(3).png
β 64(2).png
β 64(3).png
β SS1.png
β SS2.png
β SS3.png
β SS4.png
β SS5.png
β
ββββsrc
β calculation.py
β main.py
β visualization.py
β
ββββinput
β input.txt
β
ββββoutput
β output.txt
β
ββββ__pycache__
calculation.cpython-39.pyc
visualization.cpython-39.pyc
Project is: complete
Room for Improvement:
- Optimalization of the Closest Pair Problem Algorithm code
- Adding more features
- Create the better UI for this project
- Thanks To Allah SWT
- This project was inspired by Closest-Pair-Problem