brute_force_knapsack: Knapsack Algorithm - Brute Force

Description Usage Arguments Value Examples

View source: R/knapsack.R

Description

Brute Force Approch to Solve Knapsack Problem

Usage

1

Arguments

x

data.frame with colnames 'v' & 'w'

W

Knapsack Maximum Weight

parallel

Bool value to pass to active parallel

Value

Return best Knapsack combination with maximum value

Examples

1
2
3
4
5
6
7
8
set.seed(42)
n <- 2000
knapsack_objects <-
 data.frame(
   w=sample(1:4000, size = n, replace = TRUE),
   v=runif(n = n, 0, 10000)
 )
 brute_force_knapsack(x = knapsack_objects[1:8,], W = 2000)

abkw/lab06 documentation built on Oct. 31, 2019, 1:56 a.m.