Algorithm Search⌘K

Theoremresearch

Mosaic floorplans and Baxter numbers

Also called Baxter number count of floorplans.

The number of mosaic floorplans with n rooms is the nth Baxter number, as Yao, Chen, Cheng and Graham showed by a bijection with twin binary trees.

The Baxter number theorem counts the mosaic floorplans: with nn rooms there are exactly B(n)B(n) of them, where B(n)B(n) is the nnth Baxter number 1,2,6,22,92,422,2074,…1, 2, 6, 22, 92, 422, 2074, \ldots. Yao, Chen, Cheng and Graham proved it in 2001 with a bijection between mosaic floorplans and twin binary trees, pairs of binary trees that Dulucq and Guibert had already put in bijection with Baxter permutations. The theorem fixes the size of the search space of every floorplanner that works with mosaic floorplans: it grows like 8n8^n, against about 5.83n5.83^n for slicing floorplans, and any code for a mosaic floorplan needs about 3n3 n bits.

Statement

A mosaic floorplan with nn rooms is a division of a rectangle into nn rectangular rooms in which no four rooms meet at a point, taken up to sliding of its segments (see mosaic floorplan). The Baxter numbers are

B(n)=1(n+11)(n+12)∑k=1n(n+1k−1)(n+1k)(n+1k+1),n≥1.B(n) = \frac{1}{\binom{n+1}{1}\binom{n+1}{2}} \sum_{k=1}^{n} \binom{n+1}{k-1}\binom{n+1}{k}\binom{n+1}{k+1}, \qquad n \ge 1.

For a binary tree τ\tau with nn nodes, list its nodes in inorder v1,…,vnv_1, \ldots, v_n, and let its canopy be the word c(τ)=c1⋯cn−1c(\tau) = c_1 \cdots c_{n-1} with ci=1c_i = 1 if viv_i has a right child and ci=0c_i = 0 if it does not. A twin binary tree pair is a pair (τ1,τ2)(\tau_1, \tau_2) of binary trees on the same nn nodes with the same inorder and complementary canopies: c(τ2)c(\tau_2) is c(τ1)c(\tau_1) with each bit flipped. As unlabeled objects, a twin pair is a pair of tree shapes with nn nodes each whose canopies are complementary.

Theorem (Yao, Chen, Cheng and Graham). There is a bijection between the mosaic floorplans with nn rooms and the twin binary tree pairs with nn nodes. So the number of mosaic floorplans with nn rooms is B(n)B(n).

nn 1 2 3 4 5 6 7 8 9 10
B(n)B(n) 1 2 6 22 92 422 2074 10754 58202 326240

In plain words

Count the ways to cut a chip into a given number of rectangular rooms, where only the pattern matters and not the exact sizes. The answer is a known sequence, the Baxter numbers. The proof turns each pattern into two binary trees. The first tree hangs each room on the room below it or on the room to its left, as seen from the lower left corner of the room. The second tree does the same from the upper right corner, with the rooms above and to the right. The two trees visit the rooms in the same order, and at each room exactly one of the two trees goes on to the right. Pairs of trees with this property were already known and counted, so the floorplans are counted as well. The count grows by a factor of about eight for each extra room.

Proof

Fix a mosaic floorplan FF in the rectangle [0,W]×[0,H][0, W] \times [0, H]. Each corner of a room other than the four corners of the rectangle is a T-junction: exactly one of the two lines through it goes on past it on both sides, and the other one ends there.

The two trees. The tree τ1\tau_1 has its root at the room with the lower-left corner (0,0)(0, 0). For each other room rr, let pp be its lower-left corner.

  • If the vertical line through pp goes on below pp, the parent of rr is the room below pp whose left side is on that line, and rr is its right child.
  • Otherwise the horizontal line through pp goes on to the left of pp, the parent of rr is the room to the left of pp whose bottom side is on that line, and rr is its left child.

The tree τ2\tau_2 is the same from the upper-right corner. Its root is the room with the corner (W,H)(W, H). For each other room rr with upper-right corner qq: if the vertical line through qq goes on above qq, the parent of rr is the room above qq whose right side is on that line, and rr is its left child. Otherwise the parent of rr is the room to the right of qq whose top side is on that line, and rr is its right child.

These are binary trees. A T-junction makes exactly one case hold, so each room except the root has one parent. The parent's lower-left corner is lower, or at the same height and further left, so the parent relation has no cycle and leads to the root. A room uu has at most one right child in τ1\tau_1, the room whose lower-left corner is the upper-left corner of uu, and at most one left child, the room whose lower-left corner is the lower-right corner of uu. The same holds for τ2\tau_2. Sliding segments does not change which room is at which corner, so τ1\tau_1 and τ2\tau_2 depend only on the equivalence class.

