The Optimization repository provides a robust framework for solving various mathematical optimization problems using multiple algorithms. The project showcases practical applications of optimization in engineering, operations research, and data science. Its modular structure allows users to experiment with different methods and compare their performance on a range of problems.
- Implements diverse optimization algorithms (e.g., gradient-based, metaheuristic).
- Supports both continuous and discrete problem spaces.
- Modular design for easy extension and experimentation.
- Includes example problems and ready-to-run scripts.
- Offers clear output and visualization of optimization results.
- Python 3.7 or higher
- Standard scientific libraries:
numpymatplotlibscipy
- (Optional) Additional libraries depending on specific algorithms or visualization needs.
To get started with the Optimization repository, follow these steps:
- Clone the repository:
git clone https://github.com/EmnaWalha99/Optimization.git cd Optimization - Install the required Python packages:
If
pip install -r requirements.txt
requirements.txtis not available, manually install the standard scientific packages:pip install numpy matplotlib scipy
The repository contains multiple scripts and modules for different optimization problems and methods. Follow these steps to run an example or solve your own optimization task:
-
Select an Algorithm or Example
Explore the folders and files to find a script corresponding to the optimization technique or problem of interest.
-
Run an Example
Use the Python interpreter to execute an example script. For instance:
python examples/gradient_descent_example.py
-
Customize Your Problem
- Open the target script and modify the objective function, constraints, or algorithm parameters as required.
- Save your changes.
-
Visualize Results
Most example scripts generate plots to visualize the optimization process and results. Output files and graphs will be saved or shown directly.
# Clone the repo and enter the directory
git clone https://github.com/EmnaWalha99/Optimization.git
cd Optimization
# Install dependencies
pip install -r requirements.txt
# Run a sample optimization problem
python examples/gradient_descent_example.pyTo add a new optimization algorithm or problem:
- Implement your algorithm in a new Python module under the appropriate folder.
- Create a script demonstrating its use.
- Follow the coding style and documentation format established in the repository.
For detailed instructions on specific scripts or algorithms, please refer to the in-code documentation and comments within each file. The repository is designed to be beginner-friendly but powerful enough for advanced experimentation.
These pages represent classic optimization models with predefined mathematical structures and data formats. They help you study real-world decision problems and compare different solution methods on standard formulations.
The Facility Location page models a mixed integer program that selects facility sites and assigns clients to them. Binary variables represent whether a facility is open, and nonnegative variables represent how much demand each facility serves. The objective minimizes the sum of all fixed opening costs and all transportation or allocation costs. Constraints ensure each client's demand is fully met and no facility serves more than its capacity.
The JobShop page models a scheduling problem with jobs, machines, and ordered operations. Decision variables include start times for each operation and sometimes binary variables for ordering operations on a machine. The objective usually minimizes the makespan, defined as the completion time of the last job. Constraints enforce the processing order within each job and prevent overlapping use of any machine.
The Resource Allocation page represents a linear or integer program that distributes limited resources to activities. Decision variables represent the level of each activity, which can be continuous or integer. The objective often maximizes total profit or benefit subject to several resource capacity inequalities. Constraints also include lower and upper bounds on activity levels and optional logical relations between activities.
The ScriptOptimization page (sometimes named ScriptOptimieation) focuses on executing a generic optimization model with configurable data and parameters. Mathematically, it handles problems that minimize an objective function subject to inequality and equality constraints. The script loads model files, constructs the objective and constraints from the selected data set, then runs a solver. This page is ideal for parametric studies, where you vary data or settings and compare objective values.
Happy Optimizing!