greedy_knapsack: greedy_knapsack

Description Usage Arguments Value Examples

View source: R/greedy_heuristic.R

Description

Solver for the knapsack problem based on the greedy heuristic.

Usage

1

Arguments

x

Dataframe containing weight and value of objects

W

maximum weight allowed in knapsack

Value

List with the optimal value and the respective elements, that are included in the solution.

Examples

1
2
3
knapsack_objects <- get_knapsack_objects(2000)

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

PatrickSVM/knapsack documentation built on Dec. 18, 2021, 6:42 a.m.