The corner room. Let R=[a,W]×[0,d]R = [a, W] \times [0, d] be the room at the lower-right corner. The rooms on the bottom side of the rectangle form a chain of left children from the root of τ1\tau_1, and RR is the last of them. The rooms on the right side form a chain of left children from the root of τ2\tau_2, and RR is again the last. No room is a left child of RR in either tree, so RR is the first node in the inorder of both trees. Let q=(a,d)q = (a, d) be the upper-left corner of RR. If n≥2n \ge 2, exactly one of two cases holds at qq.

  • Case top. The vertical line through qq goes on above qq. Then the room XX with lower-left corner qq is the right child of RR in τ1\tau_1. The top side of RR is a whole segment, and the rooms above it are XX and the chain of left children that starts at XX in τ1\tau_1. In τ2\tau_2, a right child of RR would be a room whose upper-right corner is qq and whose right side ends at qq, which the line above qq forbids, so RR has no right child in τ2\tau_2.
  • Case left. The horizontal line through qq goes on to the left of qq. Then no room has its lower-left corner at qq, so RR has no right child in τ1\tau_1. The left side of RR is a whole segment. The room just to the left of qq and below it has upper-right corner qq, its right side ends at qq, and its top side is on the line of the top side of RR, so it is the right child of RR in τ2\tau_2.

So the first canopy bit of τ1\tau_1 is 11 and that of τ2\tau_2 is 00 in case top, and the other way round in case left.

Removing the corner room. In case top, delete RR and stretch the rooms above it down to the bottom side. The result F′F' is a mosaic floorplan with n−1n - 1 rooms. In F′F', the room XX takes the place of RR as the left child of the parent of RR in τ1\tau_1, and all other parents in τ1\tau_1 stay the same, so τ1(F′)\tau_1(F') is τ1\tau_1 with RR spliced out. In τ2\tau_2, the room RR is a leaf, and no other room has its upper-right corner moved, so τ2(F′)\tau_2(F') is τ2\tau_2 with the leaf RR removed. Case left is the same with the two trees swapped and the rooms to the left of RR stretched to the right side. Splicing out a first node keeps the inorder of the others, and it keeps the right children of all other nodes, so the canopies of F′F' are those of FF with the first bit removed. By induction on nn, the two trees of F′F' have the same inorder and complementary canopies, and with RR in front the same holds for FF. So the map Φ(F)=(τ1,τ2)\Phi(F) = (\tau_1, \tau_2) sends mosaic floorplans to twin binary tree pairs.

One to one. From (τ1,τ2)(\tau_1, \tau_2) the floorplan is rebuilt. The first node in the inorder is RR, and the tree in which RR has a right child tells the case. In case top, the number kk of rooms above RR is the length of the chain of left children that starts at the right child of RR in τ1\tau_1. Splicing out RR gives the twin pair of F′F', which by induction gives F′F'. Then FF is F′F' with a new room RR put under the last kk rooms along the bottom side, below a new segment that ends on the left at the left side of the first of these kk rooms. Case left is the same with τ2\tau_2 and the right side. So Φ\Phi is one to one.

Onto, and the count. Yao, Chen, Cheng and Graham show that every twin binary tree pair is Φ(F)\Phi(F) for some mosaic floorplan FF, by building FF from the pair. Dulucq and Guibert give a bijection between twin binary tree pairs with nn nodes and Baxter permutations of {1,…,n}\{1, \ldots, n\}, and Chung, Graham, Hoggatt and Kleiman prove that the number of Baxter permutations of {1,…,n}\{1, \ldots, n\} is B(n)B(n). So the number of mosaic floorplans with nn rooms is B(n)B(n). ■\blacksquare

