1

Input data: a grid of cells of different colors.
Problem: how do I cover this grid with a minimal number of non-overlapping rectangles so each rectangle contains the cells of one color only?

enter image description here

11
  • @Erik Eidt, a good-enough solution achievable in short time would work as well.
    – user626528
    Aug 18, 2016 at 5:11
  • Your picture implies the colored areas of each color will always have the shape of rectangles already, as in your example? Then it is trivial, each color already represents the recangle you are looking for.
    – Doc Brown
    Aug 18, 2016 at 6:41
  • @Doc Brown, however, some of these rectangles can have size 1x1 cell ;)
    – user626528
    Aug 18, 2016 at 6:41
  • 1
    @JanDoggen: why should he? The link I gave contains an exhaustive answer on stackoverflow to his problem (don't know, however, if the OP understood that, since he did not react). No need to repeat that answer here again.
    – Doc Brown
    Aug 21, 2016 at 8:19
  • 1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.