Maximal continuous area of 0 bits inside matrix

33 Views Asked by At

I have a matrix of 1s and 0s and am trying to find the largest continuous polygon possible of 0s, See the attached picture as an example. I'm looking for an algorithmic solution.

Any hints towards research paper of stuff like that are appreciated.

Thanks a lot !

1

There are 1 best solutions below

2
On BEST ANSWER

Define a graph with one node per matrix entry with value 0 and an edge for each pair of such entries that are adjacent. Now find the connected components of this graph and take the largest one.