Extremal convex polygons inscribed in a given convex polygon

A convex polygon $Q$ is inscribed in a convex polygon $P$ if every side of $P$ contains at least one vertex of $Q$. We present algorithms for finding a minimum area and a minimum perimeter convex polygon inscribed in any given convex $n$-gon in $O(n)$ and $O(n^3)$ time, respectively. We also investigate other variants of this problem.


Introduction
Motivated by a problem in statistics, in a recent paper [5] Ausserhofer, Dann, Tóth and the second named author examined the algorithmic aspects of finding convex polygons of maximal area, circumscribed about a given convex polygon. The aim of our paper is to continue this investigation.
Our primary goal is to find, among the convex polygons inscribed in a given convex n-gon, one with minimum area or perimeter. For these problems we give algorithmic solutions requiring O(n) and O(n 3 ) steps, respectively. We will see that the first problem is relatively easy to solve, but the second one is not. This problem can be regarded as a variant of the problem of finding the shortest closed billiard trajectories in a given convex polygon. We note that this problem, proposed also for convex bodies in general, is an extensively studied area of research closely related, among other things, to dynamical systems and symplectic geometries. For more information on this subject, the reader is referred to the papers [2,4,7,12], the book [17], or the video recording of the highly interesting talk [3] of Artstein-Avidan.
Besides the algorithms, following [5], to any minimum area or perimeter convex polygon inscribed in a convex n-gon, we assign a sequence from {U, N } n describing its combinatorial properties, and completely characterize the sequences that are assigned to some such polygon (for more details, see the first paragraphs of Subsections 2.2 and 3.2). We also collect observations about the properties of inscribed or circumscribed convex polygons minimizing or maximizing, respectively, some other geometric quantity.
Finally, we remark that the algorithmic aspects of similar problems have been studied in many papers. To give specific examples, we mention the problem of finding maximum area or perimeter convex k-gons in a convex n-gon [1] or in a point set [8], or that of finding minimum area k-gons in a point set under several geometric constraints [11], or the problem of finding maximum area triangles enclosed, or minimum area triangles enclosing a given convex n-gon [9,14,15].
We start with the main definition of our paper, which can be regarded as the 'dual' of Definition 1 of [5]. Here and throughout the paper by area(K) and perim(K) we denote the area and the perimeter of the convex region K, respectively.
Definition 1. Let C be a convex polygon. If Q is a convex polygon such that every side of C contains at least one vertex of Q, we say that Q is inscribed in C. Furthermore, we set Note that there is an inscribed polygon of arbitrarily small area in C if and only if C is a convex n-gon with n ≤ 4. Thus, to avoid degenerate configurations, throughout this paper C always denotes a convex n-gon with n ≥ 5, and vertices p 1 , p 2 , . . . , p n in counterclockwise order. We extend the indices to all integers so that they are understood modulo n; i.e. p i = p j if and only if i ≡ j mod n. To any convex polygon Q inscribed in C, one can assign a cyclic sequence s C (Q) ∈ {U, N } n , where the kth element s C k (Q) of s C (Q) is U (used) if and only if p k is a vertex of Q. Here, by a cyclic sequence we mean a sequence in which the indices of the elements are understood mod n, and for brevity, if it is clear which convex polygon C denotes, we write s(Q) = s C (Q) and s C k (Q) = s k (Q). We call the cyclic sequence defined in this way the cyclic sequence associated to Q.
The structure of the paper is as follows. In Section 2 we find the minimum area polygons inscribed in C. In Section 3 we consider minimum perimeter polygons inscribed in C. Finally, in Section 4 we collect our results about circumscribed polygons which maximize some geometric quantity. In our investigation, for any points x, y ∈ R 2 , we denote by xy the closed segment with endpoints x, y, and the length of xy by |xy|. We regard points as position vectors, and thus, by y − x we mean the vector pointing from x to y. We denote the convex hull of a set X by conv(X), and for brevity, we call the relative interior points of a segment interior points.

