If i understood right, you would still need the entire map array to hold info wether or not it is part of a cell group, in this case 200x200 so we would be right where we started? With addition of more memory used.

Edit: To original question, i don't quite understand the midpoint variable and how do you want to convert a 7x4 grid to a 6x5? The function has to support skipping of numbers or?