greedy_knapsack: Largest possible value in weighted bag - greedy

Description Usage Arguments Value

View source: R/greedy.R

Description

This function takes the values and weights provided in a data frame and finds the largest possible sum of values that is less than or equal to the inputed weight by ordering each element by value per weight.

Usage

1

Arguments

x

data frame

W

positive numeric value

Value

The output will be a numerical value(the largest possible sum) and the corresponding numerical elements that make that sum


zoepatton/Lab6 documentation built on Oct. 31, 2020, 1:15 a.m.