COMPANY: CODTECH IT SOLUTIONS PVT.LTD NAME: Yasir Siraj Mondal DOMAIN: Data Science DURATION: 12 weeks MENTOR: Neela Santhosh Kumar
This project demonstrates solving a business optimization problem using Linear Programming (LP) in Python.
A company produces Product A and Product B. Each product uses limited resources (labor and materials) and generates profit:
| Product | Profit per Unit | Labor Hours | Material Units |
|---|---|---|---|
| A | 40 | 2 | 1 |
| B | 30 | 1 | 2 |
Goal: Maximize total profit without exceeding available resources:
- Total labor hours ≤ 100
- Total material units ≤ 80
-
Decision Variables:
- x1 = Units of Product A to produce
- x2 = Units of Product B to produce
-
Objective Function: Maximize Profit = 40x1 + 30*x2
-
Constraints:
2x1 + 1x2 <= 100 # Labor constraint 1x1 + 2x2 <= 80 # Material constraint x1, x2 >= 0 # Non-negativity
- Tool Used: Python with PuLP library to model and solve the LP problem.
How to Run
- Clone the repository:
git clone cd linear-optimization-project
- Create and activate virtual environment:
python -m venv venv
venv\Scripts\activate
source venv/bin/activate
-
Install dependencies: pip install -r requirements.txt
-
Run the optimization script: python optimization.py
-
Output: Optimal units to produce for Product A and Product B Maximum achievable profit Optional bar chart visualization of production plan
Insights
The solution identifies the optimal production quantities for maximizing profit. Resource constraints (labor and materials) limit production. Businesses can use this model to analyze “what-if” scenarios, e.g., adding more labor or materials to increase profit.
Tech Stack
Python 3.8+ PuLP – Linear Programming Matplotlib – Visualization
Author
Yasir Mondal – mondalyasir386@gmail.com
License: 2025 Yasir Mondal
This README is complete, professional, and fully explains the problem, solution, and usage.