Shortest length for three news columns (e.g. google +)?

I am implementing a news feed similar to Google+ .

The problem can be abstracted as follows:

Given a list of blocks (different heights, but the same widths as the width of the column), how can we arrange the texts in three columns to make the total page length shorter?

Note that blocks cannot overlap, and blocks do not follow any order.

+4
source share
1 answer

This problem is known as Multilateral Numeric Partition .

, , . , , .

NP-hard, .

+4

Source: https://habr.com/ru/post/1684254/


All Articles