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

Multi-Knapsack solver



25 Jun 2008 (Updated )

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

| Watch this File

File Information

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 :


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   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
23 Feb 2011 Sebastien PARIS


I will say multiple-knapsack containers.

15 Feb 2011 Daniel Kerry

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

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 , :)).


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?

25 Jul 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?

19 Jun 2009 Sebastien PARIS

Yes it should

18 Jun 2009 dhuan Du

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


25 Jul 2008 liudaohai liudaohai

Thank you very much!!!

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

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

??? 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

19 Aug 2008

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

08 Jun 2009

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

02 Nov 2010

-Compatible with Lunix64 & GCC
-Add mexme_mks

Contact us