The Flip Diameter of Rectangulations and Convex Subdivisions

We study the configuration space of rectangulations and convex subdivisions of $n$ points in the plane. It is shown that a sequence of $O(n\log n)$ elementary flip and rotate operations can transform any rectangulation to any other rectangulation on the same set of $n$ points. This bound is the best possible for some point sets, while $\Theta(n)$ operations are sufficient and necessary for others. Some of our bounds generalize to convex subdivisions of $n$ points in the plane.


Introduction
The study of rectangular subdivisions of rectangles is motivated by VLSI floorplan design [29] and cartographic visualization [14,26,33]. The rich combinatorial structure of rectangular floorplans has also attracted theoretical research [6,15]. Combinatorial properties lead to efficient algorithms for the recognition and reconstruction of the rectangular graphs induced by the corners of the rectangles in a floorplan [22,32], the contact graphs of the rectangles [25,40], and the contact graphs of the horizontal and vertical line segments that separate the rectangles [11]. The number of combinatorially different floorplans with n rectangles is known to be B(n) = Θ(8 n /n 4 ), the nth Baxter number [43].
Rectangular subdivisions in the presence of points have also been studied in the literature. Given a finite set P of points in the interior of an axis-aligned rectangle R, a rectangulation of (R, P ) is a subdivision of R into rectangles by pairwise noncrossing axis-parallel line segments such that every point in P lies in the relative interior of a segment (see Figure 1). Finding a rectangulation of minimum total edge length has attracted attention [7,8,13,19,20,21,28,30] due to its applications in VLSI design and stock cutting in the presence of material defects. This problem is known to be NP-hard [30], however, its complexity is unknown when the points in P are in general position in the sense that they have distinct xand y-coordinates, that is, the points are noncorectilinear. It is not hard to see that in this case the minimum edge-length rectangulation must consist of exactly n line segments [7]. For the rest of this paper, we consider only noncorectilinear point sets P , and rectangulations determined by |P | line segments, one containing each point in P .
The space of all the rectangulations of a point set P (within a rectangle R) can be explored using the following two elementary operators introduced in [2] (refer to Figure 2).  Definition 1 (Flip) Let r be a rectangulation of P and let p ∈ P be a point such that the segment s that contains p does not contain any endpoints of other segments. The operation FLIP(r, p) changes the orientation of s from vertical to horizontal or vice-versa.
Definition 2 (Rotate) Let r be a rectangulation of P . Let s 1 = ab be a segment that contains p ∈ P . Let s 2 = cd be a segment such that c lies in ap ⊂ s 1 and ac does not contain any endpoints of other segments. The operation ROTATE(r, c) shortens s 1 to cb, and extends s 2 beyond c until it reaches another segment or the boundary of R.
For a finite set of noncorectilinear points P ⊂ R, we denote by G(P ) = (V, E) the graph of rectangulations of P , where the vertex set is V = {r : r is a rectangulation of P } and the edge set is E = {(r 1 , r 2 ) : a single flip or rotate operation on r 1 produces r 2 }. Since both operations are reversible, G(P ) is an undirected graph. It is not hard to show that G(P ) is connected [2], and there is a sequence of O(n 2 ) flip and rotate operations between any two rectangulations in G(P ) when P is a set of n points in R. It is natural to ask for the diameter of G(P ), which we call the flip diameter of P for short. For every set of n points in R, the flip diameter is at least Ω(n), since every point set admits a rectangulation with all horizontal segments and one with all vertical segments, and each operation modifies at most two segments.

Results
In this paper, we show that the flip diameter of P is O(n log n) for every n-element noncorectilinear point set P (Section 2), and it is Ω(n log n) for some n-element noncorectilinear point sets (Section 3). However, there are n-elements noncorectilinear points sets for which the flip diameter is Θ(n) (Section 4). That is, the flip diameter is always between O(n log n) and Ω(n), depending on the point configuration, and both bounds are the best possible.
We extend the flip and rotate operations and the notion of flip diameter to convex subdivisions (Section 5). A convex subdivision of a set P ⊂ R 2 of points is a subdivision of the plane into convex faces by pairwise noncrossing line segments, halflines, and lines, each of which contains exactly one point of P . We show that the flip diameter for the convex subdivisions of n points is always O(n log n) and sometimes Θ(n).

