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.
Re: The algorithm for a perfectly balanced photo gallery
#101See 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...