[R] Find a rectangle of maximal area

Ray Brownrigg Ray.Brownrigg at ecs.vuw.ac.nz
Tue Mar 23 04:40:08 CET 2010


On Tue, 23 Mar 2010, Jim Lemon wrote:
> On 03/23/2010 10:23 AM, Ray Brownrigg wrote:
> > ...
> >
> > How about less than 2 seconds? [And 500 points in less than 15 seconds -
> > on a 2-year-old DELL Optiplex GX755.]
> >
> > The implementation below (at end) loops over all 'feasible' pairs of x
> > values, then selects the largest rectangle for each pair, subject to your
> > specified constraints.  I have no idea if it implements a previously
> > published algorithm.
> >
> > Other constraints are reasonably easily accommodated.
>
> This is brilliant! May I use this algorithm, attributed to you of
> course, to improve the emptyspace function?
>
Yes, of course, but note my subsequent correction.

Ray



More information about the R-help mailing list