Skip to main content
added 435 characters in body
Source Link
coderodde
  • 32.3k
  • 15
  • 79
  • 205

I guess greybeard knows better about computational geometry, yet, as a novice, I would do the next: sort all the rectangles by area. Then start layoutlaying them out from left to right to the top of the panel. When the first "row" is occupied, lay the next "row" from right to left, and so on.

I guess greybeard knows better about computational geometry, yet, as a novice, I would do the next: sort all the rectangles by area. Then start layout them out from left to right to the top of the panel. When the first "row" is occupied, lay the next "row" from right to left, and so on.

I guess greybeard knows better about computational geometry, yet, as a novice, I would do the next: sort all the rectangles by area. Then start laying them out from left to right to the top of the panel. When the first "row" is occupied, lay the next "row" from right to left, and so on.

added 435 characters in body
Source Link
coderodde
  • 32.3k
  • 15
  • 79
  • 205

Bad advice 1

I guess greybeard knows better about computational geometry, yet, as a novice, I would do the next: sort all the rectangles by area. Then start layout them out from left to right to the top of the panel. When the first "row" is occupied, lay the next "row" from right to left, and so on.

Actually, I suspect that optimal layout minimizing the surrounding area is very hard to compute (NP-hard or something).

Bad advice 1

I guess greybeard knows better about computational geometry, yet, as a novice, I would do the next: sort all the rectangles by area. Then start layout them out from left to right to the top of the panel. When the first "row" is occupied, lay the next "row" from right to left, and so on.

Actually, I suspect that optimal layout minimizing the surrounding area is very hard to compute (NP-hard or something).

added 89 characters in body
Source Link
coderodde
  • 32.3k
  • 15
  • 79
  • 205

Not an algorithm review, but rather a review from software engineering point of view.

Not an algorithm review, but rather a review from software engineering point of view.

add more shit
Source Link
coderodde
  • 32.3k
  • 15
  • 79
  • 205
Loading
Source Link
coderodde
  • 32.3k
  • 15
  • 79
  • 205
Loading