This paper investigates the properties of convex polygons within Cartesian product point sets, establishing bounds on their size, providing algorithms for specific convex chains, and analyzing the maximum number of convex point sets in grids.
Contribution
It proves tight bounds on convex polygons in grids, extends results to higher dimensions, and offers efficient algorithms and bounds for convex chains and point sets.
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputational Geometry and Mesh Generation · Robotics and Sensor-Based Localization · Digital Image Processing Techniques
Full text
Convex Polygons in Cartesian Productsâ â thanks: This work was initiated at the 2017 Fields Workshop on Discrete and Computational Geometry (Carleton University, Ottawa, ON, July 31âAugust 4, 2017).
Jean-Lou De Carufel
School of Electrical Engineering and Computer Science, University of Ottawa, Canada,
[email protected]. This work has been supported by NSERC.
ââ
Adrian Dumitrescu
Algoresearch L.L.C., Milwaukee, WI, USA, [email protected]
ââ
Wouter Meulemans
Department of Mathematics and Computer Science, TU Eindhoven, The Netherlands,
[email protected]
ââ
Tim Opheldersâ44footnotemark: 4
Department of Information and Computing Sciences, Utrecht University, The Netherlands,
[email protected]
ââ
Csaba D. Tóth
Department of Mathematics, California State University Northridge, Los Angeles, CA; and Department of Computer Science, Tufts University, Medford, MA, USA,
[email protected]
ââ
and Sander Verdonschot
School of Computer Science, Carleton University, Canada, [email protected]
Can a convex polygon P in the plane be reconstructed from the projections of its vertices to the coordinate axes?
Assuming that no two vertices of P share the same x- or y-coordinate, we arrive at the following problem: given two sets, X and Y, each containing n real numbers, does the Cartesian product XĂY support a convex polygon with n vertices?
We say that XĂYcontains a polygon P if every vertex of P is in XĂY; and XĂYsupportsP if it contains P and no two vertices of P share an x- or y-coordinate. For short, we call the Cartesian product XĂY an nĂn grid.
Not every nĂn grid supports a convex n-gon. This is the case already for n=5 (see Figure 1). Several interesting questions arise: can we decide efficiently whether an nĂn-grid supports a convex n-gon? How can we find the largest k such that it contains (resp., supports) a convex k-gon? What is the largest k such that everynĂn grid supports a convex k-gon? How many convex polygons does an nĂn grid contain, or support? We initiate the study of these questions for convex polygons, and their higher dimensional variants for convex polyhedra.
Related work.
ErdĆs and Szekeres proved, as one of the first Ramsey-type results in combinatorial geometry [19], that for every kâN, a sufficiently large point set in the plane in general position contains k points in convex position. The minimum cardinality of a point set that guarantees k points in convex position is known as the ErdĆsâSzekeres number, f(k). They proved that 2kâ2+1â€f(k)â€(kâ22kâ4â)+1=4k(1âo(1)), and conjectured that the lower bound is tight [17].
The current best upper bound, due to Suk [32], is f(k)â€2k(1+o(1)).
In other words, every set of n points in general position in the plane contains (1âo(1))logn points in convex position, and this bound is tight up to lower-order terms.
Algorithmically, one can find a largest convex cap in a given set of n points in R2 in O(n2logn) time by dynamic programming [11], and a largest subset in convex position in O(n3) time [8, 11].
The same approach can be used for counting the number of convex polygons contained in a given point set [23]. While this approach applies to grids, it is unclear how to include the restriction that each coordinate is used at most once. On the negative side, finding a largest subset in convex position in a point set in Rd for dimensions dâ„3 was recently shown to be NP-hard [18].
There has been significant interest in counting the number of convex polygons in various point sets.
Answering a question of Hammer, ErdĆs [16] proved that every set of n points in general position in R2 contains exp(Î(log2n)) subsets in convex position, and this bound is the best possible.
Båråny and Pach [3]
showed that the number of convex polygons in an nĂn section of the integer lattice is exp(O(n1/3)). BĂĄrĂĄny and Vershik [4] generalized this bound to d-dimensions and showed that there are exp(O(n(dâ1)/(d+1))) convex polytopes in an nĂâŻĂn section of Zd. Note that the exponent is sublinear in n for every dâ„2. We prove that an nĂn Cartesian product can contain exp(Î(n)) convex polygons, significantly more than integer grids, and our bounds are tight up to polynomial factors.
Motivated by integer programming and geometric number theory, lattice polytopes (whose vertices are in Zd) have been intensely studied; refer to [2, 5]. However, results for lattices do not extend to arbitrary Cartesian products. Recently, several deep results have been established for Cartesian products in incidence geometry and additive combinatorics [26, 27, 28, 31], while the analogous statements
for point sets in general position remain elusive.
Definitions.
A polygon P in R2 is convex if all of its internal angles are strictly smaller than Ï.
A point set in R2 is in convex position if it is the vertex set of a convex polygon; and it is in general position if no three points are collinear. Similarly, a polyhedron P in Rd is convex if it is the convex hull of a finite set of points. A point set in Rd is in convex position if it is the vertex set of a convex polyhedron; and it is in general position if no d+1 points lie on a hyperplane. The 1-skeleton of a polyhedron is the graph formed by its vertices and edges. In Rd, we say that the xdâ-axis is vertical, hyperplanes orthogonal to the xdâ-axis are horizontal, and the above-below relationship is understood with respect to xdâ coordinates.
We consider special types of convex polygons in the plane. Let P be a convex polygon with vertices ((x1â,y1â),âŠ,(xkâ,ykâ)) in clockwise order. We say that P is a convex cap if the x- or y-coordinates are strictly monotone, and a convex chain if both the x- and y-coordinates are strictly monotonic. We distinguish four types of convex caps (resp., chains) based on the monotonicity
of the coordinates as follows:
âą
convex caps come in four types \{\text{\curvearrowright},\rotatebox[origin={c}]{90.0}{\text{\curvearrowright}},\rotatebox[origin={c}]{180.0}{\text{\curvearrowright}},\rotatebox[origin={c}]{270.0}{\text{\curvearrowright}}\}. We have
P\in\text{\curvearrowright}
if and only if (xiâ)i=1kâ strictly increases;
P\in\rotatebox[origin={c}]{90.0}{\text{\curvearrowright}}
if and only if (yiâ)i=1kâ strictly increases;
P\in\rotatebox[origin={c}]{180.0}{\text{\curvearrowright}}
if and only if (xiâ)i=1kâ strictly decreases;
P\in\rotatebox[origin={c}]{270.0}{\text{\curvearrowright}}
if and only if (yiâ)i=1kâ strictly decreases;
âą
convex chains come in four types { \leavevmodeto6.1pt\vboxto6.11pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke    \pgfsys@beginscope\pgfsys@setlinewidth0.32pt\pgfsys@setdash0.0pt\pgfsys@roundcap\pgfsys@roundjoin   \pgfsys@moveto-1.19998pt1.59998pt\pgfsys@curveto-1.09998pt0.99998pt0.0pt0.09999pt0.29999pt0.0pt\pgfsys@curveto0.0pt-0.09999pt-1.09998pt-0.99998pt-1.19998pt-1.59998pt\pgfsys@stroke\pgfsys@endscope \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture,\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture ,\rotatebox[origin=c]180.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture,\rotatebox[origin=c]90.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture}. We have
Initial observations.
It is easy to see that for nâ{3,4}, every nĂn grid supports a convex n-gon. However, there exists a 5Ă5 grid that does not support any convex pentagon (cf. Figure 1).
Interestingly, every 6Ă6 grid supports a convex pentagon.
Lemma 1**.**
Every 6Ă6 grid XĂY supports a convex polygon of size at least 5.
Proof.
Refer to Figure 2 for illustration. Let x1â,âŠ,x6â and y1â,âŠ,y6â denote the vertices of X and Y in increasing order.
Consider first the 4Ă4 subgrid obtained by omitting the extremal values, that is, {x2â,âŠ,x5â}Ă{y2â,âŠ,y5â}.
As the 2Ă2 grid {x3â,x4â}Ă{y3â,y4â} consists of four corners of a rectangle, at least two of these points are not collinear with (x2â,y2â) and (x5â,y5â); let (xâČ,yâČ) denote such a point and xâČâČâ{x3â,x4â} and yâČâČâ{y3â,y4â} denote the unused coordinates. Now, PâČ={(x2â,y2â),(xâČ,yâČ),(x5â,y5â)} is a supported convex chain of the subgrid and thus of XĂY. By construction, PâČ is either in or
; without loss of generality, assume the former.
We now extend PâČ to a convex polygon P of size 5 by appending two vertices: (x6â,yâČâČ) and (xâČâČ,y1â).
By construction, all five vertices of P have distinct coordinates.
Moreover, the points in P are in convex position, as each is an extreme point in P:
(x2â,y2â) has the lowest x-coordinate; (x5â,y5â) has the highest y-coordinate; (x6â,yâČâČ) has the maximum x-coordinate; and (xâČâČ,y1â) has the minimum y-coordinate. Finally, (xâČ,yâČ) is an extreme point in PâČ, hence PâČ has a supporting halfplane h whose boundary contains (xâČ,yâČ). Since PâČâh, and we have x2â<xâČâČ<x4â and y2â<yâČâČ<y4â, the halfplane h contains (x6â,yâČâČ) and (xâČâČ,y1â), as well, (xâČ,yâČ) is an extreme point in P. Thus, we conclude that P is a supported convex polygon of size 5 on XĂY.
â
Note that, although every pentagon supported by a grid lies on a 5Ă5 subgrid, the proof above does not work on a 5Ă5 grid. If we start with a 5Ă5 grid, and choose PâČ from an off-center 4Ă4 subgrid, then we might not add be able to add two points from the remaining 2Ă2 subgrid. Specifically, the coordinates of the 4Ăt grid may force PâČ to be of a specific type: the example in Figure 2 prevents PâČ from being in
as all four central points are above the dotted line. Starting with a 6Ă6 grid, we know there are two extra points on the outer boundary that can be added to PâČ, regardless of the type of the chain PâČ.
2 Extremal bounds for convex polytopes in Cartesian products
For the upper bound, we construct nĂn Cartesian products that do not support large convex chains. For n=8, such a grid is depicted in Figure 3.
Lemma 4**.**
For every nâN, there exists an nĂn grid that
contains at most âlognâ+1 points in a convex chain;
consequently, at most 4(âlognâ+1) points in convex position.
Proof.
Let g(n) be the maximum integer such that for all n-element sets X,YâR,
the grid XĂY supports a convex polygon of size g(n); clearly g(n) is nondecreasing. Let k be the minimum integer such that nâ€2k; thus âlognââ€k and g(n)â€g(2k). We show that g(2k)â€4(k+1) and thereby establish that g(n)â€4(k+1).
Assume, without loss of generality, that n=2k, and let X={0,âŠ,nâ1}.
For a k-bit integer m, let miâ be the bit at its i-th position, such that m=âi=0kâ1âmiâ2i.
Let Y={âi=0kâ1âmiâ(2n)i:0â€mâ€nâ1} (see Figure 3).
Both X and Y are symmetric: X={max(X)âx:xâX} and Y={max(Y)ây:yâY}. Thus, it suffices to show that no convex chain Pâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture of size greater than k+1 exists.
Consider two points, p=(x,y) and pâČ=(xâČ,yâČ), in XĂY such that x<xâČ and y<yâČ.
Assume y=âi=0kâ1âmiâ(2n)i and yâČ=âi=0kâ1âmiâČâ(2n)i.
The slope of the line spanned by p and pâČ is slope(p,pâČ)=âi=0kâ1â(miâČââmiâ)(2n)i/(xâČâx).
Let j be the largest index such that mjâî =mjâČâ. Then y<yâČ implies mjâ<mjâČâ,
and we can bound the slope as follows:
[TABLE]
[TABLE]
Hence, slope(p,pâČ)âIjâ, where Ijâ=(2â (2n)jâ1,2â (2n)j).
Let us define the family of intervals I0â,I1â,âŠ,Ikâ1â analogously, and
note that these intervals are pairwise disjoint.
Suppose that some convex chain Pâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture contains more than k+1 points.
Since the slopes of the first k+1 edges of P decrease monotonically, by the pigeonhole principle, there must be three consecutive vertices p=(x,y), pâČ=(xâČ,yâČ), and pâČâČ=(xâČâČ,yâČâČ) of P such that both slope(p,pâČ) and slope(pâČ,pâČâČ) are in the same interval, say Ijâ.
Assume that y=âi=0kâ1âmiâ(2n)i, yâČ=âi=0kâ1âmiâČâ(2n)i,
and yâČâČ=âi=0kâ1âmiâČâČâ(2n)i.
Then j is the largest index such that mjâî =mjâČâ, and also the largest index such that mjâČâî =mjâČâČâ.
Because m<mâČ<mâČâČ, we have mjâ<mjâČâ<mjâČâČâ, which is impossible since each of mjâ, mjâČâ and mjâČâČâ is either [math] or 1.
Hence, XĂY does not contain any convex chain in of size greater than k+1.
Analogously, every convex chain in
â,
, or
has at most k+1 vertices.
Consequently, XĂY contains at most 4(k+1) points in convex position.
â
2.3 Upper bounds in higher dimensions
We construct Cartesian products in Rd, for dâ„3, that match the best known upper bound O(logdâ1n) for the ErdĆsâSzekeres numbers in d-dimensions for points in general position. Our construction generalizes the ideas from the proof of Lemma 4 to d-space.
Lemma 5**.**
Let dâ„2 be an integer. For every integer nâ„2, there exist n-element sets XiââR for i=1,âŠ,d, such that the Cartesian product X=âi=1dâXiâ contains at most O(logdâ1n) points in convex position.
Before proving Lemma 5, we introduce some additional terminology
and give a brief overview of key ideas. Let d be a positive integer. Let edâ be the standard basis vector parallel to the xdâ-axis in Rd.
For a point aâRd, let aproj denote the orthogonal projection of a to the horizontal hyperplane xdâ=0. Let PâRd be a finite set in convex position; refer to Figure 4.
The point set P is full-dimensional if no hyperplane contains P.
The orthogonal projection of conv(P) to the hyperplane xdâ=0 is a convex polytope in Rdâ1 that we denote by conv(P)proj. The silhouette of P is the subset of points in P whose orthogonal projection to xdâ=0 lies on the boundary of conv(P)proj. Note that for every point pâP in the silhouette of P, the projection pproj is either a vertex of conv(P)proj or lies in the relative interior of a face of conv(P)proj.
Since no three points in P are collinear, at most two points in P are projected to any point in the hyperplane xdâ=0.
A point pâP is an upper (resp., lower) vertex if P lies in the closed halfspace below (resp., above) some tangent hyperplane of conv(P) at p (a point in P may be both upper and lower vertex).
For an integer kâ{1,âŠ,d}, a k-dimensional flat (for short, k-flat) is axis-aligned if it is parallel to k coordinate axes; similarly, a k-dimensional polytope (k-polytope) is axis-aligned if its affine hull is an axis-aligned k-flat.
A k-flat or k-polytope is vertical if its affine hull is parallel to the xdâ-axis; or equivalently if it contains a nondegenerate line segment parallel to the xdâ-axis.
The proof of Lemma 5 is constructive. For integers 0â€iâ€j,
we recursively define a 2jĂâŠĂ2jĂ2i grid in Rd, and denote it by Sdâ(i,j). For iâ„1, the grid Sdâ(i,j) is the disjoint union of two translated copies of Sdâ(iâ1,j), one above the other. Then we prove that every d-dimensional subset PâSdâ(i,j) in convex position contains at most 2d(d+1)â iâ jdâ2 upper (resp., lower) vertices. For i=j=logn, this implies that âŁPâŁâ€2â 2d(d+1)â jdâ1=Î(logdâ1n). The number of upper vertices in P can be bounded as follows (the case of lower vertices is analogous). We partition the upper vertices in P into three subsets: (1) Upper vertices pâP such that pproj is a vertex of conv(P)proj in (dâ1)-dimensions. As pproj may be an upper or a lower vertex in Sdâ1â(j,j), by induction, there are at most 2â 2(dâ1)dâ jdâ2 such points. (2) Upper vertices pâP such that pproj lies in the interior of conv(P)proj. We prove that one of the two translated copies of Sdâ(iâ1,j) contains these points as upper vertices, and by induction there are at most 2d(d+1)â (iâ1)â jdâ2 such points.
(3) Upper vertices pâP such that pproj lies on the boundary of conv(P)proj, but in the relative interior of some face of conv(P)proj; see Figure 4 for examples. We show that only axis-aligned faces of conv(P)proj can contain interior grid points. We can control the number of such faces and such interior points by induction. Summation over axis-aligned faces of dimensions 1,âŠ,dâ1 yields an upper bound of (2dâ1â2)2(dâ1)d+3â jdâ2 for such points. Summation over (1)â(3) yields the desired upper bound 2d(d+1)â iâ jdâ2 for the number of upper (resp., lower) vertices.
It is enough to prove the claim when n=2j for integers jâ„0. For integers dâ„3 and 0â€iâ€j, we recursively define the grid Sdâ(i,j) as a Cartesian product of d sets of reals, where the first dâ1 sets have 2j elements and the last set has 2i elements. In particular, âŁSdâ(i,j)âŁ=2i+(dâ1)j. We then show that Sdâ(i,j) does not contain the vertex set of any full-dimensional convex polyhedron with more than 2(d2+d+1)â iâ jdâ2 vertices.
To initialize the recursion, we define boundary values as follows: For every integer jâ„0, let S2â(j,j) be the 2jĂ2j grid defined in the proof of Lemma 4 that does not contain more than 4(j+1) points in convex position. Note that every line that contains 3 or more points from S2â(j,j) is axis-parallel (this property was not needed in the proof of Lemma 4).
Assume now that dâ„3, and Sdâ1â(j,j) has been defined for all jâ„0; and for all kâ{1,âŠ,dâ2}, if a point pâSdâ1â(j,j) lies in the relative interior of k-polytope F whose vertices are in Sdâ1â(j,j), then F is axis-aligned.
Let j be a nonnegative integer. We now construct Sdâ(i,j) for all integers 0â€iâ€j as follows.
Let Sdâ(0,j)=Sdâ1â(j,j)Ă{0}. For i=1,âŠ,j, we define Sdâ(i,j) as the disjoint union of two translates of Sdâ(iâ1,j). Specifically, let Sdâ(i,j)=AâȘB, where A=Sdâ(iâ1,j) and B=A+λdiâedâ, where λdiâ>0 is
a (large) scalar satisfying the following two conditions.
(C1)
For all pâAâȘB and QâAâȘB, if p is in the relative interior of conv(Q), then conv(Q) is an axis-aligned polytope.
2. (C2)
For all paââA, pbââB, and QâSdâ(0,j)=Sdâ1â(j,j)Ă{0}, if both paprojâ and pbprojâ are in the relative interior of conv(Q), then the line paâpbâ intersects the horizontal hyperplane xdâ=0 in the relative interior of conv(Q).
To satisfy condition (C2), notice that for any paââA and pbââB, the intersection of the line paâpbâ and the hyperplane xdâ=0 can be arbitrarily close to paprojâ if λdiâ>0 is sufficiently large.
This completes the definition of Sdâ(i,j) for dâ„3 and 0â€iâ€j.
Note, however, that in each iteration of the recursive contraction of Sdâ(i,j), we only imposed lower bounds for the scalars λdiâ, and different values of these parameters would yield different point sets. For all integers dâ„1 and 0â€iâ€j, let Sdâ(i,j) denote the collection of all 2jĂâŠĂ2jĂ2i grids that can be obtained by the recursive construction above, in particular every grid in Sdâ(i,j) satisfies both (C1) and (C2) in each iteration. Our proof relies on the following relation between these constructions.
In the remainder of the proof, we establish the following claim by induction:
Claim 2**.**
Let 2â€d and Sdâ(i,j)âSdâ(i,j). If PâSdâ(i,j) is a d-dimensional set in convex position, then P contains at most 2d(d+1)â iâ jdâ2 upper (resp., lower) vertices of conv(P).
We prove Claim 2 by induction on d+i. We focus on the number of upper vertices in P, the case of lower vertices follows analogously (e.g., by reflection in a horizontal hyperplane).
In the base case, we have d=2 and i=0. Then the set Sdâ(0,j)=Sdâ1â(j,j)Ă{0} lies in a horizontal hyperplane in Rd, and so a subset PâSdâ(0,j) cannot be full-dimensional, hence the claim vacuously holds for all PâSdâ(0,j). We observe a key property for P (which will be used in the case i=1). If d=2 and PâSdâ(0,j) is a 1-dimensional set, then P has precisely two extreme points in R2.
If dâ„3 and PâSdâ(0,j) is a (dâ1)-dimensional set, then by induction it contains at most 2(dâ1)dâ jâ jdâ3 upper (resp., lower) vertices in Rdâ1, hence it has at most 2â 2(dâ1)dâ jdâ2 extreme points in Rd.
In the general case, we assume that 2â€iâ€j, the claim holds for Sdâ(iâ1,j), and either d=2 or the claim holds for Sdâ1â(j,j), as well. We prove the claim for Sdâ(i,j). Recall that Sdâ(i,j) is the disjoint union of two translates of Sdâ(iâ1,j), namely A=Sdâ(iâ1,j) and B=Sdâ(iâ1,j)+λdiâedâ. Let PâSdâ(i,j) be a full-dimensional set in convex position. We partition the upper vertices in P as follows. For every upper vertex p, we have pprojâconv(P)proj,
and pproj is either a vertex of conv(P)proj or lies in the relative interior of a k-face of conv(P)proj for some kâ{1,âŠ,dâ1}.
Let P0â be the set of upper vertices pâP such that pproj is a vertex of conv(P)proj.
For all kâ{1,âŠ,dâ1}, let PkââP be the set of upper vertices of P such that pproj lies in the relative interior of a k-face of conv(P)proj.
Then âk=0dâ1âPkâ is the set of all upper vertices in P.
The orthogonal projection of Sdâ(i,j) to the hyperplane xdâ=0 is Sdâ1â(j,j), and the orthogonal projection of P0â, denoted P0projââSdâ1â(j,j), is the vertex set of a (dâ1)-dimensional convex polyhedron. By induction, âŁP0ââŁâ€2â 2(dâ1)dâ jâ jdâ3=2(dâ1)d+1jdâ2. To derive an upper bound on âŁPkâ⣠for kâ{1,âŠ,dâ1},
note that only axis-aligned faces of conv(P)proj can contain grid points of Sdâ1â(j,j) in their relative interior by condition (C1).
In order to complete the proof of Claim 2, we prove the following.
Claim 3**.**
For every axis-aligned face F of conv(P)proj,
either A or B contains all upper (resp., all lower)
vertices that project to the relative interior of F.
Let F be an axis-aligned k-face of conv(P)proj for kâ{1,2,âŠ,dâ1}.
Let P(F)âP be the set of upper vertices pâP such that pproj lies in the relative interior of F,
and let V(F) be the vertex set of F.
Since F is a face of the convex polytope conv(P)proj in the horizontal hyperplane xdâ=0,
we have V(F)âSdâ1â(j,j) and V(F) is in convex position.
Consider the point set PâČ=V(F)âȘP(F), and observe that if P(F)î =â , then PâČ is the vertex set of the (k+1)-polytope conv(PâČ), in which F is one of the facets.
We can now finish the proof of Claim 2.
We have seen that âŁP0ââŁâ€2(dâ1)d+1jdâ2.
It remains to bound âŁPkâ⣠for kâ{1,âŠ,dâ1}. Note that conv(P)proj is a (dâ1)-dimensional polytope. We can apply Claim 3 for k=dâ1 and F=conv(P)proj, and conclude that either A or B contains all points in Pdâ1â. The points in Pdâ1â are upper vertices of conv(Pdâ1â). Since both A and B are translates of Sdâ(iâ1,j), the induction hypothesis yields âŁPdâ1ââŁâ€2d(d+1)â (iâ1)â jdâ2.
For kâ{1,âŠ,dâ2}, the axis-aligned k-faces of conv(P)proj
are partitioned into (kdâ1â) equivalence classes. In each equivalence class, the k-faces F are parallel to the same coordinate axes. In the projection to an orthogonal (dâkâ1)-dimensional space (of the hyperplane xdâ=0), they become vertices of a (dâkâ1)-polytope. By induction, the number of (upper and lower) vertices of such a polytope is
bounded above by
2â 2(dâkâ1)(dâk)j(dâkâ1)â1=2(dâkâ1)(dâk)+1jdâkâ2;
this is an upper bound on the size of the equivalence class.
Each axis-aligned k-face F of conv(P)proj is the orthogonal projection of some axis-aligned (k+1)-face of conv(P), that we denote by F. Claim 1 with â=k+1â€dâ1 implies that the induction hypothesis holds for F, and it yields an upper bound of 2(k+1)(k+2)â jk for the number of upper vertices in F. Overall, we have
[TABLE]
where we used that (dâkâ1)(dâk)+1+(k+1)(k+2)=(dâ1)d+2k(k+2âd)+3â€(dâ1)d+3 for all
kâ{1,âŠ,dâ2} and dâ„3. Altogether, the number of upper vertices is
[TABLE]
as required, where we used the binomial theorem.
This completes the proof of Claim 2.
Claim 2 immediately implies Lemma 5 by taking n=2j and X=Sdâ(j,j), since 2â 2d(d+1)â jdâ1=Î(logdâ1n) for every fixed dâ„2.
â
We say that a strictly increasing sequence of real numbers A=(a1â,âŠ,anâ) has the monotone differences property (for short, A is MD) if
âą
ai+1ââaiâ>aiââaiâ1â for i=2,âŠ,nâ1, or
âą
ai+1ââaiâ<aiââaiâ1â for i=2,âŠ,nâ1.
Furthermore, the sequence A is r-MD for some r>1 if
âą
ai+1ââaiââ„r(aiââaiâ1â) for i=2,âŠ,nâ1, or
âą
ai+1ââaiââ€(aiââaiâ1â)/r for i=2,âŠ,nâ1.
A finite set XâR is MD (resp., r-MD) if its elements arranged in increasing order form an MD (resp., r-MD) sequence. These sequences are intimately related to convexity: a strictly increasing sequence A=(a1â,âŠ,anâ) is MD if and only if there exists a monotone (increasing or decreasing) convex function f:RâR such that aiâ=f(i) for all i=1,âŠ,n. MD sets have been studied in additive combinatorics [13, 21, 26, 30].
Every set of n real numbers contains an MD subset of size â(logn)/2â+1.
For every nâN, there exists a set of n real numbers in which the size of
every MD subset is at most âlognâ+1.
Proof.
Let X=(x0â,âŠ,xnâ1â) be a strictly increasing sequence. Assume, without loss of generality, that n=2â+1 for some ââN. We construct a sequence of nested intervals
[TABLE]
such that the endpoints of the intervals are in X and the lengths of the intervals decrease by factors of 2 or higher, that is, biââaiââ€(biâ1ââaiâ1â)/2 for i=1,âŠ,â.
We start with the interval [a0â,b0â]=[x0â,xnâ1â]; and for every i=0,âŠ,ââ1, we divide [aiâ,biâ] into two intervals at the median, and recurse on the shorter interval; see Figure 5.
By partitioning [aiâ,biâ] at the median, the algorithm maintains the invariant that [aiâ,biâ] contains 2ââi+1 elements of X. Note that for every i=1,âŠ,â, we have either (aiâ1â=aiâ and biâ1â>biâ) or (aiâ1â<aiâ and biâ=biâ1â). Consequently, the sequences A=(a0â,a1â,âŠ,aââ) and B=(bââ,bââ1â,âŠ,b0â) both increase (not necessarily strictly), and at least one of them contains at least 1+â/2 distinct terms. Assume, without loss of generality, that A contains at least 1+â/2 distinct terms. Let C=(c0â,âŠ,ckâ) be a maximal strictly increasing subsequence of A. Then kâ„â/2=â(logn)/2â.
We show that C is an MD sequence. Let iâ{1,âŠ,kâ1}.
Assume that ciâ=ajâ=âŠ=ajâČâ for consecutive indices j,âŠ,jâČ.
Then ciâ1â=ajâ1â, ciâ=ajâ, and ci+1â=ajâČ+1â. By construction, ciââ[ajâ1â,bjâ1â]=[ciâ1â,bjâ] such that ciââciâ1ââ„bjââciâ. Similarly, ci+1ââ[ajâČâ,bjâČâ]=[ciâ,bjâČâ] such that
ci+1ââciââ„bjâČââci+1â. However, [ajâ,bjâ]â[ajâ1â,bjâ1â]. As required, this yields
[TABLE]
For the upper bound, consider the nĂn grid {0,âŠ,nâ1}ĂY, defined in the proof of Lemma 4, for which every chain in
or
supported by
{0,âŠ,nâ1}ĂY has at most âlognâ+1 vertices.
We claim that the size of every MD subset of YâR is at most âlognâ+1. Let {b0â,âŠ,bââ1â}âY be an MD subset such that b0â<âŠ<bââ1â. Then {(i,biâ):i=0,âŠ,ââ1}âXĂY is in
or
. Consequently, every MD subset of Y has at most âlognâ+1 terms, as claimed.
â
We show how to use Lemma 7 to establish a lower bound in the plane. While this approach yields worse constant coefficients than Lemma 3, its main advantage is that it generalizes to higher dimensions (see Lemma 10 below).
Lemma 8**.**
The Cartesian product of two MD sets, each of size n, supports n points in convex position.
Proof.
Let A={a1â,âŠ,anâ} and B={b1â,âŠ,bnâ} be MD sets
such that aiâ<ai+1â and biâ<bi+1â for iâ{1,âŠ,nâ1}.
We may assume, by applying a reflection if necessary,
that ai+1ââaiâ<aiââaiâ1â and bi+1ââbiâ<biââbiâ1â,
for iâ{2,âŠ,nâ1}; see Figure 6.
We define PâAĂB as the set of n points (aiâ,bjâ) such that i+j=n+1.
By construction, every horizontal (vertical) line contains at most one point in P.
Since the differences aiââaiâ1â are positive and strictly decrease in i;
and the differences bnâiââbnâiâ1â are also positive and strictly decrease in i, the slopes (bnâiââbnâiâ1â)/(aiââaiâ1â) strictly decrease, which proves the convexity of P.
â
Lemma 9**.**
The Cartesian product of three MD sets, each of size n, contains (2n+1â) points in convex position.
Proof.
Let A={a1â,âŠ,anâ}, B={b1â,âŠ,bnâ}, and C={c1â,âŠ,cnâ}
be MD sets, where the elements are labeled in increasing order.
We may assume, by applying a reflection in the x-, y-, or z-axis if necessary, that
[TABLE]
for i=2,âŠ,nâ1.
For i,j,kâ{1,âŠ,n}, let pi,j,kâ=(aiâ,bjâ,ckâ)âAĂBĂC.
We can now let P={pi,j,kâ:i+j+k=n+2}. It is clear that âŁPâŁ=âi=1nâi=(2n+1â).
We let PâČ=PâȘ{p1,1,1â} and show that the points in PâČ are in convex position.
By Lemma 8, the points in PâČ lying in the planes x=a1â, y=b1â, and z=c1â are each in convex position.
These convex (n+1)-gons are faces of the convex hull of P, denoted conv(P). We show that the remaining faces of conv(P) are the triangles Ti,j,kâČâ spanned by pi,j,kâ, pi,j+1,kâ1â, and pi+1,j,kâ1â; and the triangles Ti,j,kâČâČâ spanned by pi,j,kâ, pi,jâ1,k+1â, and piâ1,j,k+1â.
The projection of these triangles to an xy-plane is shown in Figure 6. By construction, the union of these faces is homeomorphic to a sphere. It suffices to show that the dihedral angle between any two edge-adjacent triangles is convex.
Without loss of generality, consider triangle Ti,j,kâČâ, which shares an edge with (up to) three other triangles:
Ti+1,j,kâ1âČâČâ, Ti,j+1,kâ1âČâČâ, and Ti+1,j+1,kâ2âČâČâ. Consider first the triangles
Ti,j,kâČâ and Ti+1,j+1,kâ2âČâČâ. They share the edge pi+1,jâ1,k+1âpiâ1,j+1,k+1â, which lies in the xy-plane z=ck+1â. The orthogonal projections of these triangles to an xy-plane are congruent, however their extents in the z-axis
are ci+1ââciâ and ciââciâ1â, respectively. Since ci+1ââciâ<ciââciâ1â, their dihedral angle is convex.
Similarly, the dihedral angles between Ti,j,kâČâ and Ti+1,j,kâ1âČâČâ (resp., Ti,j+1,kâ1âČâČâ) is convex
because ai+1ââaiâ<aiââaiâ1â and bi+1ââbiâ<biââbiâ1â.
â
The proof technique of Lemma 9 generalizes to higher dimensions:
We proceed by induction on d. For d=2 and d=3, Lemmas 8 and 9 prove the claim.
Assume that dâ„4, and the claim holds in lower dimensions.
For every iâ{1,âŠ,d}, let Aiâ={ai,1â,âŠ,ai,nâ}âR be an MD set such that ai,1â<âŠ<ai,nâ. We may assume, without loss of generality, that the differences between consecutive elements in Aiâ strictly decrease for all iâ{1,âŠ,d}.
For every vector v=(v1â,âŠ,vdâ)â{1,âŠ,n}d, let pvâ=(a1,v1ââ,a2,v2ââ,âŠ,ad,vdââ)ââi=1dâAiâ. Let P={pvâ:âi=1dâviâ=n+dâ1}.
It is easy to see that âŁPâŁ=Î(ndâ1). Let PâČ=PâȘ{p1,âŠ,1â}.
We show that the points in PâČ are in convex position. We define a (dâ1)-dimensional piecewise linear manifold M as the union of (dâ1)-dimensional convex polyhedra (facets). We show that M is homeomorphic to the sphere Sdâ1. We also show that M is the boundary of a convex polytope by verifying that the dihedral angle between any two adjacent facets is convex. It follows that M is the boundary of conv(PâČ), consequently PâČ is in convex position.
Now Theorem 6 follows from Lemma 7 and Lemma 10.
3 Algorithms
In this section, we describe polynomial-time algorithms for
(i) finding convex chains and caps of maximum size; and
(ii) approximating the maximum size of a convex polygon;
where these structures are supported by a given grid.
The main challenge is to ensure that the vertices of the convex polygon (resp., chain) have distinct x- and y-coordinates. The coordinates of a point pâXĂY are denoted by x(p) and y(p).
As noted in Section 1, efficient algorithms are available for finding a largest convex polygon or convex cap contained in a planar point set. We briefly review these results as they provide an algorithm for the case of maximum chains supported by a grid, since the points in a convex chain have distinct x- and y-coordinates.
Given a set P of N points in the plane, Edelsbrunner and Guibas [11, Thm. 5.1.2] use the dual line arrangement and dynamic programming to find the maximum size of a convex cap contained in â·Â in O(N2) time and O(N) space; the same bounds hold for
â·
,
â·
, and
â·
. A convex cap of maximum length can be also computed in O(N2logN) time and O(NlogN) space.
Their method sweeps the dual line arrangement, in which each vertex (intersection of two dual lines) corresponds to a line segment pq for p,qâP, pî =q. Specifically, for every pair of points p,qâP, let L(p,q) be the maximum length of a chain in â·Â whose last two vertices are p and q, respectively. Similarly, let R(p,q) be the maximum length of a chain in â·Â whose first two vertices are p and q, respectively. The sweepline algorithm in [11] computes the values L(p,q) (or all values R(p,q)) for all p,qâP, pî =q, in O(N2) time.
The following observation allows us to adapt the algorithm in [11] to find the maximum size of a convex cap in (alternatively, to report a longest such chain) within the same time and space bounds. Analogous observations hold for
â,
, and
.
Observation 11**.**
Let P be a finite set of points in the plane, and let p,qâP such that x(p)<x(q).
If slope(pq)>0, then L(p,q) is the maximum length of a chain in
whose last two vertices are p and q.
Consequently, the maximum length of a chain in is maxL(p,q),
where the maximum is taken over all pairs p,qâP where x(p)<x(q) and y(p)<y(q).
Since x- and y-coordinates do not repeat in a convex chain, we obtain the following result.
Theorem 12**.**
In a given nĂn grid, the maximum size of a supported convex chain can be computed in O(n4) time and O(n2) space; and a supported convex chain of maximum size can be computed in O(n4logn) time and O(n2logn) space.
3.1 Convex caps
In order to compute the maximum size of a convex cap in â·, we must be careful to use each y-coordinate at most once.
We solve the more general problem of computing the maximum total size of two chains Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture that use distinct y-coordinates. Note that in contrast to the chains constituting a convex cap, the chains A and B may cross, or can have overlapping x-projections.
We present below a dynamic program to solve this problem, essentially building up solutions from bottom to top. To define the appropriate subproblem, we need to be able to refer to the last segment on the upper side of a chain. Hence, we refer to the last two vertices of A as l1â and l2â, setting l2â:=l1â if A is to consist of the single vertex l1â. Similarly, we refer to the first two vertices of B as r1â and r2â, setting r2â:=r1â if B is to consist of the single vertex r1â. The subproblem C(l1â,l2â,r1â,r2â) then expresses the maximum total size of two chains Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture with the given end vertices for A and start vertices for B.
We claim that C(l1â,l2â,r1â,r2â) as defined below yields the desired quantity, or ââ if no such chains A and B exist.
[TABLE]
Informally, the first clause of the definition of C(l1â,l2â,r1â,r2â) gets rid of invalid arguments, for which no such chains Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture exist; see also Figure 8.
The second clause is the base case where A and B each have one vertex.
The third and fourth clause handle the case where the topmost chain consists of a single vertexâit can thus not interfere with the other (longer) chain anymore.
Here, L(p1â,p2â) (resp., R(p1â,p2â)) denotes the size of a largest convex chain P in (resp.,
â), ending (resp., starting) with vertices p1â and p2â, or P=(p1â) if p1â=p2â.
We can use the dynamic programming algorithm of [11] to compute L(p1â,p2â) and R(p1â,p2â).
The final two clauses deal with the case where the topmost chain consists of at least one edge, looking for the largest pair of chains that can be constructed by adding the topmost vertex to a âlowerâ pair of chains.
We prove the correctness of the formula in Lemma 15, using the following general observations.
Observation 13**.**
*If a supported convex polygon P is in a set ,
â,
,
, â·,
â·
,
â·
, orÂ
â·
, then every subsequence of P is in the same set.
That is, these classes are hereditary.*
Lemma 14**.**
*Let A=(a1â,âŠ,akâ) and B=(b1â,âŠ,bkâČâ) with k,kâČâ„2, akâ1â=b1â and akâ=b2â.
If A and B are both in the same set of
â, ,
, or
, then their concatenation D=(a1â,âŠ,akâ,b3â,âŠ,bkâČâ) is in the same set.*
Proof.
Consider the case that A and B are in ; the other cases are analogous. This means that both x-coordinates and their y-coordinates strictly increase in A and B. As akâ=b2â, we know that x(akâ)<x(biâ) and y(akâ)<y(biâ) for all i>2. Therefore, the concatenation D=(a1â,âŠ,akâ,b3â,âŠ,bkâČâ has strictly increasing x- and y-coordinates. Except for its endpoints, each vertex of D is an interior vertex of A or B. Since A and B are convex, this readily implies that all interior vertices of D are convex and hence D is convex. Thus, D is in as well.
â
Lemma 15**.**
Let k be the maximum total size of two chains Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture that use distinct y-coordinates, subject to the constraints that A ends in a given edge (l1â,l2â) (or A=(l1â) if l1â=l2â) and B starts in a given edge (r1â,r2â) (or B=(r1â) if r1â=r2â), or let k=ââ if no such chains exists.
Then C(l1â,l2â,r1â,r2â)=k.
Proof.
Suppose that Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture realize the maximum total size over all chains with distinct y-coordinates under the given constraints.
If the y-coordinates of {l1â,l2â} and {r1â,r2â} are not disjoint, then A and B do not use distinct y-coordinates, so C(l1â,l2â,r1â,r2â) correctly returns ââ.
So suppose that the y-coordinates differ.
If l1â=l2â and r1â=r2â, then A and B both have size 1, and we correctly return 2.
If l1âî =l2â and Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture, then by Observation 13 we must have (l1â,l2â)â \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture, so we correctly return ââ if (l1â,l2â)î â \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture.
Similarly, if r1âî =r2â and (r1â,r2â)î â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture , we correctly return ââ.
For the remaining cases, the point of {l1â,l2â,r1â,r2â} with maximum y-coordinate will be either l2â or r1â.
If y(l2â)<y(r1â) and r1â=r2â, then B has size 1 and A has only y-coordinates at most that of l2â.
Since y(l2â)<y(r1â), any chain of that ends in (l1â,l2â) will have y-coordinates distinct from B, so A has the maximum size over all chains of ending in (l1â,l2â), as given by L(l1â,l2â). Therefore we correctly return L(l1â,l2â)+1.
Symmetrically, if y(r1â)<y(l2â) and l1â=r2â, we correctly return R(r1â,r2â)+1.
Two (symmetric) cases remain: either y(l2â)<y(r1â) and r1âî =r2â, or y(r1â)<y(l2â) and l1âî =l2â.
We use induction on the maximum y-coordinate to prove that C(l1â,l2â,r1â,r2â)=k in these cases.
We show the case where y(l2â)<y(r1â) and r1âî =r2â, the argument for the other case is symmetric.
Removing the point r1â from chain B results in a chain BâČâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture of size one less than that of B.
The chain BâČ starts in r2â, and its y-coordinates are still disjoint from those of A.
Since B had at least one edge, BâČ consists either of a single vertex (namely r2â), or it starts with an edge (r2â,v) for which (r1â,r2â,v)â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture .
Since these are exactly the terms we take the maximum over in the last clause of the definition of C(l1â,l2â,r1â,r2â), we by induction return at least k.
It remains to show that, C(l1â,l2â,r1â,r2â)â€k.
For this, let A"â \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and B"â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture be two chains that realize the maximum total size over all pairs of chains with distinct y-coordinates, where A" ends in (l1â,l2â) and B" consists either of the single vertex r2â, or it starts with an edge (r2â,v) for which (r1â,r2â,v)â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture (if no such chains exist, we correctly return ââ+1=ââ).
It suffices to show that adding r1â in front of chain B" yields a chain ofÂ
â with y-coordinates distinct from those of A".
Indeed, since y(r1â) is greater than all other y-coordinates, the y-coordinates remain distinct.
Moreover, if B" consists of the single vertex r2â, adding r1â in front of it yields (r1â,r2â), which we have already verified to lie inÂ
â (we would have returned ââ otherwise).
If B"â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture instead starts in an edge (r2â,v) for which (r1â,r2â,v)â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture , then the chain with r1â in front also lie inÂ
â, by Lemma 14.
Hence, C(l1â,l2â,r1â,r2â) returns at most k, and hence exactly k.
â
Lemma 16**.**
The value of C for all inputs can be computed in O(n10) time and O(n8) space.
Proof.
Deciding the applicable clause for an input takes constant time.
Each clause takes at most O(n2) time to compute, assuming that the referenced terms C, L, and R are already computed.
For the third and fourth clauses, we can precompute all L(l1â,l2â) and R(r1â,r2â) within the desired time and space.
The last two clauses of the equation reference O(n2) inputs of C recursively, but with a smaller maximum y-coordinate, so this recurrence is well-defined.
There are O(n8) possible inputs to C, each of which takes constant additional space and O(n2) time to compute, which gives the desired bounds.
â
Any cap (of size at least 2) can be split into two chains Aâ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bâ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture with distinct y-coordinates by removing the topmost edge.
Since unless n=1, the largest cap has size at least 2, we can compute the size of the largest cap using C by taking the maximum over all inputs for whose concatenation (omitting l1â if l1â=l2â and r2â if r1â=r2â) lies in â·, as shown in Lemma 17.
Lemma 17**.**
Suppose that A=(l1â,âŠ,laâ)â \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and B=(r1â,âŠ,rbâ)â\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture use distinct y-coordinates, and let D be the concatenation of the last two vertices (or single vertex if A has size 1) of A and the first two vertices of B (or single vertex if B has size 1).
If D\in\text{\curvearrowright}, then the concatenation DâČ=(l1â,âŠ,laâ,r1â,âŠ,rbâ) of A and B lies in â·.
Proof.
Since D\in\text{\curvearrowright}, we have x(laâ)<x(r1â), so the x-coordinates of DâČ are strictly increasing, and the y-coordinates are distinct.
Except l1â and rbâ, every vertex of DâČ is a non-endpoint vertex of A, B or D. Since these are convex, the vertex is convex in DâČ as well; the entire concatenation is convex as a result. Thus, DâČ lies in â·.
â
Testing if an input of C results in a cap takes constant time, so Theorem 18 follows.
Theorem 18**.**
For a given nĂn grid, a supported convex cap of maximum size can be computed in O(n10) time and O(n8) space.
3.2 Convex n-chains and n-caps
If we are solely interested in deciding whether the grid XĂY, where âŁXâŁ=âŁYâŁ=n, supports a convex chain or cap with precisely n vertices, we can improve upon the previous algorithms considerably. Let X={x1â,âŠ,xnâ} and Y={y1â,âŠ,ynâ} with xiâ<xi+1â and yiâ<yi+1â.
To test whether there is a chain of size n in , it suffices to test whether the chain ((x1â,y1â),âŠ,(xnâ,ynâ)) is in , in O(n) time.
To test whether there is a supported convex cap of size n in â·, we adapt the algorithm of Theorem 18.
Suppose P is a cap of ⷠof size n, with APâ and BPâ its maximal components in and in
â respectively.
Then P uses all coordinates of X, which restricts the types of chains APâ and BPâ considerably.
In particular C(l1â,l2â,r1â,r2â) can be modified to consider only edges l and r that use consecutive x-coordinates.
For 1<k<n consider the subchains Akââ \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture and Bkââ\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture of APâ and BPâ consisting only of vertices with y-coordinate at most ykâ.
These chains have length k in total and use all of the coordinates {y1â,âŠ,ykâ}.
Let (l1â,l2â) be the last edge of Akâ and let (r1â,r2â) be the first edge of Bkâ.
Then the coordinates ykâ1â and ykâ are used by l, or by r, or by l2â and r1â.
Moreover, since the total length of Akâ and Bkâ is k, there are nâk unused X-coordinates between l2â and r1â, so if l2â.x=xiâ, then r1â.x=xi+nâk+1â.
So for a fixed value of k, we need only consider O(âŁYâŁ2âŁXâŁ) inputs for C(l1â,l2â,r1â,r2â).
Moreover, the recursive calls in the last two cases need only consider O(âŁYâŁ) values of v.
This implies that there are O(âŁYâŁ3âŁXâŁ) possible inputs to C(l1â,l2â,r1â,r2â) over all k.
As an entry now depends on O(âŁYâŁ) subproblems and each is evaluated in constant time, the corresponding values can be computed in O(âŁYâŁ4âŁXâŁ)=O(n5) time and O(n4) space.
Similarly, we can test whether there is a cap of size n in ⷠwithin the same time and space.
3.3 Approximations
Although computing the maximum size of a supported convex polygon remains elusive,
we can easily devise a constant-factor approximation algorithm by eliminating duplicate coordinates as follows.
Compute a maximum size convex polygon P (possibly with duplicate coordinates) in a given nĂn grid in O(n6) time and O(n2) space [11, Thm. 5.1.3]. Define a conflict graph on the vertices of P, where two vertices are in conflict if they share an x- or y-coordinate. Since each conflict corresponds to a horizontal or vertical line, the conflict graph has maximum degree at most 2 and contains no odd cycles, hence it is bipartite. One of the two sets in the bipartition contains at least half of the vertices of P without duplicate coordinates, and so it determines a supported convex polygon. Since P has O(n) vertices, the conflict graph can be computed in O(n) time. Overall, we obtain a 21â-approximation for the maximum supported convex polygon in O(n6) time and O(n2) space.
The same strategy provides an 21â-approximation for the maximum supported polygon in â·,
â·
,
â·
, and
â·
in O(n4) time and O(n2) space using [11, Thm. 5.1.2].
4 The maximum number of convex polygons
Let F(n) be the maximum number of convex polygons that can be present in an nĂn grid, with no restriction on the number of times each coordinate is used. Let G(n) be this number where all 2n grid lines are used (i.e., each grid line contains at least one vertex of the polygon). Let FË(n) and GË(n) be the corresponding numbers where each grid line is used at most once (so FË(n) counts the maximum number of supported convex polygons). By definition, we have F(n)â„G(n)â„GË(n) and F(n)â„FË(n)â„GË(n) for all nâ„2. We prove the following theorem, in which the Îâ(.) notation hides polynomial factors in n.
Theorem 19**.**
The following bounds hold:
[TABLE]
4.1 Upper bounds
We first prove that F(n)=O(nâ 16n) by encoding each convex polygon in a unique way, so that the total number of convex polygons is bounded by the total number of encodings. Recall that a convex polygon P can be decomposed into four convex chains  \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ,\rotatebox[origin=c]90.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ,\rotatebox[origin=c]180.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ,\rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture Pâ, with only extreme vertices of P appearing in multiple chains. Let \rotatebox[origin={c}]{90.0}{\text{\curvearrowright}}_{P}=\text{ \leavevmode\hbox to6pt{\vbox to6pt{\pgfpicture\makeatletter\hbox{\hskip 5.7972pt\lower-4.50554pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}}{{}}{}{{}{}}{{}}{}{{{}{}{}{}}}{}
{}
{}{}{}{}{}{}{{}}\pgfsys@moveto{0.0pt}{-4.30554pt}\pgfsys@moveto{-5.5972pt}{-4.30554pt}\pgfsys@curveto{-5.5972pt}{-1.21426pt}{-3.09128pt}{1.29166pt}{-0.45999pt}{1.29166pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-0.45999pt}{1.29166pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}_{P}\cup\rotatebox[origin={c}]{90.0}{\text{ \leavevmode\hbox to6pt{\vbox to6pt{\pgfpicture\makeatletter\hbox{\hskip 5.7972pt\lower-4.50554pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}}{{}}{}{{}{}}{{}}{}{{{}{}{}{}}}{}
{}
{}{}{}{}{}{}{{}}\pgfsys@moveto{0.0pt}{-4.30554pt}\pgfsys@moveto{-5.5972pt}{-4.30554pt}\pgfsys@curveto{-5.5972pt}{-1.21426pt}{-3.09128pt}{1.29166pt}{-0.45999pt}{1.29166pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-0.45999pt}{1.29166pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}_{P} and \rotatebox[origin={c}]{180.0}{\text{\curvearrowright}}_{P}=\rotatebox[origin={c}]{90.0}{\text{ \leavevmode\hbox to6pt{\vbox to6pt{\pgfpicture\makeatletter\hbox{\hskip 5.7972pt\lower-4.50554pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}}{{}}{}{{}{}}{{}}{}{{{}{}{}{}}}{}
{}
{}{}{}{}{}{}{{}}\pgfsys@moveto{0.0pt}{-4.30554pt}\pgfsys@moveto{-5.5972pt}{-4.30554pt}\pgfsys@curveto{-5.5972pt}{-1.21426pt}{-3.09128pt}{1.29166pt}{-0.45999pt}{1.29166pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-0.45999pt}{1.29166pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}_{P}\cup\rotatebox[origin={c}]{180.0}{\text{ \leavevmode\hbox to6pt{\vbox to6pt{\pgfpicture\makeatletter\hbox{\hskip 5.7972pt\lower-4.50554pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}}{{}}{}{{}{}}{{}}{}{{{}{}{}{}}}{}
{}
{}{}{}{}{}{}{{}}\pgfsys@moveto{0.0pt}{-4.30554pt}\pgfsys@moveto{-5.5972pt}{-4.30554pt}\pgfsys@curveto{-5.5972pt}{-1.21426pt}{-3.09128pt}{1.29166pt}{-0.45999pt}{1.29166pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-0.45999pt}{1.29166pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}_{P}. To encode P, we assign the following number to each of the 2n grid lines â (see Figure 9 for an example): 0 if â is not incident on any vertex of P, 3 if â is incident on multiple vertices of P, 1 if â is incident on one vertex of P and that vertex lies on \rotatebox[origin={c}]{90.0}{\text{\curvearrowright}}_{P} if â is horizontal, or on \rotatebox[origin={c}]{180.0}{\text{\curvearrowright}}_{P} if â is vertical, and 2 otherwise.
In addition, we record the index of the horizontal line containing the leftmost vertex of P (pick the topmost of these if there are multiple leftmost points).
Since each of the 2n grid lines is assigned one of 4 possible values, and there are n horizontal lines, the total number of encodings is O(nâ 42n)=O(nâ 16n). All that is left to show is that each encoding corresponds to at most one convex polygon.
First, observe that if P is a convex chain, say in , then the set of grid lines containing a vertex of P uniquely defines P: since both coordinates change monotonically, the i-th vertex of P must be the intersection of the i-th horizontal and vertical lines. So all we need to do to reconstruct P is to identify the set of lines that make up each convex chain.
Since we know the location of the (topmost) leftmost vertex of P, we know where  \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ starts. Every horizontal line above this point labelled with a 1 or 3 must contain a vertex of  \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ; let k be the number of such lines. Since the x-coordinates are monotonic as well,  \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ ends at the k-th vertical line labelled with a 2 or 3. The next chain, \rotatebox[origin=c]270.0 \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicture Pâ, starts either at the end of  \leavevmodeto6pt\vboxto6pt\pgfpicture\makeatletter\lower-4.50554ptto0.0pt\pgfsys@beginscope\pgfsys@invoke \definecolorpgfstrokecolorrgb0,0,0\pgfsys@color@rgb@stroke000\pgfsys@invoke \pgfsys@color@rgb@fill000\pgfsys@invoke \pgfsys@setlinewidth0.4pt\pgfsys@invoke \nullfontto0.0pt\pgfsys@beginscope\pgfsys@invoke   \pgfsys@moveto0.0pt-4.30554pt\pgfsys@moveto-5.5972pt-4.30554pt\pgfsys@curveto-5.5972pt-1.21426pt-3.09128pt1.29166pt-0.45999pt1.29166pt\pgfsys@stroke\pgfsys@invoke \pgfsys@beginscope\pgfsys@invoke \pgfsys@transformcm1.00.00.01.0-0.45999pt1.29166pt\pgfsys@invoke \pgfsys@invoke \lxSVG@closescope\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope \pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\pgfsys@discardpath\pgfsys@invoke\lxSVG@closescope\pgfsys@endscope\hss\lxSVG@closescope\endpgfpicturePâ, if the horizontal line is labelled with a 1, or at the intersection of this horizontal line with the next vertical line labelled with a 2 or 3, if this horizontal line is labelled with a 3. We can find the rest of the chains in a similar way. Thus, F(n)=O(nâ 16n).
The upper bounds for FË(n), G(n), and GË(n) are analogous, except that certain labels are excluded. For the number of supported convex polygons FË(n), each grid line is used at most once, which means that the label 3 cannot be used. Thus, FË(n)=O(nâ 32n)=O(nâ 9n). Similarly, for G(n), all grid lines contain at least one vertex of the polygon, so the label [math] cannot be used. Therefore G(n)=O(nâ 32n)=O(nâ 9n). Finally, for GË(n), every grid line contains exactly one vertex of the polygon, so neither [math] nor 3 can be used as labels. This gives GË(n)=O(nâ 22n)=O(nâ 4n) possibilities.
4.2 Lower bounds
Assume that n=2m+4, where mâN satisfies suitable divisibility conditions, as needed.
All four lower bounds use the same grid, constructed as follows (see Figure 10).
[TABLE]
Note that this results in an (nâ1)Ă(nâ1) grid, since ym+2â=zm+2â. To obtain an nĂn grid, we duplicate the median grid lines in both directions and offset them by a sufficiently small distance Δ>0. The resulting grid has the property
that any three points p, q, r in the lower half XĂYâ with x(p)<x(q)<x(r) and y(p)<y(q)<y(r) make a left turn at q. To see this, suppose that y(p)=ni, y(q)=nj, and y(r)=nk, for some 1â€i<j<kâ€n. Then the slope of pq is strictly smaller than the slope of qr, since
[TABLE]
Thus, any sequence of points with increasing x- and y-coordinates in the lower half is inÂ
. By symmetry, such a sequence in the upper half XĂY+ is in . Analogously, points with increasing x-coordinates and decreasing y-coordinates are inÂ
if they are in the lower half and
â if they are in the upper half.
We first derive lower bounds on GË(n) and G(n) by constructing a large set of convex polygons that use each grid line at least once. Then we use these bounds to derive the bounds on FË(n) and F(n). The polygons we construct all share the same four extreme vertices, which lie on the intersections of the grid boundary with the duplicated median grid lines. Specifically, the leftmost and rightmost vertices are the intersections of the duplicate horizontal medians with the left and right boundary, and the highest and lowest vertices are the intersections of the duplicate vertical medians with the top and bottom boundary. Since each of these median lines now contain a vertex, we can choose additional vertices from the remaining 2m grid lines in each direction.
To construct each polygon, select m/2 vertical grid lines left of the median to participate in the bottom chain, and do the same right of the median. Likewise, select m/2 horizontal grid lines above and below the median, respectively, to participate in the left chain. The remaining grid lines participate in the other chain (top or right). This results in a polygon with m/2 vertices in each quadrant of the grid (excluding the extreme vertices). The convexity follows from our earlier observations. The total number of such polygons is
[TABLE]
The first step uses the following estimate, which can be derived from Stirlingâs formula for the factorial [10]. Let 0<α<1, then
[TABLE]
For the lower bound on G(n), the only difference is that we now allow grid lines to contain vertices in two chains. We obtain a maximum when we divide the grid lines evenly between the three groups (bottom chain, top chain, both chains). Thus, we select m/3 vertical grid lines left of the median to participate in the bottom chain, another m/3 to participate in the top chain and the remaining m/3 participate in both. We repeat this selection to the right of the median and on both sides of the median horizontal line. As before, this results in a convex polygon with the same number of vertices in each quadrant of the gridâexactly 2m/3 this time. The number of such polygons is
[TABLE]
To translate these bounds to bounds on FË(n) and F(n), where some grid lines may contain no vertices of the polygon, we observe that the arguments for the bounds above also work for a subgrid of XĂY, provided that the subgrid includes the boundary and medians and has the same number of grid lines on each side of the median in both directions. For FË(n), we select 2m/3 grid lines on each side of each median (balancing the number of vertices with the two different chains) to make up our subgrid and plug in the bound on GË(n), which yields
[TABLE]
Finally, for the bound on F(n), we select 3m/4 grid lines on each side of each median (balancing the number of vertices with the three different options for a grid line in the proof of G(n)), to make up our subgrid and plug in the bound on G(n), giving
To show that W(n)=Oâ(16n), we modify the previous encoding used to show
that F(n)=Oâ(16n). While the four grid lines along the boundary of the bounding box of P
can be incident to arbitrarily many vertices, we still use at most two vertices
for each such line, namely at most two extreme vertices.
For each weakly convex polygon P, record the at most 8 extreme vertices
incident to âB together with a vector (sequence) of length 2n:
n elements corresponding to the horizontal lines (from the lowest to the highest),
and n elements corresponding to the vertical lines (from left to right).
As previously, we encode each grid line by an element of {0,1,2,3},
where 3 stands for a line incident to at least two vertices.
By (weak) convexity, a grid line can be incident to 3 or more vertices of P
only if it is one of the four lines along the bounding box of P.
From the recorded information, we can reconstruct a weakly convex polygon in the nĂn grid.
Consequently, the number of convex polygons in the grid is bounded from above
by the number of encodings, namely W(n)=O(n8â 42n)=O(n8â 16n)=Oâ(16n).
We summarize the bounds we have obtained in the following.
The maximum number of convex polygons in an nĂn Cartesian product is F(n)=Îâ(16n). This bound is tight up to polynomial factors, and is significantly larger than the corresponding bound in an nĂn section of the integer lattice [3]. In contrast, n2 points in convex (hence general) position trivially determine 2n2â1 convex polygons. ErdĆs [16] proved that the minimum number of convex polygons determined by n points in general position is exp(Î(log2n)). Determining (or estimating) the minimum number of convex polygons in an nĂn Cartesian product and in higher dimensions remain as open problems.
Our motivating problem was the reconstruction of a convex polygon from the x- and y-projections of its vertices. We presented a 21â-approximation for computing the maximal size of a convex polygon supported by a grid XĂY. Finding an efficient algorithm for the original problem, or proving its hardness, remains open. As our dynamic program does not directly extend to dâ„3, approximation algorithms in higher dimensions are also of interest.
Acknowledgments.
We are grateful to the anonymous referees for their careful reading of the paper that helped clarify several subtle details in the inductive proof in Section 2.
Bibliography34
The reference list from the paper itself. Each links out to its DOI / PubMed record.
1[1] George E. Andrews. A lower bound for the volume of strictly convex bodies with many boundary lattice points. Transactions of the American Mathematical Society , 106:270â279, 1963. doi:10.1090/S 0002-9947-1963-0143105-7 . · doi â
2[2] Imre BĂĄrĂĄny. Random points and lattice points in convex bodies. Bulletin of the American Mathematical Society , 45:339â365, 2008. doi:10.1090/S 0273-0979-08-01210-X . · doi â
3[3] Imre BĂĄrĂĄny and JĂĄnos Pach. On the number of convex lattice polygons. Combinatorics, Probability and Computing , 1(4):295â302, 1992. doi:10.1017/S 0963548300000341 . · doi â
4[4] Imre BĂĄrĂĄny and Anatoly Moiseevich Vershik. On the number of convex lattice polytopes. Geometric and Functional Analysis , 2(4):381â393, 1992. doi:10.1007/BF 01896660 . · doi â
5[5] Alexander Barvinok. Lattice points and lattice polytopes. In Jacob E. Goodman, Joseph OâRourke, and Csaba D. TĂłth, editors, Handbook of Discrete and Computational Geometry , chapter 7, pages 185â210. CRC Press, Boca Raton, FL, 3rd edition, 2017. doi:10.1201/9781315119601 . · doi â
6[6] Boris Bukh and JiĆĂ MatouĆĄek. ErdĆsâSzekeres-type statements: Ramsey function and decidability in dimension 1. Duke. Math. J. , 163(12):2243â2270, 2014. doi:10.1215/00127094-2785915 . · doi â
7[7] Jean Cardinal, Csaba D. TĂłth, and David R. Wood. A note on independent hyperplanes and general position subsets in d đ d -space. Journal of Geometry , 108(1):33â43, 2017. doi:10.1007/s 00022-016-0323-5 . · doi â
8[8] VĂĄclav ChvĂĄtal and Gheza Thomas Klincsek. Finding largest convex subsets. Congressus Numerantium , 29:453â460, 1980.