greedy_knapsack: Title Greedy Heuristic-Knapsack

Description Usage Arguments Value Examples

View source: R/greedy_knapsack.R

Description

Title Greedy Heuristic-Knapsack

Usage

1

Arguments

x

Data frame consist of two columns w and v

W

Total Capacity

Value

Algorithm that will not give an exact result,but it will reduce the computational complexity.

Examples

1
2
3
4
5
6
7
#' RNGversion(min(as.character(getRversion()),"3.5.3"))
set.seed(42, kind = "Mersenne-Twister", normal.kind = "Inversion")
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:800,], W = 3500)

Elmahi92/knpa documentation built on Dec. 17, 2021, 6:28 p.m.