A grid is divided up into red cells (pixels), black cells, and white cells. We want to find the smallest boundary that:
- All red cells are within the boundary
- All cells of the boundary itself are white
The boundary can be irregular, but it must be continuous - no gaps or holes.
What algorithm can do this?
What happens if we require the boundary to be convex?
Background: The motivation came from What algorithm can expand find the irregular boundary around a drawing on a printed page?
By continuous I mean that starting from any pixel in the boundary, you can walk to any other pixel in the boundary, while never having to leave the boundary. By smallest I mean smallest area (though I conjecture it's stronger than that: I conjecture there is a boundary $S$ that any other boundary needs to include.)
(In response to a question:) We can simplify the problem by assuming: All red cells form a single axis-aligned rectangle.
