Professional Documents
Culture Documents
Different foods
bread, milk, cheese, potato, fish, yogurt
Different foods
bread, milk, cheese, potato, fish, yogurt
Different foods
bread, milk, cheese, potato, fish, yogurt
Different foods
Different foods
Different foods
𝑥𝑥1 ≥ 0
𝑥𝑥2 ≥ 0
𝑥𝑥3 ≥ 0
𝑥𝑥4 ≥ 0
𝑥𝑥5 ≥ 0
𝑥𝑥6 ≥ 0
Different foods
How would you write the objective function if we have 100 food types?
Different foods
How would you write the objective function if we have 100 food types?
min 2𝑥𝑥1 + 3.5𝑥𝑥2 + 8𝑥𝑥3 + 1.5𝑥𝑥4 + 11𝑥𝑥5 + 𝑥𝑥6 + 4.7𝑥𝑥7 + 12𝑥𝑥8 + 14𝑥𝑥9
+ 21𝑥𝑥10 + 4.1𝑥𝑥11 + 8.3𝑥𝑥12 + 6𝑥𝑥13 + 23𝑥𝑥14 + 12.4𝑥𝑥15 + 𝑥𝑥16 + 3.5𝑥𝑥17 + 8𝑥𝑥18
+ 1.5𝑥𝑥19 + 11𝑥𝑥20 + 𝑥𝑥21 + 3.5𝑥𝑥22 + 8𝑥𝑥23 + 1.5𝑥𝑥24 + 11𝑥𝑥25 + 𝑥𝑥26 + 3.5𝑥𝑥27
+ 8𝑥𝑥28 + 1.5𝑥𝑥29 + 11𝑥𝑥30 + 𝑥𝑥31 + 3.5𝑥𝑥32 + 17.23𝑥𝑥33 + 1.5𝑥𝑥34 + 71𝑥𝑥35
+ 𝑥𝑥36 + 3.5𝑥𝑥37 + 8𝑥𝑥38 + 1.8𝑥𝑥39 + 11𝑥𝑥40 + 𝑥𝑥41 + 3.5𝑥𝑥42 + 8𝑥𝑥43 + 1.5𝑥𝑥44
+ 19𝑥𝑥45 + 𝑥𝑥46 + 3.5𝑥𝑥47 + 8𝑥𝑥48 + 1.7𝑥𝑥49 + 43𝑥𝑥50 + ⋯
Different foods
How would you write the objective function if we have 100 food types?
100
Different foods
How would you write the objective function if we have 100 food types?
100
This is a parameter
Means that it is given as data (input) to our model.
Different foods
How would you write the objective function if we have 100 food types?
100
Different foods
How would you write the objective function if we have 100 food types?
100
Different foods
How would you write the objective function if we have 100 food types?
100
Different foods
Different foods
Different foods
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
4𝑥𝑥1 + 8𝑥𝑥2 + 7𝑥𝑥3 + 1.3𝑥𝑥4 + 8𝑥𝑥5 + 9.2𝑥𝑥6 ≥ 150 Protein
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
4𝑥𝑥1 + 8𝑥𝑥2 + 7𝑥𝑥3 + 1.3𝑥𝑥4 + 8𝑥𝑥5 + 9.2𝑥𝑥6 ≥ 150 Protein
… ≥... Content 2
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
4𝑥𝑥1 + 8𝑥𝑥2 + 7𝑥𝑥3 + 1.3𝑥𝑥4 + 8𝑥𝑥5 + 9.2𝑥𝑥6 ≥ 150 Protein
… ≥... Content 2
…
… ≥... Content 1000
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
How would you write the constraints for 1000 types of contents?
Different foods
…
…
…
Content 𝒋𝒋 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑗 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 ≤ ≤ 𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚
…
…
…
…
Calories 90 120 106 97 130 180 ≥ 200
Cost ($/unit) 2 3.5 8 1.5 11 1 To be Minimize!
𝑥𝑥𝑖𝑖 ≥ 0 𝑖𝑖 ∈ 𝐼𝐼
Inputs
- 𝐼𝐼: The set of foods
- 𝐽𝐽: The set of contents
-𝑐𝑐𝑖𝑖 : Per unit cost of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑗𝑗 : The amount of content
𝑗𝑗 in one unit of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The maximum amount of
content 𝑗𝑗 in the diet.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The minimum amount of
content 𝑗𝑗 in the diet.
Diet problem
- Choose a combination of different foods such that
- The constraints on the minimum and maximum values of contents are respected.
- The total cost to make the diet is minimized.
Decision Variable
𝑥𝑥𝑖𝑖 = The amount of food type 𝑖𝑖 to consider in the diet.
Inputs
- 𝐼𝐼: The set of foods
- 𝐼𝐼: The set of contents
-𝑐𝑐𝑖𝑖 : Per unit cost of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑗𝑗 : The amount of content 𝑗𝑗 in one unit of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The maximum amount of content 𝑗𝑗 in the diet.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The minimum amount of content 𝑗𝑗 in the diet.
Hossein Hashemi Doulabi Mathematical Modeling Concordia University
Diet Problem
37
Decision Variable
𝑥𝑥𝑖𝑖 = The amount of food type 𝑖𝑖 to consider in the diet.
Inputs
- 𝐽𝐽: The set of foods
- 𝐽𝐽: The set of contents
-𝑐𝑐𝑖𝑖 : Per unit cost of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑗𝑗 : The amount of content 𝑗𝑗 in one unit of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The maximum amount of content 𝑗𝑗 in the diet.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The minimum amount of content 𝑗𝑗 in the diet.
Hossein Hashemi Doulabi Mathematical Modeling Concordia University
Diet Problem
38
Decision Variable
𝑥𝑥𝑖𝑖 = The amount of food type 𝑖𝑖 to consider in the diet.
Inputs
- 𝐼𝐼: The set of foods
- 𝐽𝐽: The set of contents
-𝑐𝑐𝑖𝑖 : Per unit cost of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑗𝑗 : The amount of content 𝑗𝑗 in one unit of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The maximum amount of content 𝑗𝑗 in the diet.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The minimum amount of content 𝑗𝑗 in the diet.
Hossein Hashemi Doulabi Mathematical Modeling Concordia University
Diet Problem
39
𝑥𝑥𝑖𝑖 ≥ 0 𝑖𝑖 ∈ 𝐼𝐼
Decision Variable
𝑥𝑥𝑖𝑖 = The amount of food type 𝑖𝑖 to consider in the diet.
Inputs
- 𝐼𝐼: The set of foods
- 𝐽𝐽: The set of contents
-𝑐𝑐𝑖𝑖 : Per unit cost of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑗𝑗 : The amount of content 𝑗𝑗 in one unit of food 𝑖𝑖.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The maximum amount of content 𝑗𝑗 in the diet.
-𝑎𝑎𝑗𝑗𝑚𝑚𝑚𝑚𝑚𝑚 : The minimum amount of content 𝑗𝑗 in the diet.
Hossein Hashemi Doulabi Mathematical Modeling Concordia University