Sounds a lot like a NP problem to me. That means, there are certainly a couple of algorithms that can quickly fill your shape with rectangles, if the number of rectangles doesn't really matter to you, but if you insist on the smallest number, then you better forget about the word "quick". Actually you should even forget about the word "smallest" and instead use "small", since determining if the set is smallest could already be a huge problem for the algorithm.