
Vb=35
Nitems=20

val= ceil(100*rand(1,Nitems))
vol= ceil(Vb*rand(1,Nitems))

disp('================== exact solution ==========================');
if Nitems <= 20
	tic; [items, max_val, max_vol] = backpack_binary(Vb, vol, val); toc
	items
	max_val
	max_vol
else 
	disp('skipping the exact combinatoric search, it will take too long');
end
disp('================== Metropolis algorithm solution ==========================');
tic; [items, max_val, max_vol] = backpack_metropolis(Vb, vol, val); toc
items
max_val
max_vol
