Live data from Hacker News

The algorithm for a perfectly balanced photo gallery

crispymtn.com

101–104 of 104 posts

Re: The algorithm for a perfectly balanced photo gallery

#101
post #51

Since I'm a CS theory person, I can offer some theoretical improvements on the running time and make the problem even more general... Instead of minimize the linear difference of partition, we might want to minimize the standard deviation, or basically any convex function, and still do it in the same time bound. One can reduce this problem to find a k-edge path of minimum weight on a complete DAG. The naive algorithm…

a solution would be awesome, especially in javascript. i actually found a case where their linear algorithm, https://github.com/crispymtn/linear-partition , failed.

See the updated content in the link and the code in here http://www.chaoxuprime.com/posts/2013-08-16-more-algorithms-... Both in Haskell. you can see how to implement it from scratch...

Re: The algorithm for a perfectly balanced photo gallery

#102

What's just as impressive is the full size view of the image. The background brings the ambient colour of the photo to make it more immersive. Very nice!

Here's a follow up on that topic: http://www.crispymtn.com/stories/extrapolating-photos-for-im...

Re: The algorithm for a perfectly balanced photo gallery

#104
post #96
post #25

btw this breaks zoom.

Not only that it breaks zoom, at certain window ratios (eg: 480x800) is completely fails - I get this error: TypeError: solution[(n - 1)] is undefined @ http://www.chromatic.io/application.a3c7ec1cbcca0f5a77fbc1dc... I've done stuff like this in the past, if you want something that works: https://github.com/ionelmc/jquery-gp-gallery

i think i found the problem with the algorithm. sometimes it returns an empty row. the javascript version throws while the python version doesn't. i fixed it in my fork by just reducing the number of rows until it doesn't throw: https://github.com/jonathanong/linear-partition
Post reply on HN