Skip to main content
1 of 2
Alecto
  • 564
  • 4
  • 13

Algorithm to find most efficent partitioning of a set

Given a set $S$ with a finite number of elements, where each $s_i\in S$ is itself a set with a finite number of elements, how do you partition $S$ using as few partitions as possible, such that all elements of $S$ in each partition are disjoint?

For example, given $$S = \{\{1,2\},\{2,3\},\{1,4\},\{1,2,4,5\},\{2,5\},\{2,3,5,6\},\{3,6\},\{4,5\},\{5,6\}\}$$

we have the following partition:

enter image description here

Where each row represents a separate partition. Some simplifications to the problem are that each $s_i$ contains non-negative integers less than or equal to $n$, where $n$ is the number of elements in $\cup_{r\in S} r$.

Here's a more complex partition:

enter image description here

Alecto
  • 564
  • 4
  • 13