Input: a set of M ordered tuples of n elements, where each element is a set, i.e.: (A1, A2, ..., An), where each Ai is a set
Problem: combine these n-tuples together to create the minimal set of n-tuples. 2 n-tuples can be combined together iff they differ only on one position, i.e.:
A = (A1, A2, ..., An) and B = (B1, B2, ..., Bn) can be combined into (A1, A2, ..., Ai U Bi, Ai+1, ..., An) iff Aj = Bj, for every j != i.
An example: Input: 4 2-tuples: ({1}, {1}), ({1}, {2}), ({3}, {1}), ({3}, {2}) Output: one 2-tuple: ({1, 3}, {1, 2})
My question is: how would you approach this problem? Do you know if it can be reduced to a known NP problem? One idea would be to model this as a graph: if tuples A and B can be combined, draw a colored edge between them with color i (i = the position where they differ).