Related work
Determining the exact number of rectangulations on n noncorectilinear points remains an elusive open problem in enumerative combinatorics [2,3]. Recently, Felsner [16] proved that every combinatorial floorplan with n + 1 rooms can be embedded into every set of n noncorectilinear points, hence every set of n noncorectilinear points has at least B(n) = Θ(8 n /n 4 ) rectangulations.
The currently best known upper bound, O(18 n /n 4 ) by Ackerman [1], uses the so-called "cross-graph" charging scheme [35,36], originally developed for counting the number of (geometric) triangulations on n points in the plane. This method is based on elementary "flip" operations that transform one triangulation into another. Lawson [27] proved that every triangulation on n points in the plane in general position (i.e., no three on a line) can be transformed into the Delaunay triangulation with O(n 2 ) flips, and this bound is the best possible by a construction due to Hurtado et al. [24]. However, for n points in convex position, 2n−10 flips are sufficient, due to a bijection with binary trees with n − 2 internal nodes [37]. Hence the flip diameter of every triangulation on n points in the plane is always between Θ(n) and Θ(n 2 ) depending on the point configuration. Eppstein et al. [14] and Buchin et al. [5] define two elementary flip operations on floorplans, in terms of the directed dual graph, and solve optimization problems on floorplans by traversing the flip graph.
Generalizing simultaneous edge flips in a triangulation, Meijer and Rappaport [31] considered simultaneous edge flips in convex decompositions of a point set P . A convex decomposition of P is a subdivision of the convex hull of P into convex polygons whose joint vertex set is P ; and two convex decompositions of P are related by a simultaneous edge flip if their union contains no crossing edges.

An Upper Bound on the Flip Diameter of Rectangulations
In this section, we show that for every set P of n noncorectilinear points in a rectangle R, the diameter of G(P ) is O(n log n).
Theorem 1 For every noncorectilinear set P of n points in the plane, the diameter of the graph G(P ) is O(n log n).
Given a rectangulation r of P , we construct a sequence of O(n log n) operations that transforms r into a rectangulation with all segments vertical (a canonical rectangulation). Our method relies on the concept of independent sets, defined in terms of the bar visibility graph. Let r be a rectangulation of P . The bar visibility graph [12,38,42] on the horizontal segments of r is defined as a graph H(r), where the vertices correspond to the horizontal segments in r; and two horizontal segments s 1 and s 2 are adjacent in H(r) if and only if there are points a ∈ s 1 and b ∈ s 2 such that ab is a vertical segment (not necessarily in r) that does not intersect any other horizontal segment in r. It is clear that the bar visibility graph is planar.
Observe that we can always change the orientation of any line segment s with O(n) operations: successively shorten s using rotate operations until s contains no other segment endpoints, and then flip s. This simple procedure is formulated in the following subroutine.
Shorten&Flip(r, s). Let s be a segment in a rectangulation r. Assume s = ab and p ∈ P is in the relative interior of s. While s contains the endpoint of some other segment, let c 1 ∈ s and c 2 ∈ s be the endpoints of some other segments closest to a and b, respectively (possibly c 1 = c 2 ). If p ∈ ac 1 , then apply ROTATE(r, c 1 ) to shorten s = ab to c 1 b. Else, apply ROTATE(r, c 2 ) to shorten s to ac 2 . When s does not contain the endpoint of any other segment, apply FLIP(r, p).
The proof of Theorem 1 follows from a repeated invocation of the following lemma.
Lemma 1 Let r be a rectangulation of a set of n pairwise noncorectilinear points in a rectangle R. There is a sequence of O(n) flip and rotate operations that turns at least one quarter of the horizontal segments into vertical segments, and keeps vertical segments vertical.
Proof: By the four color theorem [34], H(r) has an independent set I that contains at least one quarter of the horizontal segments in r. The total number of endpoints of vertical segments that lie on some horizontal segment in I is O(n). Successively call the subroutine Shorten&Flip(r, s) for all horizontal segment s ∈ I.
The horizontal segments in I are shortened and flipped into vertical orientation. All operations maintain the invariants that (1) the segments in I are pairwise disjoint, and (2) the remaining horizontal segments in I form an independent set in the bar visibility graph (of all horizontal segments in the current rectangulation). It follows that each operation either decreases the number of horizontal segments in I (flip), or decreases the number of segment endpoints that lie in the relative interior of a segment in I (rotate). After O(n) operations, all segments in I become vertical. Since only the segments in I are flipped (once each), all vertical segments in r remain vertical, as required. 2 Proof of Theorem 1.: Let P be a set of n pairwise noncorectilinear points in a rectangle R. Denote by r 0 the rectangulation that consists of n vertical line segments, one passing through each point in P . We show that every rectangulation r 1 of P can be transformed into r 0 by a sequence of O(n log n) flip and rotate operations. By Lemma 1, a sequence of O(n) operations can decrease the number of horizontal segments by a factor of at least 4/3. After at most log n/ log(4/3) invocations of Lemma 1, the number of horizontal segments drops below 1, that is, all segments become vertical and we obtain r 0 . 2 Remark. The proof of Theorem 1 is constructive, and provides an algorithm for transforming a rectangulation on n noncorectilinear points to the rectangulation with n vertical segments. If the rectangulations are maintained in a doubly connected edge list (DCEL) data structure, then a flip or rotate operation can be implemented in O(1) time, and the bar-visibility graph can be computed in O(n) time. The bottleneck of the overall running time is the 4-coloring of the bar-visibility graph. The current best algorithm for 4-coloring an m-vertex planar graph runs in O(m 2 ) time [34], and a repeated call to this algorithm to exponentially decaying bar-visibility graphs takes O(n 2 ) time. If we use an O(m)-time 5-coloring algorithm [10,18,41], up to log n/ log(5/4) times, the overall running time improves to O(n).

