tags:

views:

47

answers:

1

I have a table of data and I want to pull specific records. The records are indicated in various, nigh-random ways (how isn't important), but I want to be able to identify them using 11 specific terms. Essentially, I'm being given a lot of queries against non-indexed fields and having to rewrite them using specific indexed fields -- except thanks to an Enterprisey System it's not as simple as that: the data has to be packaged in a certain way that avoids directly touching SQL.

It might be easier to give an example in 2-dimensions, although the problem itself uses 11 that will probably change:

  123
 +---+
A|X O|
B| X |
C|X O|
 +---+

If I wanted to group all the X's in the above grid, I could say: A1 and B2 and C1. Better would be (A,C)1 and B2. Even better would be (A,B,C)(1,2) -- empty spaces can be included or excluded for this problem, they don't matter. What's important is keeping the number of groups down, getting all the Xs and avoiding all the Os.

To give a hint on sizing, the actual problem will generally deal with anywhere between 100 and 5000 "good" records. It is also not necessary to have The Ideal Answer -- a Pretty Good answer would suffice.

+2  A: 

This sounds a lot like Karnaugh maps, with X=true, 0=false, and blank="don't care".

Jim Lewis
There are similarities, but I'm not sure if it matches well enough to be usable -- I have dozens of values for each potential dimension. If it can be reduced to a Karnaugh map, it'd be a ginormous one -- unless I'm missing something.
Trevel
The number of dimensions is one aspect but if the answer set is only from (X, O, don't care) then K-Maps is a known approach. Of course if your answer set is larger ...
Sagar V
My problem is that the actual terms don't break down to boolean values. I can break the answer set down to true/false/null, but how can I break Month down to a gray code?
Trevel