In the following 0/1 matrix I'm trying to identify every largest submatrices formed by 1's as shown in the picture. Submatrices can have just one row only if they have more than 3 columns. Submatrices can have just one column only if they have more than 3 rows. Submatrices should have less than maxcol columns and maxrow rows and more than mincol and minrow. In the picture mincol=minrow=2. maxrow=maxcolumn=6. I've been searching for this problem, looks like an already studied problem but couldn't find it elsewhere.