Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The many ways of splitting a rectangle in many (alfonsobeato.net)
75 points by cuentasombra on Jan 4, 2021 | hide | past | favorite | 13 comments


Don Knuth's 2017 Christmas lecture featured a way to count how many ways a rectangle can be subdivided into rectangles [0]. It got its own entry in the Online Encyclopedia of Integer Sequences [1].

[0] https://youtu.be/BxQw4CdxLr8 [1] https://oeis.org/A285357


I don’t want my video conferencing software to choose different sized rectangles and/or different aspect ratios for different people. The splitting into vertical slices in MS Teams in driving me nuts, with its (crappy) automated panning to keep the face in view, that they had to add because they decided to chop the sides off. Just put all same-sized rectangles that all have the same aspect ratio in the view and allow some background if the number of people isn’t a rectangular number.


I can get behind using the same aspect ratio for everyone, but boy 16x9 is not a very good aspect ratio for videoconferencing.


Oh yeah, totally agreed. Maybe just square would be great. 4:3 at the widest. I guess there probably are 16:9 webcams, but aren’t they typically narrower?


A yak, very finely shaved indeed!


Better if the algorithm is weighted to prefer tall rectangles, not wide rectangles, to best fit faces



I did some playing with this a while back, taking a different approach. I wanted all windows to have the same aspect ratio, and all to be the same size except for (optionally) one "selected" window which would be bigger by some factor. Options were scored by percentage of total space used, deviation from desired aspect ratio, and optionally preferring solutions that magnified the selected window. https://observablehq.com/@tomcburke/rectangle-packing


Interesting, this could be applied in shipping/packaging industry as a sort of heuristic, even if knapsack problem is a more natural fit.


Worked a bit for a logistics provider. My experience was this:

Investing tens of thousands of dollars of engineering and processing time isn't worth it to save seconds for an employee working minimum wage (that does the packing for awkward shapes by hand).


https://en.wikipedia.org/wiki/David_A._Klarner

When I was in school Dr Klarner was looking into that exact problem. He had it pretty well dialed in on 2d. Once you move to 3d though it becomes a strange problem as what was once optimal for 2d may no longer be in 3d.

In practical terms though time/speed is usually more important in packing. For example you may have optimal packing but it takes 10 hours to physically pack it out is not great. Optimal load size is usually better if you have fixed size packages that interlock in some known pattern or are willing to allow some slack.


why does the author feel its needed for a webpage to have a loading notification on the bottom left of the supposed webpage


Soon to be on Leetcode under easy difficulty category.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: