The famous algorithm for exact cover problem is given by Donald Knuth called Knuth's Algorithm X.
Input: List of subsets of a Universal sets
Output: All the possible disjoint subset whose union is Universal set
Suppose the input is {ab, ac, cd, c, d, a, b}
. Is it possible to make the Knuth's Algorithm X such that it will give output according to some predefined block size. For example if {2, 2}
is the block size set, it will give output: {ab, cd}
, if {2,1,1}
is the block size set, it will give output: {ab, c, d}
, {ac, b, d}
and {cd, b, a}
.