2.
Minimum area convex polygons inscribed in C 2.1. An algorithmic solution. First, we describe the geometric background for our algorithm. Theorem 1. Let Q be a minimum area convex polygon inscribed in C, with vertices q 1 , q 2 , . . . , q k in counterclockwise order. Then the following holds.
(i) Q has no two consecutive vertices that are interior points of some sides of C. (ii) If q j is a vertex of Q contained in the interior of p i p i+1 , then the vertices of Q adjacent to q j are p i−1 and p i+2 , and p i−1 p i+2 is parallel to p i p i+1 .
(iii) There is a minimum area convex polygon Q 0 inscribed in C, with vertices q 1 , q 2 , . . . , q k in counterclockwise order, such that q j is a vertex of C if and only if q j = q j , and if q j is an interior point of p i p i+1 , then q j ∈ {p i , p i+1 }.
Proof. First, we prove (i). For contradiction, assume that q j and q j+1 are two consecutive vertices of Q, and q j and q j+1 are interior points of p i p i+1 and p i+1 p i+2 , respectively. Let q j−1 denote the vertex of Q adjacent to q j and different from q j+1 , and similarly, let q j+2 denote the vertex of Q adjacent to q j+1 and different from q j . If p i p i+1 is not parallel to q j−1 q j+1 , then one can slide q j on p i p i+1 in a suitable direction to decrease the area of Q. Thus, it follows from the minimality of the area of Q that p i p i+1 and q j−1 q j+1 are parallel. The property that p i+1 p i+2 and q j q j+2 are parallel is obtained by a similar argument. Now, let Q be a convex polygon obtained from Q by replacing q j by any point q j of p i p i+1 . Then, by our previous observation, Q is a minimum area convex polygon inscribed in C. On the other hand, q j q j+2 and p i p i+1 are not parallel, which implies that we may slide q j+1 on p i p i+2 in a suitable direction to obtain a convex polygon inscribed in C with area smaller than area(Q), which contradicts our assumption. Thus, in the following we assume that Q has no two consecutive vertices that are interior points of some sides of C.
Now we prove (ii). Let q j−1 and q j+1 denote the vertices of Q adjacent to q j such that q j−1 ∈ p i−1 p i and q j+1 ∈ p i+1 p i+2 . By (i), q j−1 is not an interior point of p i−1 p i , and hence, we have q j−1 ∈ {p i−1 , p i }. On the other hand, if q j−1 = p i , then the convex hull Q of all vertices of Q but q j is a convex polygon inscribed in C with area(Q ) < area(Q). Thus, we have q j−1 = p i−1 . The equality q j+1 = p i+2 follows by a similar argument. The fact that p i−1 p i+2 is parallel to p i p i+1 is obtained by repeating the argument in the previous paragraph. Finally, (iii) is a straightforward consequence of (i) and (ii).
Using the idea of the proof of Theorem 1, it is easy to see that if p i−1 , p i , p i+1 and p i+2 are vertices of P where p i p i+1 is parallel to p i−1 p i+2 , and there is a minimum area polygon Q whose vertex set contains p i−1 , p i and p i+2 , then replacing p i with any point of p i p i+1 we obtain a minimum area polygon, and the same holds after repeating such a modification arbitrarily many times. Our next remark, which can be regarded as a converse of (iii) of Theorem 1 and can be proved in a similar way, states that using this procedure and starting with the minimum area polygons whose each vertex is a vertex of P , one can generate all minimum area polygons inscribed in C. Remark 1. Let Q be a minimum area convex polygon inscribed in C, with vertices q 1 , q 2 , . . . , q k in counterclockwise order, such that every vertex of Q is a vertex of C. Let 1 ≤ s 1 < s 2 < . . . < s m ≤ k such that for every value of t, |s t+1 − s t | ≥ 2, and for any value of t there is some index i t such that q st−1 = p it−1 , q st+1 = p it+2 and q st ∈ {p it , p it+1 }. Assume that for t = 1, 2, . . . , m, p it p it+1 is parallel to p it−1 p it+2 , and let q st be an arbitrary point p it p it+1 . For any s / ∈ {s 1 , . . . , s m }, set q s = q s . Then the convex hull Q of the points q 1 , q 2 , . . . , q k is a minimum area convex polygon inscribed in C.
By Theorem 1 and Remark 1, for any convex polygon C there is a minimum area polygon Q inscribed in C with the additional property that every vertex of Q is a vertex of C, and by determining all minimum area polygons with this additional property one can determine all minimum area polygons not satisfying this property. Indeed, Remark 1 yields a sufficient condition for the vertices of these polygons, while it follows from Theorem 1 that this condition is also necessary. Thus, in the following we consider only convex hulls of subsets of the vertex set of C.
Let Q be such a minimum area convex polygon. Then every side of Q is either a side or a diagonal of C. These diagonals of C must lie between vertices separated by a single vertex, as each side of Q must contain at least one vertex of C. Let T i denote the area of the triangle with vertices p i−1 , p i , p i+1 . Then the problem of minimizing the area of Q is equivalent to the problem of choosing some elements of the set {T 1 , . . . , T n } whose sum is maximal under the restriction that no two elements with consecutive indices are chosen mod n. We denote this maximal value by A, and present an algorithm that finds the value of A and a subsequence with sum equal to A.
First, we compute the values of all T i s. Note that computing the areas of n triangles, using suitable determinants, can be done in O(n) steps. Let us divide the possible subsequences S into two types: If S contains T 1 we say that it is of Type 1, and otherwise it is of Type 2. For any 1 ≤ k ≤ n − 1, we denote by A 1 k the maximum of the sums of the elements of subsequences of T 1 , T 2 , . . . , T k containing no two elements with consecutive indices but containing T 1 , and for any 2 ≤ k ≤ n we denote by A 2 k the maximum of the sums of the elements of subsequences of T 2 , . . . , T k containing no two elements with consecutive indices. Then, clearly, A = max{A 1 n−1 , A 2 n }. We find the values A 1 k and A 2 k using a recursive algorithm.
Note that A 1 1 = A 1 2 = T 1 , and A 1 3 = T 1 + T 3 . In general, for any 4 ≤ k ≤ n − 1, Remark 2. Our algorithm can clearly be carried out in such a way that we keep track of all minimum area inscribed polygons whose vertices are the vertices of C. These polygons are not listed by the algorithm (as their number might be even more than linear), but are represented in the form of a decision tree.

