Problem 56588. Exact Cover
An efficient solution to the exact cover problem can be useful in many situations. In this problem, you are welcome to use Knuth's Algorithm X (utilizing the Dancing Links technique), or any other solution.
The exact cover problem is specified here by a row vector, u, representing the universe, and a cell array, s, containing the sets (row vectors) with which to try to exactly cover the respective universe. Given u and s, return x, a cell array containing one or more sets from s that exactly cover u. If no solution exists, return an empty cell array.
For simplicity, you may assume that all universes consist of integers and that all sets in s are subsets of the respective universes. Solutions may not be unique.
Solution CommentsShow comments
Problem Recent Solvers7