fitting n variable height images into 3 (similar length) column layout
I'm looking to make a 3-column layout similar to that of piccsy.com . Given a number of images of the same width but varying height, what is a algorithm to order them so that the difference in column lengths is minimal? Ideally in Python or JavaScript... Thanks a lot for your help in advance! Martin How many images? If you limit the maximum page size, and have a value for the minimum picture height, you can calculate the maximum number of images per page. You would need this when evaluating any solution. I think there were 27 pictures on the link you gave. The following uses the first_fit