Combinatorial properties.
As in the algorithm in Subsection 2.1, in this subsection we investigate minimum area convex polygons inscribed in C with the additional property that all their vertices are vertices of C. Our aim is to characterize the family of cyclic sequences that are associated to some such polygon Q for some suitably chosen C, and we note that if every vertex of an inscribed polygon Q is a vertex of C, then s(Q) determines Q.
Clearly, no sequence s(Q) contains two consecutive N s. Indeed, if s k (Q) = s k+1 (Q) = N , then Q is disjoint from p k p k+1 , which contradicts the condition that Q is inscribed in C. Similarly, s(Q) contains no three consecutive U s, since if s k−1 (Q) = s k (Q) = s k+1 (Q) = U , then the area of Q could be reduced further by not using p k . Our main result in this subsection is the converse of this observation.
Theorem 2. Let s ∈ {N, U } n with n ≥ 5. Then the following are equivalent.
(i) There is some convex n-gon C with a unique minimum area convex polygon Q such that s(Q) = s. (ii) The cyclic sequence s contains no two consecutive N s and no three consecutive U s.
Proof. We only need to prove that (ii) implies (i). Let k denote the number of N s in s, and observe that since n ≥ 5, (ii) implies that k ≥ 2.
First, we present a construction for the case k ≥ 3. Let Q 0 be a regular k-gon, let the vertices of Q 0 be q 1 , q 2 , . . . , q k in counterclockwise order, and let g i be the midpoint of q i q i+1 for i = 1, 2, . . . , k. Set G = conv{g 1 , g 2 , . . . , g k }. Choose some arbitrary small value ε > 0.
By the conditions in (ii), for any 1 ≤ i ≤ k, there is either one or two U s between the two N s in s corresponding to q i and q i+1 . If there is one U between them, we glue an isosceles triangle to Q 0 with q i q i+1 as its base such that the new vertex q i is closer to g i than ε. Similarly, if there are two U s between the two N s corresponding to q i and q i+1 , we glue a symmetric trapezoid to Q 0 , with q i q i+1 as its base such that the two new vertices q i , q i are closer to q i q i+1 than ε, and q i q i is parallel to q i q i+1 and its length is less than We carry out this operation for all values of i, and obtain an n-gon, which we denote by C (cf. Figure 1). Similarly, we denote the convex hull of the points q i and q i by Q. Note that if ε is sufficiently small, removing one point from each pair {q i , q i }, the convex hull Q * of the remaining vertices of Q contains G, and the same statement holds if we replace some of the vertices of Q * with the corresponding midpoints g i . We show that Q is the unique minimum area polygon inscribed in C if ε is sufficiently small. First, observe that in this case Q is convex and its area is close to area(G). In particular, for sufficiently small values of ε the inequality area(Q) < area(conv(G ∪ {q i })) is satisfied for all values of i. On the other hand, if Q is any convex polygon inscribed in C with vertices chosen from the vertices of C, then q i , q i or g i belongs to Q for all values of i. Indeed, if there is one U between the two N s corresponding to q i and q i+1 , then q i is a vertex of Q , or both q i and q i+1 are vertices of Q , implying that g i ∈ Q . In the opposite case the fact that Q is inscribed in C yields that it contains a point of the segment q i q i . Since every vertex of Q is a vertex of C, from this q i ∈ Q or q i ∈ Q follows. But by our previous observation this implies that G ⊆ Q . Thus, if q i is a vertex of Q for some value of i, then area(Q) < area(conv(G ∪ {q i })) ≤ area(Q ). On the other hand, if no q i is a vertex of Q , then the facts that every vertex of Q is a vertex of C and Q is inscribed in C implies that Q = Q. By Theorem 1 and Remark 1, since Q is a unique minimum area polygon inscribed in C with the additional assumption that every vertex of Q is a vertex of C, it follows that there is no minimum area polygon inscribed in C having a vertex in the interior of a side of C. Finally, we clearly have s(Q) = s, which yields the assertion for k ≥ 3. If k = 2, a similar construction proves the statement, where the regular polygon Q 0 is replaced by a straight line segment.

