[SciPy-User] Constrained optimization algorithm for layout?
Robert Kern
robert.kern at gmail.com
Mon Oct 28 10:05:33 EDT 2013
On Wed, Oct 23, 2013 at 7:20 PM, raghavan <vidya.setlur at gmail.com> wrote:
>
> Hi,
>
> I'm trying to create an arrangement of several UI objects in a layout,
each having their own constraints in terms of how they need to be placed
and aligned. What optimization algorithm would be useful for an application
like this?
A specialized version of linear programming works well. Cassowary is the
most widely used solver for this; it implements linear programming with a
hierarchy of constraints. An implementation of Cassowary is used in Apple's
new Auto Layout mechanism.
http://www.cs.washington.edu/research/constraints/cassowary/
I have Cython bindings to the Cassowary solver here:
https://pypi.python.org/pypi/casuarius
Casuarius is used in the layout mechanism of Enaml:
https://github.com/nucleic/enaml/tree/master/enaml/layout
A slightly different variant is the Auckland Layout Model, which uses a
standard linear programming solver without hierarchies (though it does
require one that is optimized for restarts):
http://aucklandlayout.sourceforge.net/
--
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20131028/4cf83872/attachment.html>
More information about the SciPy-User
mailing list