|
There are columns of data, and as a simple example they are {{1,a},{1,b},{1,c},{2,a},{2,b},{2,c},{3,a}} of two columns and seven lines. I'd like to process the data through a function which would yield {{{1,2},{a,b,c}},{{3},{a}}} which is slightly better than {{{1,2,3},{a}},{{1,2},{b,c}}} because former has 7 leaf elements vs latter 8 leaf elements while both has if you will two lines. How to write that function? |
Basically, you can map the data values into a boolean truth table representation:
And use the Karnaugh Map to visually simplify: into: If you'd like to do this algorithmically, there are Karnaugh solver libraries which use algorithms such as the https://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algori...