brute_force_knapsack: Solve knapsack problem by brute-force search. This approach...

Description Usage Arguments Value Examples

Description

Solve knapsack problem by brute-force search. This approach is of complexity O(2^n).

Usage

1

Arguments

x

data.frame, first column x:weight of object, second column v:value of object

W

numeric, weight limit of knapsack

Value

list, value: total value of objects, elements: the rows of objects

Examples

1
2
data(knapsack_objects)
knapsack_brute_force(x = knapsack_objects[1:8,], W = 3500)

shihs/LiUAdRLab6 documentation built on May 30, 2019, 7:18 a.m.