# Finding squares and rectangles in sets of points

## Abstract

The following problem is studied: Given a set *S* of *n* points in the plane, does it contain a subset of four points that form the vertices of a square or rectangle. Both the axis-parallel case and the arbitrarily oriented case are studied. We also investigate extensions to the *d*-dimensional case. Algorithms are obtained that run in *O*(*n*^{1+1/d}log *n*) time for axis-parallel squares and *O*(*n*^{2−1/d}) time for axis-parallel rectangles. For arbitrarily oriented squares the time bounds are *O*(*n*^{2}log *n*), *O n*^{3}) and *O*(*n*^{d−1/2}β(*n*)) for *d*=2, *d*=3 and *d*≥4, respectively (where β(*n*) is related to the inverse of Ackermann's function), whereas the algorithm for arbitrarily oriented rectangles takes time *O*(*n*^{ d }log*n*). Furthermore, it is shown that recognizing axisparallel rectangles is equivalent to recognizing a *K*_{2,2}-subgraph in a bipartite graph, resulting in a *O*(‖*E*‖ √‖*E*‖) time and *O*(‖*V*‖ + ‖E‖) space solution to this problem. Also, combinatorial results on the maximal number of squares and rectangles any point set can contain are given.

## Keywords

Bipartite Graph Small Subset Edge Length Large Subset Pointer Structure## Preview

Unable to display preview. Download preview PDF.

## References

- [1]Chiba, N. and T. Nishizeki, Arboricity and subgraph listing algorithms,
*SIAM J. on Computing 14*(1985), pp. 210–223.CrossRefGoogle Scholar - [2]Chung, F.R.K., Sphere-and-point incidence relations in high dimensions with applications to unit distances and furthest-neighbor pairs,
*Discr. and Comp. Geometry 4*(1989), pp. 183–190.Google Scholar - [3]Clarkson, K.L., H. Edelsbrunner, L.J. Guibas, M. Sharir and E. Welzl, Combinatorial complexity bounds for arrangements of curves and surfaces,
*29*^{th}*Ann. Symp. on Found. of Comp. Sci.*(1988), pp. 568–579.Google Scholar - [4]Erdös, P., On sets of distances of
*n*points,*Amer. Math. Monthly 53*(1946), pp. 248–250.Google Scholar - [5]Erdös, P., On sets of distances of
*n*points in Euclidian space,*Magyar Tud. Akad. Mat. Kutaló Int. Kozl. 5*(1960), pp. 165–169.Google Scholar - [6]Kövári, T., V.T. Sós and P. Turán, On a problem of K. Zarankiewicz,
*Colloquium Math. 3*(1954), pp. 50–57.Google Scholar - [7]Spencer, J., E. Szemerédi and W.T. Trotter, Jr., Unit distances in the Euclidean plane,
*Graph Theory and Combinatorics*, Academic Press, London, 1984, pp. 293–303.Google Scholar