Python
CLI (Command Line Interface) application
Git
GitHub
CSV (Comma-separated values)
Menu-navigation
In this project, I developed a Python application focused on solving optimization problems using various algorithms, including brute-force, greedy, and branch-and-bound techniques. The project applies these algorithms to a dataset of financial data with 1,000 entries, with the goal of finding optimal solutions while considering performance trade-offs.
Workflow:
This project highlights the application of advanced algorithms and efficient data handling techniques while providing insights into system resource usage during computation. It also emphasizes the balance between algorithmic accuracy and performance in real-world scenarios.
1. Brute-Force Solution
The project starts with implementing a brute-force algorithm that systematically checks all possible combinations to find the optimal solution. Although brute-force guarantees finding the best solution, its computational complexity is high, making it inefficient for large datasets. To analyze this, I applied Big O notation to quantify the time complexity of the brute-force approach and demonstrate its scalability challenges.
2. Big O Notation and Algorithm Analysis
For each algorithm, I provided an analysis of its time complexity using Big O notation. This includes:
Each algorithm’s performance and efficiency are compared using Big O notation, highlighting their strengths and weaknesses for this specific dataset.
3. Command-Line Interface (CLI) Application
The entire application is a CLI-based tool, where users can select which algorithm to run and view the results directly from the console. The navigation system allows users to choose between different modes (brute-force, branch-and-bound, or greedy algorithm) and observe how each method processes the data and arrives at a solution.
4. Data Handling with NumPy
and Pandas
The financial dataset was handled using pandas and NumPy
for efficient data manipulation. I used Pandas
for tasks such as:
NumPy
provided high-performance data processing for mathematical computations involved in the algorithmic steps.
5. itertools
for Efficient Iteration
To optimize the iteration process, I utilized itertools
, a Python library that generates efficient iterators. Functions like combinations, permutations, and product were key in generating candidate solutions in the brute-force and branch-and-bound algorithms, ensuring that the looping process remained memory-efficient even for large datasets.
6. psutil
for System Monitoring
The project integrates psutil
to monitor system resources such as CPU, memory usage, and disk utilization during algorithm execution. This was crucial for understanding how each algorithm impacts system performance, especially when handling large datasets. Users can view real-time statistics on resource consumption, making the application not only functional but also informative about the system's state.
7. Operating System Integration
The project uses Python’s os module for system-level operations, such as handling file paths for reading and writing CSV files and interacting with the local file system for data storage and retrieval.