A Lower Bound on the Flip Diameter of Rectangulations
We show that the diameter of the graph G(P ) is Ω(n log n) when P is an n-element bit-reversal point set (alternatively, Halton-Hammersley point set) [9, Section 2.2]. For every integer k ≥ 0, we define a point set P k of size n = 2 k with integer coordinates lying in the square By construction, no two points in P k are corectilinear. The sets P2, P3, and P4. The edges connect pairs of points whose binary representations differ in a single bit, showing that P k is a projection of a k-dimensional hypercube. The grey rectangles are spanned by point pairs whose binary representations differ exactly in the last coordinate.
We establish a lower bound of k2 k−3 for the diameter of G(P k ) using a charging scheme. We define k2 k−1 empty rectangles (called boxes) spanned by P k , and charge one unit for "saturating" a box with vertical segments (as defined below). We show that when a rectangulation with all horizontal segments is transformed into one with all segments vertical, each box becomes saturated. We also show that each rotate (resp., flip) operation contributes a total of at most 2 (resp., 4) units to the saturation of various boxes in our set. It follows that at least (k2 k−1 )/4 = k2 k−3 = n log n/8 operations are required to saturate all k2 k−1 boxes.
Consider the point set P k for some k ∈ N. We say that a rectangle B ⊂ [−1, n] 2 is spanned by P k if two opposite corners of B are in P k ; and B is empty if its interior is disjoint from P k .
Let B be the set of closed rectangular boxes spanned by point pairs in P k in which the binary representation of the x-coordinates (b 1 , . . . , b k ) differ in precisely one bit. See Figure 3 for examples. Each point in P k is incident to k boxes in B, since there are k bits. Every box in B is spanned by two points of P k , Each point is incident to k boxes of sizes 2 i−1 × 2 k−i for i = 0, . . . , k − 1, since changing the ith bit b i incurs an 2 i−1 change in the x-coordinate and an 2 k−i change in the y-coordinate. However, if we change several bits successively, then either the x-coordinate changes by more than 2 i−1 or the y-coordinate changes by more than 2 k−i , and so every box in B is empty. Note also that the boxes of the same size are pairwise disjoint.
We now define the "saturation" of each box B ∈ B with respect to a rectangulation of P k . Let B ∈ B and let r be a rectangulation of P k . The vertical extent of B is the orthogonal projection of B into the y-axis. Consider the vertical segments of r clipped in B (i.e., the segments s ∩ B for all vertical segments s in r). The saturation of B with respect to r is the percentage of the vertical extent of B covered by projections of vertical segments of r clipped in B. See Figure 4 for examples. By definition, the If we transform an all-horizontal rectangulation into an all-vertical one by a sequence of operations, the total saturation of all k2 k−1 boxes in B increases from 0 to k2 k−1 . The key observation is that a single operation increases the total saturation of all boxes in B by at most a constant. It remains to bound the impact of a single operation on the saturation of a box in B. Consider first an operation ROTATE(r, c) that increases the saturation of some box B ∈ B. A rotate operation shortens a segment s 1 and extends an orthogonal segment s 2 . The saturation of a box B can increase only if a vertical segment grows, so we may assume that s 1 is horizontal and s 2 is vertical. Denote by s the newly inserted portion of s 2 . Note that s lies in a single face of the rectangulation r. Similarly, if an operation FLIP(r, p) increases the saturation of a box in B, then it replaces a horizontal segment by a vertical segment passing through p. The new vertical segment lies in two adjacent faces of r, separated by the original horizontal segment through p. We represent the new vertical segment as the union of two collinear vertical segments s ∪ s that meet at point p. In summary, an operation ROTATE(r, c) inserts one vertical segment s that lies in the interior of a face of r, and an operation FLIP(r, p) inserts two such segments. We show now that if such a new vertical segment s increases the saturation of some box in B ∈ B, then s must lie in B.
Theorem 2 For every n ∈ N, there is an n-element point set P ⊂ [−1, n] 2 such that the diameter of G(P ) is Ω(n log n).
Proof: First assume that n = 2 k for some k ∈ N 0 . We have defined a set P k of n = 2 k points and a set B of k2 k−1 = n log n/2 boxes spanned by P k . The total saturation of all boxes in B is 0 in the rectangulation with horizontal segments, and |B| = n log n/2 in the one with all segments vertical. By Lemma 3, a single flip or rotate operation increases the total saturation by at most 4. Therefore, at least n log n/8 operations are required to transform the horizontal rectangulation to the vertical one, and the diameter of G(P k ) is at least n log n/8. If n is not a power of two, then put k = log 2 n and let P ⊂ [−1, n] 2 be the union of P k and n−2 k arbitrary (noncorectilinear) points in [2 k , n] 2 . All axis-parallel segments containing the points in P \ P k are in the exterior of [−1, 2 k ] 2 . Therefore k2 k−3 = Ω(n log n) operations are required when all segments containing the points in P k ⊂ P change from horizontal to vertical.

