knapsack_brute_force: A Brute-Force Solution for the Knapsack Problem

Description Usage Arguments Value

View source: R/knapsack_brute_force.r

Description

A Brute-Force Solution for the Knapsack Problem

Usage

1

Arguments

x

a data.frame with two columns, "w" and "v", indicating the weight and value of items respectively

W

the maximum weight that the knapsack can hold

parallel

TRUE if a parallelised version of the solution is to be called; FALSE by default

Value

a list containing two elements: value and elements, representing the maximum value that can be realised with the given knapsack and the indices of the items to be packed in the knapsack for realising maximum value


rojanka/knapsack documentation built on Oct. 22, 2021, 4:11 p.m.