Minimum perimeter convex polygons inscribed in C
3.1. An algorithmic solution. Let F(C) denote the family of minimum perimeter convex polygons inscribed in C. We start with the description of some properties of the elements of F(C). We first prove Lemma 1, and note that the property described in it is well known in the theory of billiards, and it can be proved also via a simple differential geometric argument. Lemma 1. Let Q be a convex polygon with minimum perimeter inscribed in C. Let q j−1 , q j , q j+1 be three consecutive vertices of Q. If q j is an interior point of a side p i p i+1 of C, then Q satisfies the optic reflection law at q j , i.e. the angles ∠p i q j q j−1 and ∠q j+1 q j p i+1 are equal.
Proof. The locus of the points in the plane with the property that the sum of their distances from q j−1 and q j is a given constant is an ellipse with q j−1 and q j+1 as its foci. Let E be the ellipse with q j−1 and q j+1 as its foci, and containing q j on its boundary. Since q j minimizes the sum of the distances from q j−1 and q j+1 among the points of the line L through p i p i+1 , L is tangent to E at q j . Thus, the equality ∠p i q j q j−1 = ∠q j+1 q j p i+1 follows from the property of ellipses that the tangent line L at q j bisects the exterior angles of the triangle conv{q j−1 , q j , q j+1 } at q j [6].
Clearly, by Lemma 1, every vertex of a minimum perimeter inscribed polygon is either a vertex of C or satisfies the reflection law. To investigate these polygons, we recall from Section 1 the notion of a cyclic sequence s(Q) associated to an inscribed polygon Q: the kth element s k (Q) of s(Q) is U if and only if p k is a vertex of Q.
Note that if s(Q) contains exactly k U s, then Q has exactly (n − k) vertices. It is also worth noting that convex polygons inscribed in C whose every vertex satisfies the optic reflection law are called Fagnano orbits, and that a necessary condition for the existence of a Fagnano orbit in an even-sided polygon can be found in [10] as Lemma 2.
In the theory of billiards it is well known that any Fagnano orbit in a convex n-gon C with n even can be modified in a natural way to construct infinitely many Fagnano orbits; such a configuration is shown in Figure 2. It is easy to see that all these orbits correspond to minimum perimeter polygons inscribed in C. On the other hand, no such construction is known for n-gons with n odd, and it is an open problem to characterize the convex n-gons with n odd in which Fagnano orbits exist [10]. Our next theorem answers a related problem.  Proof. First, we prove (i).
Consider the case that s contains at least two U s, and let p i and p j be two vertices of Q corresponding to U s in s such that p i+1 , p i+2 , . . . , p j−1 correspond to N s. We label the vertices of Q in such a way that q i = p i , q i+1 ∈ p i+1 p i+2 , . . . , q j−2 ∈ p j−2 p j−1 and q j−1 = p j . Let q i denote the reflected copy of q i to the line through p i+1 p i+2 . By the optic reflection law, q i , q i+1 and q i+2 are collinear, and |q i q i+2 | = |q i q i+1 | + |q i+1 q i+2 |. Now, if q i denotes the reflected copy of q i to the line through p i+2 p i+3 , then by the optic reflection law, q i , q i+2 and q i+3 are collinear, and |q i q i+3 | = |q i q i+1 |+|q i+1 q i+2 |+|q i+2 q i+3 |. Continuing this process, if q * i denotes the point obtained by subsequently reflecting q i to the lines through p i+1 p i+2 , p i+2 p i+3 , . . . , p j−2 p j−1 , respectively, then |q * i q j−1 | = j−2 t=i |q t q t+1 |. Note that q i = p i and q j−1 = p j , and hence, q * i q j−1 is depends only on s(Q) and does not depend on Q. This yields, in particular, that the length of the boundary of Q from p i to p j is independent of Q. On the other hand, for any i ≤ t ≤ j − 3, if q * t denotes the point obtained by subsequently reflecting q t to the lines through p t+1 p t+2 , . . . , p j−2 p j−1 , then all q * t s lie on q * i q j−1 . Thus, q j−2 is the intersection point of p j−2 p j−1 and q * i q j−1 , q j−3 is the intersection point of p j−3 p j−2 and the reflected copy of q * i q j−2 to the line through p j−2 p j−1 , and the remaining q t s can be obtained in a similar way. We note that this process can be carried out in O(j − i) steps, including the check whether the obtained points q t indeed lie in the interiors of the corresponding sides of C. If s contains exactly one U , the same argument can be applied in which the points p i and p j coincide, and the part of the boundary of Q between p i and p j is equal to the whole boundary of Q.
Consider the case that s = N N . . . N , and let q 0 be the vertex of Q on p n p 1 . For l ∈ {n, 1}, let p * l denote the point obtained by reflecting p l subsequently about the lines through p 1 p 2 , p 2 p 3 , . . . , p n−1 p n , respectively. Let q(τ ) = τ p n + (1 − τ )p 1 , and q * (τ ) = τ p * n + (1 − τ )p * 1 for any τ ∈ (0, 1). By the argument in the previous paragraph, for any value of τ there is exactly one closed polygonal curve starting at q(τ ), having subsequent vertices q 1 (τ ), . . . , q n−1 (τ ) on the lines through p 1 p 2 , . . . , p n−1 p n , respectively, and returning to q(τ ) such that each vertex q i (τ ) satisfies the optic reflection law for all 1 ≤ i ≤ n − 1. This curve, which we denote by Γ(τ ), can be obtained by taking the straight line segment q(τ )q * (τ ), applying reflections and taking intersections. Thus, the length of the curve Γ(τ ) is equal to |q(τ )q * (τ )|.
A necessary condition for some Γ(τ 0 ) to be the boundary of an element of F(C), which we denote by Q(τ 0 ), is that (a) all its vertices are contained in the interiors of the sides of C; (b) it has minimal length among all curves Γ(τ ), τ ∈ (0, 1), satisfying (a).
Let Q(τ 0 ) ∈ F(C) for some τ 0 ∈ I. To complete the proof we show that there is some neighborhood W of τ 0 in (0, 1) such that if n is even then Q(τ ) ∈ F(C) for any τ ∈ W , and if n is odd, then Q(τ ) / ∈ F(C) for any τ ∈ W \ {τ 0 }. Consider some τ ∈ (0, 1) sufficiently close to τ 0 . Then, as I is open, we have τ ∈ I. Imagine a billiard ball at q(τ ) and push it parallel to q(τ 0 )q 1 (τ 0 ). The ball bounces back from the side p 2 p 3 at q 1 (τ ) by the optic reflection law, and runs parallel to q 1 (τ 0 )q 2 (τ 0 ). Here an elementary computation shows that, also by the optic reflection law, the signed distance of the parallel segments q(τ )q 1 (τ ) and q(τ 0 )q 1 (τ 0 ) is the opposite of the signed distance between q 1 (τ )q 2 (τ ) and q 1 (τ 0 )q 2 (τ 0 ) (cf. Figure 2 for an illustration of this phenomenon with a regular hexagon as C). Repeating this consideration for all sides of Q(τ 1 ), we obtain that the billiard trajectory ends at q(τ ) if and only if the ball bounces back an odd number of times; that is, if n is even.
Remark 3. The proof of (ii) of Theorem 3 yields a little more: if n is even and there are infinitely many polygons Q ∈ F(C) with s(Q) = N N . . . N , then these polygons are of the form Q(τ ) for some subinterval I ⊆ (0, 1). Indeed, the property follows from the observation that for any edge p i p i+1 the values of τ such that after reflections the corresponding point lies on p i p i+1 is an interval, and the intersection of intervals is an interval. In the other direction, if some Γ(τ 0 ) satisfies the properties in (a) and (b), then, applying the reflection argument as in the second part of the proof of Theorem 3 and using the elementary fact that the length of any polygonal path connecting two points is at least as large as the distance between the points, it follows that Γ(τ 0 ) is the boundary of some Q ∈ F(C) with s(Q) = N N . . . N . In particular, this implies that all elements Q ∈ F(C) with s(Q) = N N . . . N , and also their perimeter, can be found in O(n) steps. Indeed, carrying out the reflections to p n p 1 , we can compute the function τ → |q(τ )q * (τ )| and determine its unique local minimum in O(n) steps.
Remark 5. Let C be a regular n-gon, and let Q be the convex hull of the midpoints of the edges of C. From Theorem 3 and Remark 4 it follows that Q is a minimum area convex polygon inscribed in C. Indeed, with the notation of the proof of Theorem 3 Q coincides with the boundary of Γ(1/2). On the other hand, by the symmetry of C, we have that Γ(τ ) and Γ(1 − τ ) are congruent, implying that the function τ → |q(τ )q * (τ )| = |q * (τ ) − q(τ )| is symmetric to 1/2. This yields that either q * (τ ) − q(τ ) is independent of τ , or it moves on a line perpendicular to q * (1/2)−q(1/2). In both cases, we obtain that the length of Γ(1/2) is the minimum of |q(τ )q * (τ )| for all τ ∈ R. By Remark 4, this implies that Q ∈ F(C).
In the remaining part of Subsection 3.1, we present an algorithm to find an element of F(C) and its perimeter. Our algorithm is based on the one in [5], with the necessary modifications.
For any i, j with i < j ≤ i + n, let Γ ij be a shortest polygonal curve m−1 t=1 q t q t+1 such that (i) q 1 = p i , q m = p j , and all vertices of Γ ij are boundary points of C, (ii) all sides p i p i+1 , p i+1 p i+2 , . . . , p j−1 p j contain at least one vertex of Γ ij , and (iii) the points q 1 , q 2 , . . . , q m are in this councerclockwise order in the boundary of C.
Let Π ij denote the length of Γ ij . Clearly, if Q ∈ F(C), and s(Q) = N N . . . N , then perim(Q) = Π i,i+n for some value of i. We present a recursive algorithm which computes Π ij for all i < j ≤ i + n.
First, clearly, we have Q ij = p i p i+1 for j = i + 1, and for j = i + 2, Q ij = p i p i+2 . This implies that Π i,i+1 = |p i p i+1 | and Π i,i+2 = |p i p i+2 | for all values of i. Consider some 2 < k ≤ n, and assume that we have computed all values Π st with s < t < s + k. Choose some i, j with j = i + k. We distinguish between k types of the shortest polygonal curves Γ ij satisfying the properties in the list in the previous paragraph.
Type (u): The point p i+u is a vertex of Γ ij for some 1 ≤ u ≤ k − 1.
Here, if Γ ij has Type (0), then it has no Type (u) for any 1 ≤ u ≤ k − 1. On the other hand, in general Γ ij may have Type (u) for more than one distinct value of u. Our algorithm determines the value of Π ij depending on the type of Γ ij .
If Γ ij has Type (0), then the vertices q 2 , q 3 , . . . , q m−1 satisfy the optic reflection law by Lemma 1. Then, using the reflections described in the first part of Theorem 3, the existence of a polygonal curve satisfying these conditions, and in case of existence the vertices of this curve and its length can be found in O(k) steps. Assume that Γ ij has Type (u) for some 1 ≤ u ≤ k − 1. Then Γ ij is the union of some shortest polygonal curves Γ i,i+u and Γ i+u,j , and its length is Π i,i+u + Π i+u,j . To find the shortest polygonal curves having Type (u) for all possible values of u, and the length of these curves, we need O(k) steps.
Starting with k = 3, for every fixed value of k we execute the above procedure for all 1 ≤ i ≤ n. Then we increase the value of k by one and repeat all steps until k = n. Thus, we obtain the values of Π ij for all i, j with i < j ≤ i + n in O(n 3 ) steps. Indeed, we have seen that for any fixed values i and j = i + k, we can find the value of Π ij in O(k) times, and hence, the estimate O(n 3 ) follows by executing this procedure for all values of i and k, and using the inequality k ≤ n.
Let p 1 (C) = min{Π i,i+n : i = 1, 2, . . . , n}. We need to handle the case of the convex polygons Q ∈ F(C) with s(Q) = N N . . . N . Nevertheless, by Remark 4, all such polygons, if they exist, and their perimeter can be found in O(n) steps. In conclusion, p(C), and also an inscribed convex polygon with minimum perimeter, can be found in O(n 3 ) steps.
We note that by (ii) of Theorem 3, if n is even and there is some Q ∈ F(C) with s(Q) = N N . . . N then there is some Q ∈ F(C) with s(Q) = N N . . . N . This yields that if n is even then p(C) = p 1 (C); thus, if we want to calculate only the value of p(C) we can skip the last step of the algorithm for n even.
Remark 6. As in case of minimum area polygons (cf. Remark 2), our algorithm can be carried out in such a way that we keep track of all minimum perimeter inscribed polygons. These polygons are not listed by the algorithm, but represented in the form of a decision tree.

