knapsack_problem: best choice of bag

Description Usage Arguments Examples

View source: R/StatComp21032.R

Description

best choice of bag

Usage

1
knapsack_problem(n, c, w, v)

Arguments

n

the sum of stuff

c

max weight of the bag

w

the weight of each stuff

v

the value of each stuff

Examples

1
2
3
4
5
6
7
8
## Not run: 
n = 6
c = 10
w = c(2, 1, 1, 5, 4, 3)
v = c(2, 2, 3, 1, 5, 2)
knapsack_problem(n,c,w,v)

## End(Not run)

MenggeYang/StatComp21032 documentation built on Dec. 23, 2021, 11:18 p.m.