knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(lab6)

This package is for knapsack problem i.e the total combination of object within the given weight.

The three algorithms for the solution are 1. Brute Force Algorithm 2. Dynamic Algorithm 3. Greedy Algorithm

Knapsack_object is a object which is a dataframe of 2000 rows and 2 columns. The column data contains the weight and value of objects. wzxhzdk:2 #Algorithm Implementation ##Brute Force Algorithm

The Algorithm can be executed as shown below. The time taken for 16 objects are shown below. wzxhzdk:3 ##Dynamic Force Algorithm

The Algorithm can be executed as shown below. The time taken for 500 objects Using Rcpp. wzxhzdk:4 ##Greedy Algorithm

The Algorithm can be executed as shown below. The time taken for 10000 objects Using Rcpp. wzxhzdk:5

KarthiKeyanD4/lab6r documentation built on Oct. 30, 2019, 8:13 p.m.