greedy_knapsack: using some heuristic or common sense knowledge to generate a...

Description Usage Arguments Value Examples

View source: R/lab06.R

Description

using some heuristic or common sense knowledge to generate a sequence of suboptimum that hopefully converges to an optimum value.

Usage

1

Arguments

x

A dataframe with two columns: the values (v) and the weights (w) of each item to put in the knapsack.

W

A positive number representing the knapsack size..

Value

A list of two elements: a positive number with the maximum knapsack value and a vector of all the elements in the knapsack size.

Examples

1
greedy_knapsack(x = knapsack_objects[1:800,], W = 3500)

josme478/lab06 documentation built on Nov. 4, 2019, 3:21 p.m.