Skip to content

wise-saint/Greedy_Knapsack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greedy_Knapsack

Fractional Knapsack Problem Using Greedy Approach

Problem : Let P[1….n] and W[1….n] be the sets of profits and
corresponding weights of the elements in the given knapsack problem.
Let c be the maximum weight that the given knapsack can hold.
Let X[1….n] be the set of fractions of elements placed in the knapsack.
Initially all the elements of set X are set to zero,
as the knapsack is empty.

Statement of the knapsack problem : Maximize i=1n (PiXi)
subject to constraint i=1n (WiXi) <=c.

About

Knapsack Problem Using Greedy Approach

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages