# How can I compute maximal area including only given integer pairs of (x,y) coordinates?

The values ​​of a function of two variables z = f (x, y), where x, y, z take integer values are stored in sql db. Calculate (appoint) the largest surface area of ​​the flat. By 'flat area' we mean an area about which for each pair of x and y lying inside the area about the value of the function is constant (z = const).

I have already tried to use this flood fill algorithm, but I am not sure if this is the right way. e.g. if I have pairs(x,y) as follows: (0,0),(0,2),(2,0),(2,2) for which z equals to 5(z=const) and have point (1,1) where z=1 - how should I compute "flat area"?

• What have you tried so far? We can help clarify things if you're genuinely stuck, but we won't really do your homework for you. Apr 21, 2013 at 12:57
• Right, of course. I have already tried to use for this flood fill algorithm, but i am not sure if this is right way. e.g. if i have pairs(x,y) as follows: (0,0),(0,2),(2,0),(2,2) for which z equals to 5(z=const) and have point (1,1) where z=1 - how should i compute "flat area"? Apr 21, 2013 at 13:06
• you mean getting the convex hull of a set of points? Apr 21, 2013 at 15:02