Consequences

  • Growth rate 88. Each term of the sum is at most (2n+1)3=8n+1(2^{n+1})^3 = 8^{n+1}, so B(n)≤n⋅8n+1B(n) \le n \cdot 8^{n+1}. For the middle index k=⌊(n+1)/2⌋k = \lfloor (n+1)/2 \rfloor, the middle binomial coefficient is at least 2n+1/(n+2)2^{n+1} / (n+2), and its two neighbors are at least a third of it, so B(n)≥8n+1/(9(n+2)3(n+1)3)B(n) \ge 8^{n+1} / (9 (n+2)^3 (n+1)^3). Hence B(n)1/n→8B(n)^{1/n} \to 8. The ratios B(n+1)/B(n)B(n+1) / B(n) are about 5.775.77 at n=10n = 10 and 7.847.84 at n=200n = 200.
  • Slicing floorplans are rare. The slicing floorplans are counted by the large Schröder numbers Sn−1S_{n-1}, whose growth rate is 3+22≈5.833 + 2 \sqrt{2} \approx 5.83. The generating function t(x)t(x) of the trees with no node of one child, which the slicing floorplan page uses for the count, satisfies t=x+t2/(1−t)t = x + t^2 / (1 - t), that is 2t2−(1+x)t+x=02 t^2 - (1 + x) t + x = 0, and the discriminant 1−6x+x21 - 6 x + x^2 vanishes first at x=3−22x = 3 - 2\sqrt{2}. So the fraction of mosaic floorplans that are slicing goes to 00 exponentially.
  • Code length. A code that tells apart all mosaic floorplans with nn rooms needs at least log⁡2B(n)=3n−O(log⁡n)\log_2 B(n) = 3 n - O(\log n) bits, and with nn labeled blocks at least log⁡2(n! B(n))\log_2 (n! \, B(n)) bits.
  • Search spaces. A floorplanner that enumerates or samples mosaic floorplans works in a space of size n! B(n)n! \, B(n) for labeled blocks. The sequence pair, which describes packings with empty space, has (n!)2(n!)^2 codes, and the ratio (n!)2/(n! B(n))=n!/B(n)(n!)^2 / (n! \, B(n)) = n! / B(n) grows faster than any exponential function of nn.

Tightness

The theorem is an exact count, so there is no gap to close. The comparison with slicing floorplans is also exact at the start: B(n)=Sn−1B(n) = S_{n-1} for n≤4n \le 4, with the values 1,2,6,221, 2, 6, 22, so every mosaic floorplan with at most four rooms is slicing. The first difference is at n=5n = 5, where B(5)=92B(5) = 92 and there are 9090 slicing floorplans, and the two missing ones are the pinwheel and its mirror image. Without the rule that no four rooms meet, the class changes: a division with a point where four rooms meet is not a mosaic floorplan, and it is counted as two mosaic floorplans, one for each way to pull the four rooms apart.

History

Baxter permutations are named after Glen Baxter, who met them in 1964 in a question about fixed points of commuting functions. Chung, Graham, Hoggatt and Kleiman found the closed formula for their number in 1978. Dulucq and Guibert gave the bijection with twin binary trees in 1998. In floorplanning, Hong and others gave the corner block list for mosaic floorplans in 2000, which also takes corner rooms away one at a time, as the proof above does. Yao, Chen, Cheng and Graham showed in 2001, and in the journal version of 2003, that mosaic floorplans are in bijection with twin binary trees, so their number is the Baxter number, and that slicing floorplans are counted by the Schröder numbers.

References

  1. Bo Yao, Hongyu Chen, Chung-Kuan Cheng and Ronald L. Graham, Floorplan representations: complexity and connections, ACM Transactions on Design Automation of Electronic Systems 8(1), 55 to 80, 2003, the bijection between mosaic floorplans and twin binary trees, the count of mosaic floorplans by Baxter numbers, and the count of slicing floorplans by Schröder numbers
  2. Bo Yao, Hongyu Chen, Chung-Kuan Cheng and Ronald L. Graham, Revisiting floorplan representations, Proceedings of the International Symposium on Physical Design, 138 to 143, 2001, the first version of the twin binary tree bijection and the Baxter number count
  3. Serge Dulucq and Olivier Guibert, Baxter permutations, Discrete Mathematics 180(1-3), 143 to 156, 1998, twin binary trees and their bijection with Baxter permutations
  4. F. R. K. Chung, R. L. Graham, V. E. Hoggatt and M. Kleiman, The number of Baxter permutations, Journal of Combinatorial Theory, Series A 24(3), 382 to 394, 1978, the closed formula for the number of Baxter permutations of n
  5. Xianlong Hong, Gang Huang, Yici Cai, Jiangchun Gu, Sheqin Dong, Chung-Kuan Cheng and Jun Gu, Corner block list, an effective and efficient topological representation of non-slicing floorplan, Proceedings of the IEEE/ACM International Conference on Computer-Aided Design, 8 to 12, 2000, the representation of mosaic floorplans by the removal of corner rooms one at a time

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/YZV6WS/text.yaml