3.2.
Combinatorial properties. In Subsection 3.1 we have seen that, apart from the sequence containing only N s, for any cyclic sequence s ∈ {U, N } n there is at most one minimum perimeter polygon Q ∈ F(C) whose associated cyclic sequence is s. Our main goal in this subsection is to determine the cyclic sequences s ∈ {N, U } n with the property that for a suitable convex n-gon C there is some Q ∈ F(C) such that s(Q) = s.
Let s ∈ {U, N } n , and let us call it realizable if it is associated to some convex polygon Q ∈ F(C) with a suitable choice of C. Similarly like in Subsection 2.2, if s is realizable, then it contains no three consecutive U s. Indeed, if three consecutive vertices of C are used, then the perimeter of Q could be further reduced by removing the middle vertex from the vertex set of Q. Our main result is the following. Proof. Since no realizable sequence contains three consecutive U s, we need to prove that if s ∈ {U, N } n does not contain three consecutive U s, then s is realizable. Since the cyclic sequence s = N N . . . , N is clearly realized by a regular polygon, we assume that s = N N . . . N .
Let the number of N s in such a sequence s ∈ {U, N } n be k. First, we prove the assertion in the case that k ≥ 3. Let C 0 be a regular k-gon of unit edge length, with vertices p 1 , p 2 , . . . , p k , where the indices are understood mod k, and let Q 0 be the convex hull of the midpoints of the sides of C 0 . Let the vertices of Q 0 be m 1 , m 2 , . . . , m k such that m i ∈ p i p i+1 . By Remark 5, if k is odd, then Q 0 is the unique smallest perimeter convex polygon inscribed in C 0 . Furthermore, it follows from Remark 3 that if k is even, then for any τ ∈ [0, 1], there is a unique convex polygon Q(τ ), with vertices q 1 (τ ), q 2 (τ ), . . . , q n (τ ) in counterclockwise order, such that q 1 (τ ) = τ p 1 + (1 − τ )p 2 and q i (τ )q i+1 (τ ) is parallel to m i m i+1 for all values of i. Furthermore, the perimeters of these polygons are equal, F(C 0 ) = {Q(τ ) : τ ∈ [0, 1]}, where Q(1/2) = Q 0 , and in the degenerate cases τ = 0 and τ = 1, we have q 1 (0) = q 2 (0), and q 1 (1) = q n (1).
We note that since the perimeter of a polygon is a continuous function of its vertices, any convex polygon inscribed in C 0 whose perimeter is 'close to' p(C 0 ) is 'close to' an element of F(C 0 ). Moreover, in the family of convex k-gons for any fixed value of k, p(C) is a continuous function of C, implying that if C 1 and C 2 are convex k-gons and C 1 is 'close to' C 2 , then p(C 1 ) is 'close to' p(C 2 ).
Let ζ > 0 be some sufficiently small fixed value. We define an auxiliary, degenerate convex n-gon C in the following way. A side S i = p i p i+1 , i = 1, 2, . . . , k of C 0 has Type (t) for some t ∈ {0, 1, 2}, if the i th and the (i + 1) st N s in s are separated by t U s. If S i has Type (0), we regard S i as a side of C . If S i has Type (1), we regard m i as a vertex, and the segments S i = p i m i , S i = m i p i+1 as sides of C . Assume that S i has Type (2). Then we choose two points p i and p i on S i symmetric to m i such that p i , p i , p i , p i+1 are in this linear order on S i , and |p i p i | = ζ. We regard p i , p i as vertices and p i p i , p i p i , p i p i+1 as sides of C . We call a (possibly degenerate) convex polygon Q a polygon inscribed in C if every side of C contains at least one vertex of Q . By continuity it follows that if ζ is sufficiently small, then no minimum perimeter polygon inscribed in C contains a vertex of C 0 . On the other hand, applying the idea of the proof of Lemma 1, we obtain that any such polygon contains all the p i s and p i s on the Type (2) sides as well as the midpoints of the Type (1) sides of C 0 as vertices. Thus, there is a unique minimum perimeter polygon inscribed in C and the vertex set of this polygon consists of all p i s and p i s on the Type (2) sides, the midpoints of the Type (1) sides of C 0 , and one point in the interior of each Type (0) side of C 0 . Now let u i be the outer unit normal vector of S i for all values of i. Consider some δ > 0. If S i is of Type (1), setp i = m i + εu i , and if S i is of Type (2), set p i = p i + εu i andp i = p i + εu i . Let C denote the convex hull of the union of C 0 and all pointsp i andp i . Then, by continuity and Lemma 1, if δ > 0 is sufficiently small, then C is a convex polygon, and any minimum perimeter convex polygon Q inscribed in C has allp i s andp i s as vertices, and no vertex of C 0 is a vertex of C. Clearly, the sequence assigned to any such polygon is s, and thus, Theorem 3 yields that such a Q is unique. We are left with the case that the number k of N s in s is at most 2. By our conditions, from this we have that s = N U U N U or s = N U U N U U . In these cases, we use the fact that for an obtuse isosceles triangle C 0 with base p 1 p 2 and apex p 3 , the shortest closed polygonal curve containing a point from each side of C 0 is a degenerate 'double segment' containing p 3 and the midpoint of p 1 p 2 . By slightly modifying C 0 as in the previous consideration, we obtain a convex pentagon C 1 and a convex hexagon C 2 such that F(C i ) consists of a unique element Q i for i = 1, 2, and s(Q 1 ) = N U U N U and s(Q 2 ) = N U U N U U (see Figure 3).

