greedy_knapsack: Title Greedy Algorithm Knapsack

Description Usage Arguments Examples

Description

Title Greedy Algorithm Knapsack

Usage

1
greedy_knapsack(x, W, fast = NULL)

Arguments

x

The input to function containing the number of items

W

The weights of the items

fast

Whether to speed up using Rccp

Examples

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

anubhav-dikshit/rLab6 documentation built on May 24, 2019, 7:33 a.m.