Professional Documents
Culture Documents
Author : S Ramarajan
Introduction:
ABSTRACT
The knapsack problem can be
Using Knapsack Algorithm (Greedy used to find the optimal solution to fill
Method) we are giving an innovative the knapsack with maximum profit.
thinking on how to get maximum energy Likewise, we can apply the same
from a meal. Usually, if we take the technique to obtain the optimal solution
energetic foods daily, we can gain more for eating a meal. So that, we can get
calories. But if you are given only a maximum calories by using the optimal
limited number of recipes, we not sure to solution.
get maximum energy. So in this paper
Before entering into the problem,
we are giving a way to reach maximum
it becomes must to know about the
energy from a meals using fractional
Greedy method and knapsack problem,
knapsack algorithm. The measures of
That is why, here, a brief introduction on
foods are taken using the weights and
Greedy method and knapsack problem
total calories are taken as the weights
using Greedy method are given.
and total calories are taken as the profits
for the knapsack algorithm. The optimal Greedy Method:
solution found out gives the ratio of
foods to take to eat. Application-Knapsack Problem:
The measures of the objects are The calories per each recipe are
given in cups. Using the standard kitchen given below:
conversion units we can calculate the
1) Rice (Cooked) = 800 calories
measures in milliliters.
2) Drumstick Sambar = 8224
The objects measure in milliliters.
calories
1) Rice (cooked) (2 ½ cups) = 590 ml
3) Cabbage curry = 36 calories
2) Drumstick sambar (1 ½ cups)= 354 ml
4) Baked eggs = 211 calories
3) Cabbage Curry (1/3 cup)= 79 ml
5) Butter milk gravy =98 calories
4) Baked eggs (2/3 cup) = 158 ml
Payasam (Sugar, Cream,
5) Butter milk gravy (1 cup)= 237 ml Vermicelli) = 300 calories
These objects are to be loaded Pi = (P1, P2, P3, P4, P5, P6)
into the stomach while lunch or dinner.
Pi = (800, 224, 36, 211, 98, 300)
So, these are taken as objects similar to
weights in knapsack problem. Where 1 ≤ i ≤ n and n=6
∑WiXi ≤m ∑PiXi
Xi
(Feasible Solutions) (Objective Solutions)
590+354+79+158+237+473 800+224+36+211+98
1) (1,1 ,1,1,1,0)
⇒ 1418 ⇒1369
590+200+79+158+0+473 800+126.5+36+211+300
2) 1,200/354,1,1,0,1)
⇒1500 ⇒ 1429.7
590+0+79+158+200+473 800+36+211+82.7+300
3) 1,0,1,1,,200/237,1)
⇒ 1500 ⇒ 1429.7
4) 590+100+79+158+100+473 800+63.276+36+211+41.35+300
(1,100/354,1,1,100/237) ⇒ 1500 ⇒1451.266
590+354+158+237+161 800+224+211+98+102.114
5) 1,1,0,1,1,161/473)
⇒ 1500 ⇒ 1435.114
590+354+79+158+237+82
800+224+36+211+98+300x82/473
6) 1,1,1,1,1, 82/473 ⇒
⇒1421
1500
590+354+0+83+0+473 800+224+0+110.84+0+300
7) (1,1,0, 83/158,0,1)
⇒ 1500 ⇒ 1434.841
590+354+79+0+4+473 800+224+36+0+1.654+300
8) (1,1,1,0,4/237,1)
⇒ 1500 ⇒ 1361.654
590+354+0+0+83+473 800+224+0+0+83/237x98+300
9) (1,1,0,0,83/237,1)
⇒ 1500 ⇒ 1358.32
10) 590+354+61+158+237+100 800+224+61/79x36+211+98+10/473x300
(1,1,61/79,1,1,100/473) ⇒ 150 ⇒ 1424.22
*********