Additional results about circumscribed polygons
Similarly like in [5], we may consider the problem of maximizing a geometric quantity among convex polygons circumscribed about a given convex polygon. For this purpose, let us recall Definition 1 from [5].
Definition 2. Let C ⊂ R 2 be a convex n-gon. If Q is a convex m-gon that contains C and each vertex of C is on the boundary of Q, then we say that Q is circumscribed about C.
As in [5], we intend to exclude the existence of unbounded convex polygonal regions Q, containing C, with the property that each vertex of C lies on a side of Q. Thus, we assume that the sum of any two consecutive angles of C is greater than π. In particular, from this it follows that n ≥ 5. In this section we collect our observations about convex polygons circumscribed about C with maximal perimeter or maximal diameter. We must add that our observations are not sufficient in either problem to provide a complete algorithm to find such a polygon. We also remark that the problem of finding maximum area circumscribed polygons was the main topic of the paper [5] motivating our research. Furthermore, the problem of finding a minimum diameter polygon inscribed in a given convex polygon seems different from the 'dual' problem discussed in Subsection 4.2.
Finally, we note that while a convex polygon Q circumscribed about a convex ngon may have arbitrarily many sides, since by removing the sides of Q not containing a vertex of P we increase the perimeter of Q and do not decrease its diameter, it follows that if Q has maximal perimeter among circumscribed polygons, it has at most n vertices, and the same property holds for at least one circumscribed polygon with maximal diameter. 4.1. Maximum perimeter convex polygons circumscribed about C. Set P (C) = sup{perim(Q) : Q is circumscribed about C}, and note that by our conditions, P (C) exists, and it is attained by a convex polygon Q. Our main result is as follows.
Theorem 5. Let Q be a maximum perimeter convex polygon circumscribed about C. Let the vertices of Q in counterclockwise order be q 1 , q 2 , . . . , q m , with the vertices understood mod m. For all values of i, let the measure of the angle of Q at q i be denoted by β i . Then every side q i q i+1 of Q contains at least one and at most two vertices of C, and if p j is the unique vertex of C on q i q i+1 , then Proof. Note that if q i q i+1 contains no vertex of C, then the remaining sidelines of Q are the sidelines of a convex polygon Q circumscribed about C and satisfying the inequality perim(Q) < perim(Q ). This shows that q i q i+1 contains at least one vertex of C, and a similar argument excludes the case that q i q i+1 contains a unique vertex of C coinciding with q i or q i+1 . The fact that any such side contains at most two vertices of C follows from the convexity of C. Thus, we may assume that q i q i+1 contains exactly one vertex p j of C, which is in the interior of q i q i+1 .
We show that in this case (3) holds. Let L i−1 , L i and L i+1 denote the lines through q i−1 q i , q i q i+1 and q i+1 q i+2 , respectively. Let d i−1 and d i+1 denote the distances of p j from L i−1 and L j+1 , respectively. Consider the case that L i−1 and L i+1 intersect, and their intersection point x i is separated from C by L i . Let the measure of the angle ∠q i x i q i+1 be denoted by γ i (cf. Figure 4). An elementary computation shows that |q i p j |+|p j q i+1 | = di−1 sin βi + di+1 sin βi+1 . Now, let us change Q by rotating L i around p j . Then the above expression can be regarded as a function f (β i ), with β i+1 = π + γ i − β i , and with the values of d i−1 , d i+1 and γ i fixed. By differentiating f , we obtain that it is a strictly concave function of β i , and its unique maximum is attained if 0 = di−1 cos βi sin 2 βi − di+1 cos βi+1 If L i−1 and L i+1 do not intersect, or their intersection point is not separated from C by L i , a similar argument can be applied.
In Remark 7 we use the notation in Theorem 5.
Remark 7. Consider some point q i such that the line L through q i p j supports C. Then it can be shown that L contains at most one point q i+1 satisfying the condition in (3), and the coordinates of this point can be computed from the coordinates of q i and the vertices of C in O(1) steps. Nevertheless, since the condition determining this point seems more complicated than in Sections 2 and 3, to characterize the convex polygons circumscribed about C and satisfying the conditions in Theorem 5 seems to be a more difficult problem than in the cases investigated in this paper.

