Fractional Knapsack

This is a greedy algorithm for the fractional knapsack problem. The idea is to fill a knapsack with maximum possible weights that will maximize the total benefit. You can visit the following link for the code.
Fractional Knapsack


One thought on “Fractional Knapsack

  1. Another interesting variation of this is the integer knapsack(both 1 and 2 dimensions) . Wish you could throw some light on those. Dynamic programming makes them really interesting!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s