• Home
  • Blog
  • Services
  • Resources
    • Links
    • Models
  • About
  • Contact
  1. Home
  2. Resources
  3. Models
  4. Diet
Diet

The "Diet Problem" is one of the earliest applications of linear programming. The objective is to minimize the cost of food while complying with daily nutritional intake requirements. George Dantzig first solved the problem as a linear program, based on earlier work by Nobel Laureate George Stigler.

Diet in OR-Tools

Apple

Key features of this model:

  • Description: Select foods that satisfy daily nutritional requirements at minimum cost.
  • Category: Diet.
  • Type: LP.
  • Library: OR-Tools.
  • Solver: GLOP.

Notes:

  • The model has been modified to run as a Jupyter Notebook.
  • The data has been extracted into a separate file.
  • Output has been formatted to make it easier to read.

GitHub: Diet in OR-Tools.

  • Python
  • OR-Tools

Diet in PuLP

Tomato

Key features of this model:

  • Description: Select foods that satisfy daily nutritional requirements at minimum cost.
  • Category: Diet.
  • Type: LP.
  • Library: PuLP.
  • Solver: CBC.

Notes:

  • Reads data from Excel workbook.

GitHub: Diet in PuLP.

  • Python
  • PuLP

Diet in Pyomo

Burgers

Key features of this model:

  • Description: Select foods that satisfy daily nutritional requirements at minimum cost. Integer variant, based on the number of servings of each food.
  • Category: Diet.
  • Type: MILP.
  • Library: Pyomo.
  • Solver: GLPK.

Notes:

  • The model has been modified to run as a Jupyter Notebook.

GitHub: Diet in Pyomo.

  • Python
  • Pyomo

Diet in SciPy

Meat

Key features of this model:

  • Description: Select foods that satisfy daily nutritional requirements at minimum cost.
  • Category: Diet.
  • Type: LP.
  • Library: SciPy.
  • Solver: HiGHS.

Notes:

  • The data has been extracted into a separate file.
  • Method changed from 'simplex' (legacy) to use HiGHS solver.

GitHub: Diet in SciPy.

  • Python
  • SciPy

Search

Latest blog articles

  • Production mix - Conclusions
  • Production mix - Model 11, SciPy
  • Production mix - Model 10, CVXPY
  • Production mix - Model 9, Gekko
  • Production mix - Model 8, OR-Tools
  • Production mix - Model 7, PuLP
  • Production mix - Model 6, Pyomo abstract
  • Production mix - Model 5, Pyomo using def
  • Production mix - Model 4, Pyomo json file
  • Production mix - Model 3, Pyomo external data
  • Production mix - Model 2, Pyomo separate data
  • Production mix - Model 1, Pyomo concrete

Latest resources

  • Post Office problem in OR-tools CP-SAT solver
  • Nature inspired methods for optimization
  • Mathematical Programming with Julia
  • Julia programming for Operations Research
  • Convex optimization
  • EdX: Convex optimization
  • EdX: Mathematical optimization for engineers
  • Coursera: Optimization for decision making
  • Coursera: Discrete optimization
  • Coursera: Discrete optimization (series)
  • Coursera: Operations Research (series)
  • MIT OpenCourseWare

Social

Twitter   Buy me a coffee   LinkedIn   GitHub   Mastodon

© 2020-2023 Solver Max

Term and conditions   Privacy   Contact us