The Flip Diameter for Diagonal Point Sets
We say that a point set P is diagonal if all points in P lie on the graph of a strictly increasing function (e.g., f (x) = x). In this section we show that the flip diameter is O(n) for any n-element diagonal set. We denote by p i the segment that contains p i .
Theorem 3 For every n ∈ N, the diameter of G(P ) is at most 11n when P is a diagonal set of n points.
Proof of Theorem 3: Without loss of generality, we may assume that the diagonal set is P = {p i : i = 1, . . . , n}, where p i = (i, i). Given a rectangulation r for P , we construct a sequence of at most 5.5n flip and rotate operations that transforms r into a rectangulation with all segments vertical. Our algorithm consists of the following four phases. Phase 1: No three consecutive segments are parallel. We describe an algorithm that, given a rectangulation r of P , applies less than 3n operations and returns a rectangulation in which no three consecutive points are contained in parallel segments.
NoThreeParallel(r). While there are three consecutive points in P contained in parallel segments, let p i−1 , p i , p i+1 ∈ P be arbitrary points such that the segments p i−1 , p i , and p i+1 are parallel, and call Shorten&Flip(r, p i ).
Note that Shorten&Flip(r, p i ) changes the orientation of the middle segment p i only. Hence, after one invocation of Shorten&Flip(r, p i ), segments p i−1 , p i , and p i+1 have alternating orientations, and will never be in the middle of a consecutive parallel triple. This implies that NoThreeParallel(r) terminates after changing the orientation of at most n/2 segments, and no three consecutive points are in parallel segments in the resulting rectangulation.
It remains to bound the number of flip and rotation operations: we have already seen that there are at most n/2 flip operations, and we shall charge each rotation operation to the segment extended by that operation. Note that after an invocation of Shorten&Flip(r, p i ), the two endpoints of p i lie on p i−1 and p i+1 , respectively, and so segment p i is not extended after a flip in Phase 1. Thus, each segment can be extended in two possible directions (left/right or up/down). We claim that each segment is extended at most once in each direction. Suppose to the contrary that a segment p k is extended twice in the same direction (refer to Figure 5, right). By symmetry, we may assume that p k is vertical, and it is extended upward in two rotate operations involving some horizontal segments p i and p j (each of which is sandwiched between two horizontal segments). In the first rotation, p k is extended from its intersection with p i to an intersection with p j . Hence, the order of the corresponding three points is k < i < j. This step creates a rectangle bounded by p i on the top, p j on the bottom, and p k on the left. The right boundary of this rectangle cannot be p i+1 , since it is horizontal; and it cannot be any segment p , > i + 1, otherwise the rectangle would contain p i+1 . The contradiction confirms the claim. We conclude that this phase involves at most 2n rotations and at most n/2 flip operations.
Phase 2: Creating a staircase. We define a staircase in a rectangulation of P as a monotone increasing path along the segments that does not skip two or more consecutive points (refer to Figure 6). In the second a c b phase of our algorithm, we transform a rectangulation r with no three consecutive parallel segments into a rectangulation r that contains a staircase from the lower left to the upper right corner of R.
We construct a staircase π incrementally, starting from the lower left corner. In each step we successively extend π with one horizontal and one vertical segment to a point of P or to the upper right corner of R. Let π be a current staircase from the lower left corner to a point a ∈ P . Denote by b and c the next two points of the diagonal set P . If there is a monotone path from a to b or from a to c, then append this path to π to obtain a longer staircase. Suppose there is no such path. Then the segments a and b must be parallel, otherwise there would be a monotone path from a to b. The segment c must be perpendicular to the segment a since there are no three consecutive parallel segments.
We would like to perform a rotation at the intersection of segments b and c , and then we can extend π from a to c (along a and c ). However, other operations may be necessary before we can rotate at b ∩ c . Successively rotate all intersection points of b with other segments that are to the right of b if b is horizontal, and that are above b if b is vertical (rotating at b ∩ c eventually).
We claim that this phase requires at most n rotations. Let a, b, and c be defined as before, such that there is no path from a to either b or c. Assume, by symmetry, that a and b are horizontal and c is vertical. Let d 1 , . . . , d k be segment endpoints on b to the right of b. The bottom endpoints of the vertical segments through d 1 . . . d k are now below b, and so these endpoints will never be involved in another rotation in our incremental procedure. Similarly, we perform a rotation at the left endpoint of each horizontal segment at most once. Therefore, the total number of rotations is bounded by the number of segments, which is n. Phase 3: Extending all vertical segments of the staircase to full length. The third phase of our algorithm returns a rectangulation in which every vertical segment of the staircase extends to the top and bottom sides of the bounding box R. The staircase subdivides R into two regions, one above and one below (see Figure 7). We handle the two regions independently without modifying the staircase. To handle the region above, we sweep from top to bottom and successively shorten each horizontal segment we encounter until further shortening is impossible or would modify the staircase. If we encounter a horizontal segment s that is not part of the staircase, we use subroutine Shorten&Flip(r, s) to shorten it as much as possible and then flip it to vertical position. Similarly, we sweep the region below the staircase bottom-up.
Each flip or rotate operation in Phase 3 increases the number of segment endpoints lying on the top or bottom side of R. Therefore, the number of operations is bounded by the total number of segment endpoints, which is 2n.  (Figure 7, right). Each strip contains a horizontal segment of the staircase, including a point in P . Because the staircase does not skip two or more consecutive points, there are at most three points in each strip. The total number of points in all strips combined is less than n.
If there is just one point in a strip, then we flip the horizontal segment that contains it. If there are two points in a strip, then one lies on a horizontal and one on a vertical segment. In this case, perform a rotation so the vertical segment reaches maximum length, and then flip the horizontal segment. If there are three points in a strip, then the middle point lies on a horizontal segment and the other two lie on vertical segments above and below the staircase, respectively. In this case, we perform two rotations so that both vertical segments reach full length, and then flip the horizontal segment. Similarly to Phase 3, each operation in this phase increases the number of segment endpoints lying on the top or bottom side of R. Therefore, 2n is an upper bound on the number of operations in Phases 3 and 4 combined. Remark. Felsner et al. [17] showed that the rectangulations of a diagonal point set are in bijection with twin pairs of binary trees. Visually, the part of the boundaries of the rectangles lying above (resp., below) the points in P form a binary tree whose vertices are the points in P and the top-right (resp., bottom-left) corners of R. This observation allows determining the number of rectangulations for diagonal point sets in terms of Baxter permutations (cf. [17]). Theorem 3 implies the following.
Corollary 1 For any two pairs of twin binary trees with n leaves, there is a sequence of twin binary trees (t 1 , t 1 ), . . . , (t k , t k ) of size k = O(n) that starts with the first pair, ends with the second pair, and for every i (1 ≤ i < k), either t i = t i+1 or t i+1 is obtained from t i by a single tree-rotate operation (the same for t i and t i+1 ).

