Skip to content

Fractional Knapsack Problem #176

@abhisheks008

Description

@abhisheks008

🔴 Title : Fractional Knapsack Problem using Python 3 language
🔴 Directory : Knapsack
🔴 Name : Abhishek Sharma
🔴 Contribution type :

  • Hacktoberfest 2021
  • Contributor

🔴 Approach : To solve this Fractional Knapsack problem, I will be using the Brute Force Method.

🔴 Problem Statement : Given weights and values of n items, we need to put these items in a knapsack of capacity W to get the maximum total value in the knapsack.

Input: 
Items as (value, weight) pairs 
arr[] = {{60, 10}, {100, 20}, {120, 30}} 
Knapsack Capacity, W = 50; 

Output: 
Maximum possible value = 240 
by taking items of weight 10 and 20 kg and 2/3 fraction 
of 30 kg. Hence total price will be 60+100+(2/3)(120) = 240

@prathimacode-hub Please assign me this issue, I'll be contributing as a Hacktoberfest 2021 participant.

Metadata

Metadata

Assignees

Labels

AssignedIssue is assignedHACKTOBERFESTThis issue is applicable for Hacktoberfest 2022

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions