File Exchange

image thumbnail

Diet Problem in Linear Programming

version 1.0 (1.34 KB) by

The goal of Diet problem is to minimize the cost of food satisfying nutrient constraints.



View License

This code uses MATLAB inbuilt LP solver (linprog). There are 3 nutrients in the problem ( Carbohydrates , proteins and fat) which can be in between some minimum and maximum for a healthy diet. Objective here is to find cheapest diet satisfying nutrients requirement. There are five types of food with its cost. In this particular problem, Rice and Broccoli happens to be the cheapest diet. This file is for illustrating optimization in linear programming and not a suggestion for a healthy diet.

Comments and Ratings (3)

Aleff Passos

Hi Sathyanarayan, can you comment the lines of you code please ?

Hi Scott Richardson,
An objective of standard linear program problem is to maximize or minimize a vector c'x, subjected to the condition L<Ax<H. In this problem, we are trying to minimize the cost and lower bound L and upper bound H are given by lower and upper bounds on nutrients. So the condition matrix A should be the A_new matrix you are asking about. I have referred this textbook and I would suggest you also ,if you are interested more on Diet problem. Text: Linear Programming by Robert Vanderbei. Thanks

Hi, what is matrix "A_new"?


MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video