Generalization to Convex Subdivisions
Given a set P of n points in the plane, a convex subdivision for P is a subdivision of the plane into convex cells by n pairwise noncrossing line segments (possibly lines or half-lines), such that each segment contains exactly one point of P and no three segments have a point in common. The flip and rotate operations can be interpreted for convex subdivisions of a point set P , as well (see Figure 8). The definition of the operation ROTATE(r, c) is identical to the rectilinear version. The operation FLIP(r, p) requires more attention, since a segment may have infinitely many possible orientations. Definition 3 (Flip) Let r be a convex subdivision of P , let p ∈ P be a point such that the segment s containing p does not contain any endpoints of other segments, and let σ ∈ S 1 be a unit vector. The operation FLIP(r, p, σ) replaces s by a segment of direction σ containing p.
Similarly to the graph of rectangulations G(P ), we define the graph of convex subdivisions of P , G(P ) = (V, E), where the vertex set is V = {r : r is a convex subdivision of P } and the edge set is E = {(r 1 , r 2 ) : a single flip or rotate operation on r 1 produces r 2 }. Our main result in this section is that even though G(P ) is an infinite graph, its diameter is O(n log n), where n = |V |.
Theorem 4 For set P of n points, the graph G(P ) is connected and its diameter is O(n log n).
We show that any convex subdivision can be transformed into a subdivision with all segments vertical through a sequence of O(n log n) operations. Subroutine Shorten&Flip(r, s) from Section 2 can be adapted almost verbatim: for a unit vector σ ∈ S 1 , subroutine Shorten&Flip(r, s, σ) shortens segment s maximally by rotate operations, and then flips it to direction σ.
Lemma 4 Let r be a convex subdivision of a set of n points in the plane with distinct x-coordinates. There is a sequence of O(n) flip and rotate operations that turns at least a 1 36 fraction of the nonvertical segments vertical, and keeps all vertical segments vertical.
Before proving Lemma 4, we need to introduce a few technical terms. Consider a convex subdivision r of a set of n points with distinct x-coordinates. We say that a segment s 1 hits another segment s 2 if an endpoint of s 1 lies in the relative interior of s 2 . An extension of s 1 beyond s 2 hits s 3 if s 1 hits s 2 and s 1 is contained in a segment s 1 , such that s 1 hits s 3 and s 1 crosses at most one segment (namely, s 2 ). Note that the operation ROTATE(r, s 1 ∩ s 2 ), if applicable, would extend s 1 beyond s 2 to hit segment s 3 . We define the extension visibility digraph H(r) on all segments in r, where the vertices correspond to the segments in r, and we have a directed edge (s 2 , s 3 ) if s 2 hits s 3 or there is a segment s 1 such that an extension of s 1 beyond s 2 hits s 3 .
The graph H(r) is not necessarily planar: it is not difficult to construct a convex subdivision r for a set of O(t 2 ) points where H(r) contains a subgraph isomorphic to the complete graph K t (Figure 9). It is enough to describe the segments of such a construction (the points may lie anywhere in the interior of the segments). Start with the sides of a convex t-gon, and extend the sides in counterclockwise direction to obtain a convex subdivision. The extension visibility digraph of these t segments contains a cycle (s 1 , . . . , s t ). Add short segments in the exterior of the initial t-gon: If a segment hits s i and its supporting line passes though s j , it generates an edge (s i , s j ) in the extension visibility digraph. Note that the number of edges in H(r) is at most 4n, since each segment hits at most two other segments, but some segments extend to infinity; and the extension of each segment beyond each of its endpoints hits at most one other segment. If P contains n points, the average degree in H(r) is less than 8. Therefore, H(r) has an independent set of size at least n/9 (obtained by successively choosing minimumdegree vertices [23,39]).
Proof of Lemma 4.: Let r be a convex subdivision of a set of n points with distinct x-coordinates. Let I 0 be an independent set in the extension visibility graph H(r) induced by all nonvertical segments. As noted above, I 0 contains at least 1/9 of the nonvertical segments in r. Let I 1 ⊆ I 0 be an independent set in the bar visibility graph of the segments in I 0 (two nonvertical segments in I 0 are mutually visible if there is a vertical segment between them that does not cross any segment of the subdivision). Since the bar visibility graph is planar, we have |I 1 | ≥ |I 0 |/4, and so I 1 contains at least a 1/36 fraction of the nonvertical segments in r. The total number of segment endpoints that lie in the relative interior of segments in I 1 is O(n). An invocation of subroutine Shorten&Flip(r, s, (0, 1)) for each segment s ∈ I 1 changes their orientation to vertical.
The operations maintain the invariants that (1) the segments in I 1 are pairwise disjoint; and (2) the nonvertical segments in I 1 form an independent set in both H and the bar visibility graph of all segments in I 0 . It follows that each operation either decreases the number of nonvertical segments in I 1 (flip), or decreases the number of segment endpoints that lie in the relative interior of a nonvertical segment in I 1 (rotate). After performing O(n) operations, all segments in I 1 become vertical. Since only the segments in I 1 change orientation (each of them is flipped to become vertical), all vertical segments in r remain vertical, as required. 2 Proof of Theorem 4.: Let P be a set of n points in a bounding box. We may assume, by rotating the point set if necessary, that the points in P have distinct x-coordinates. Denote by r 0 the convex subdivision given by n vertical line segments, one passing through each point in P . Consider a convex subdivision r 1 of P . By Lemma 4, O(n) operations can decrease the number of nonhorizontal segments by a factor of at least 36/35. After at most log n/ log(36/35) invocations of Lemma 4, the number of nonvertical segments drops below 1, that is, all segments become vertical and we obtain r 0 , as claimed. 2

