Be the first to rate this file! 9 Downloads (last 30 days) File Size: 54.77 KB File ID: #20436
image thumbnail

Multi-Knapsack solver

by Sebastien Paris

 

25 Jun 2008 (Updated 02 Nov 2010)

Multi-Knapsack solver by two stochastic optimizer : CEM & BK algorithms

| Watch this File

File Information
Description

Multi-Knapsack solver by two stochastic solvers : i) by Cross-Entropy Method and ii) by Botev-Kroese Method for the following problem

max S(X)=(p^{t}X)
   st. WX <= c

Please run the demo files :

test_ce_knapsack.m
test_cemcmc_knapsack.m

NB. You may need to recompile mex-files. Please open run "mexme_mks" to compile on your own platform.

MATLAB release MATLAB 7.5 (R2007b)
Other requirements A C compiler.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (11)
25 Jul 2008 liudaohai liudaohai

1. mex -f mexopts_intel10amd.bat -output gibbsampler_knapsack.dll gibbsampler_knapsack.c
 
  D:\MATLAB\BIN\WIN32\MEX.PL: Error: Could not find specified options file
    'mexopts_intel10amd.bat'.
 
??? Error using ==> mex
Unable to complete successfully
2. mex -g -output gibbsampler_knapsack.dll gibbsampler_knapsack.c
Error GIBBSAMPLER_KNAPSACK.C 478 undefined reference to _min
 
  D:\MATLAB\BIN\WIN32\MEX.PL: Error: Link of 'gibbsampler_knapsack.dll.dll' failed.
 
??? Error using ==> mex
Unable to complete successfully

25 Jul 2008 Sebastien PARIS

You probably use the LCC compiler.
Please add

#define min(a , b) ((a) <= (b) ? (a) : (b))

on the top of the *.c file.

25 Jul 2008 liudaohai liudaohai

Thank you very much!!!

18 Jun 2009 dhuan Du

Is this knapsack solver able to deal with coninuous cost value?

Thanks

19 Jun 2009 Sebastien Paris

Yes it should

07 Jul 2009 Garrett

I'm looking for a 0/1 knapsack solver that can deal with multiple constraints. Can this program do that?

25 Jul 2009 Sebastien Paris

Yes it should

28 Oct 2010 Merve

I'm looking for multiple choice knapsack problem where there is only one single weight on the RHS in stead of having weights(i).

Is there any easy way to modify your algorithm for multiple choice knapsack?

02 Nov 2010 Sebastien Paris

Merve : I think so, please build a Matrix W from your sole weight w by W = w(ones(m , 1 , :)).

Regards

15 Feb 2011 Daniel Kerry

Hi,
I would like to know if the knapsack program is meant for multiple-constraint or multiple-knapsack containers or both?
thanks

23 Feb 2011 Sebastien Paris

Daniel,

I will say multiple-knapsack containers.

Please login to add a comment or rating.
Updates
19 Aug 2008

-Fixed database (W matrix were not in the correct form)
-Add injection procedure in BK algorithm

10 Sep 2008

-Improve CE parse inputs algorithm

08 Jun 2009

-Should compile on non-C99 compiler
-Add mexme_knapsack function

02 Nov 2010

-Compatible with Lunix64 & GCC
-Add mexme_mks

Tag Activity for this File
Tag Applied By Date/Time
optimization Sebastien Paris 22 Oct 2008 10:07:21
multiknapsack Sebastien Paris 22 Oct 2008 10:07:21
crossentropy Sebastien Paris 22 Oct 2008 10:07:21
stochastic optimization Sebastien Paris 22 Oct 2008 10:07:21
mcmc Sebastien Paris 22 Oct 2008 10:07:21
optimization Giammy 03 May 2009 12:48:59
stochastic optimization Giammy 03 May 2009 12:49:02

Contact us at files@mathworks.com