Greedy Method (for Fractional Knapsack)

GPTKB entity

Statements (22)
Predicate Object
gptkbp:instanceOf gptkb:algorithm
gptkbp:allows taking fractions of items
gptkbp:approach greedy algorithm
gptkbp:category combinatorial optimization
gptkbp:complexity O(n log n)
gptkbp:describedYear 1957
gptkbp:doesNotGuarantee optimal solution for 0/1 knapsack
gptkbp:firstDescribed gptkb:George_Dantzig
gptkbp:guarantees optimal solution for fractional knapsack
https://www.w3.org/2000/01/rdf-schema#label Greedy Method (for Fractional Knapsack)
gptkbp:input knapsack capacity
list of items with values and weights
gptkbp:optimizedFor total value in knapsack
gptkbp:output maximum total value that fits in knapsack
gptkbp:requires sorting items by value-to-weight ratio
gptkbp:step repeat until knapsack is full or items are exhausted
add as much of highest ratio item as possible
sort items by value-to-weight ratio
gptkbp:strategy selects items with highest value-to-weight ratio first
gptkbp:usedFor gptkb:Fractional_Knapsack_Problem
gptkbp:bfsParent gptkb:Knapsack_Problem
gptkbp:bfsLayer 7