A linear upper bound for collinear points
We show that the bound O(n log n) on the diameter of the flip graph G(P ) from Theorem 4 can be improved to O(n) for some simple point configurations.
Theorem 5 For every n ∈ N, the diameter of G(P ) is O(n) when P is a set of n collinear points.
Proof: We may assume that P = {p i : i = 1, . . . , n}, p i = (i, 0). Let r be a convex subdivision of P . No segment in r is horizontal, since each segment contains a unique point. We show that there is a sequence of O(n) operations that transforms r into a convex subdivision with all segments vertical. Suppose that not all segments in r are vertical, and let m > 0 be the minimum absolute value of the slope of a nonvertical segment. Our algorithm proceeds in two phases.
Phase 1: Building a staircase. In this phase, we transform r into a convex subdivision in which every p i is a nonvertical ray with a left endpoint at infinity, and has slope m/n when i is odd and −m/n when i is even. We process the points p 1 , . . . , p n successively in this order. We maintain the following invariant (refer to Figure 10): When we start processing p i , segments p 1 , . . . , p i−1 are already rays with p 1 p 2 p 2 p 1 Fig. 10: Transforming a convex subdivision for n points lying on the x-axis into rays of alternating slopes m/n and −m/n. the desired properties, and they do not contain the endpoints of any segment p i , . . . , p n in their relative interiors.
Suppose that points p j , for all 1 ≤ j < i, have already been processed. We use the subroutine Shorten&Flip(r, p i , σ) to shorten p i and flip it into the desired orientation (of slope m/n or −m/n depending on the parity of i). For i = 1, this already guarantees that segment p 1 is a ray with a left endpoint at infinity. If i > 1, however, the left endpoint of p i lies on the ray p i−1 , whose slope is different from that of p i . Due to the invariant, p i−1 contains no segment endpoints to the right of the intersection point p i−1 ∩ p i . We can now apply a rotation at p i−1 ∩ p i . Since the slopes of all segments are at least m/n in absolute value, p i extends to infinity, and our invariant is established for segments p 1 , . . . , p i .
We argue that Phase 1 uses O(n) operations. For each point p i , we invoke Shorten&Flip(r, p i , σ), which performs only one flip operation, followed by at most one rotation. It is enough to bound the number of rotations performed in the invocations of subroutines Shorten&Flip. We claim that these invocations extend each segment at most once in each direction. Suppose, to the contrary, that a segment p k is extended in the same direction twice (when processing points p i and p j ). Since the points are processed from left to right, we have i < j < k. Consider the step in which a rotation extends p k from its intersection with p i to an intersection with p j . Then, the x-axis and segment p k intersect p i and p j in different orders. Hence, p i and p j must cross each other, contradicting the fact that they are part of a convex subdivision. This proves our claim. It follows that Phase 1 uses at most 5n operations.
Phase 2: Orienting all lines to be vertical. Refer to Figure 11. We are given a convex subdivision in Fig. 11: The first four passes over the rays yield vertical lines through all even points, separating the odd points. which every p i is a ray with a left endpoint at infinity, and has slope m/n when i is odd and −m/n when i is even. Note that only consecutive segments intersect. (This is still not a "canonical" subdivision, as m depends on the initial convex subdivision.) In Phase 2, we transform all segments into vertical lines. We make five passes over the odd or even points: (1) For every odd point p i from right to left, rotate ray p i into a line of slope m/n. As a result, the lines through the odd points separate the even points.
(2) We can now flip the segments through the even points independently into vertical segments. (3) For every even point p i from left to right, rotate the top endpoints to infinity. (4) For every even point from right to left, rotate the bottom endpoint to infinity. We obtain vertical lines through the even points, that separate the odd points. (5) Finally, flip the segments through the odd points independently into vertical lines. We made three passes over even segments and two passes over odd segments, so the total number of operations in Phase 2 is 2n + n/2 ≤ 3n. The two phases combined use at most 8n operations. 2