4.2.
Maximum diameter convex polygons circumscribed about C. Compared to the case of perimeter, it seems much easier to find the maximum diameter of the convex polygons circumscribed about C. Indeed, let x i denote the intersection point of the lines through p i−1 p i and p i+1 p i+2 , and note that q i exists by our conditions for C. Then at least one circumscribed polygon of maximal diameter can be obtained as the convex hull of some points q i ∈ conv{p i , p i+1 , x i }, i = 1, 2, . . . , n. Thus, the diameter of any convex polygon circumscribed about C is less than or equal to the diameter of X = conv{x i : i = 1, 2, . . . , n}, which we denote by diam(X). Here the endpoints of any diameter of X are vertices of X. On the other hand, if X has a diameter xy whose endpoints x, y are not consecutive vertices of X, then there is a convex polygon Q circumscribed about C whose diameter is diam(X). Hence, to find the maximum diameter of the convex polygons circumscribed about C, in 'many' cases it is sufficient to find diam(X).
We note that diam(X) can be computed in O(n) steps. To do it, first we compute the points x i and then the vertices of X by Graham's convex hull algorithm [13]. If the points x i are already ordered according to angles in polar coordinates, as in our case, the running time of this algorithm is O(n). As the last step, the diameters of X can be computed from the vertices of X by the rotating calipers algorithm of Shamos [16]. Nevertheless, to give a complete algorithm to find the maximum diameter of the convex polygons circumscribed about C, the remaining case, when the diameters of X connect consecutive x i s, must also be handled.