Skip to content

Minimizing cost of food while satisfying nutritional constraints. i.e optimizing the problem using PuLP through Linear Programming.

Notifications You must be signed in to change notification settings

CharanSuggala26/Diet-Plan-using-PuLP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯— DietPlan Optimizer

This project solves a basic Diet optimization problem using Linear Programming with the help of the PuLP library in Python.

πŸ“Œ Objective

Minimize the cost of food while satisfying a person’s minimum nutritional requirements, such as calories and protein.

πŸš€ Features

  • Takes a list of food items with:
    • Cost per unit
    • Calories per unit
    • Protein per unit
  • Solves for the minimum cost combination of food items that meets:
    • A minimum calorie requirement
    • A minimum protein requirement
  • Uses PuLP to model and solve the linear programming problem.

πŸ“Š Example Problem

Food Items:

  • Bread (β‚Ή2/unit)
  • Milk (β‚Ή3/unit)
  • Eggs (β‚Ή4/unit)

Nutritional requirements:

  • At least 500 calories
  • At least 30g protein

🧠 How It Works

We define decision variables representing the quantity of each food to consume. Then we:

  1. Minimize the total cost:
    Total Cost = 2*bread + 3*milk + 4*eggs
  2. Subject to constraints:
    • Calories >= 500
    • Protein >= 30

PuLP is used to find the optimal solution that satisfies these constraints at minimum cost.

πŸ›  Installation

  1. Clone the repository or copy the code:
    git clone https://github.com/your-username/DietPlan-Optimizer.git
    cd DietPlan-Optimizer
  2. Install the dependencies
    pip install pulp
    import pulp

About

Minimizing cost of food while satisfying nutritional constraints. i.e optimizing the problem using PuLP through Linear Programming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published