Conclusions
We have shown that the diameter of the flip graph G(P ) is between Ω(n) and O(n log n) for every nelement point set P , and these bounds cannot be improved. The diameter is Θ(n) for diagonal point sets, and Θ(n log n) for the bit-reversal point set. The flip graph G(P ) of a noncorectilinear set P is uniquely determined by the permutation of the xand y-coordinates of the points [2] (e.g., diagonal point sets correspond to the identity permutation). It is an open problem to find the average diameter of G(P ) over all n-element permutations. It would already be of interest to find broader families of point sets with linear diameter: Is the diameter of G(P ) linear if P is in convex position, unimodal, or corresponds to a separable permutation (see [4]) ? We have shown that the diameter of the flip graph is also O(n log n) for the convex subdivisions of n points in the plane. We do not know whether this bound is tight. It is possible that the flip diameter is Ω(n log n) for the bit-reversal point set defined in Section 3, but our proof of Theorem 2 heavily relies on axis-aligned boxes and does not seem to extend to convex subdivisions.
Given a convex subdivision r of a point set P , the flip and rotate operations can be thought of as a continuous deformation; refer to  vertices swept during this continuous deformation. By Theorem 4, a sequence of O(n log n) operations can transform any convex subdivision to any other convex subdivision on n points. A single operation, however, may have Ω(n) weight. We conjecture that the weighted diameter of the graph G(P ) is also O(n log n) for every n-elements point set P .