LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default generate all subsets (2^n array)

Hi there,

I'm wondering if anyone here can point me in the right direction. I'm
working on an exhaustive search for 0-1 knapsack problem.

I need to write some vba that will represent every possible combination of
items in the knapsack.

for example, if there are 3 items in the knapsack, I need to store the value
(v) of the items stored. Of course the knapsack capacity varies. In the
following example n= 3, i.e. there are 3 items to store, and 2^3 = 8
combinations of items.

000 = v1
010 = v2
001 = v3
011 = v4
111 = v5
101 = v6
110 = v7
111 = v8

I need to do this in vba as I'm unfamiliar with C, C++ or Java.

thanks in advance.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating subsets beejay Excel Discussion (Misc queries) 1 September 30th 08 12:30 PM
Manipulating subsets of large datasets Astrofin Excel Worksheet Functions 4 March 7th 07 05:11 PM
How to generate formula from two dimensional array of data KROATA Excel Worksheet Functions 1 December 2nd 05 12:39 PM
Getting subsets of data Roy Kirkland Excel Programming 1 November 30th 04 02:53 PM
how do I generate an array of correlated values vishs Excel Worksheet Functions 1 November 20th 04 12:24 AM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"