This project demonstrates Divide & Conquer (DAA) techniques in Python through two classic problems:
- Closest Pair of Points
- Integer Multiplication (Step-by-Step)
It includes both a graphical visualization using matplotlib and interactive file input via Streamlit or a Tkinter GUI.
- Upload a text file containing 2D points.
- Computes the closest pair of points using a Divide & Conquer algorithm.
- Efficient
O(n log n)implementation. - Visualizes all points and highlights the closest pair.
- Shows computation time.
- Upload two files containing integers (one per line).
- Performs multiplication step-by-step, showing partial products.
- Visualizes results with bar charts.
- Calculates and displays total execution time.
- Supports both CLI and GUI interfaces.
- Clone the repository:
- Install dependencies: pip install -r requirements.txt Dependencies include: streamlit matplotlib numpy Usage Run with Streamlit (Recommended) streamlit run main.py Use the sidebar to select the algorithm.
Upload input files to run algorithms interactively.
View results, charts, and execution time. Run via CLI Closest Pair of Points python backend/closest_pair.py --file <input_file.txt> Integer Multiplication python backend/integer_mult.py --file1 <file1.txt> --file2 <file2.txt> Run GUI Mode python backend/closest_pair.py --gui python backend/integer_mult.py --gui 📝 Input File Format Closest Pair
Text file with 2D points:
5 1 2 3 4 -1 0 2 2 4 1
First line can optionally be the number of points.
Integer Multiplication
Each file contains integers, one per line:
123 456 789 📊 Screenshots Closest Pair Visualization
Integer Multiplication Steps & Chart
🔹 Key Concepts Demonstrated
Divide & Conquer Algorithms
File I/O and Data Parsing
Graphical Visualization with Matplotlib
Interactive GUI & Web App with Tkinter & Streamlit
Step-by-step integer multiplication algorithm
Performance Analysis (execution time measurement)
Arwa Abbas Mehwish Zehra Areeza