Glop vs Cassowary

202 views
Skip to first unread message

meriah...@gmail.com

unread,
Mar 19, 2015, 9:23:43 AM3/19/15
to or-tools...@googlegroups.com
I am researching linear constraint solvers for a UI project.  I have spend a bit of time studying Cassowary which was made with UI applications in mind. I have not been able to find much information about Glop.  Does anyone have any info on how it compares to Cassowary? For example, Cassowary is designed so that changing/adding/removing a constraint on the fly is handled very efficiently. Would you recommend Glop for a complex UI application (i.e. determining layout based on constraints)?

Thanks, 
Adam

Bruno De Backer

unread,
Mar 20, 2015, 11:04:53 AM3/20/15
to or-tools...@googlegroups.com
Hi Adam,
Glop was designed with operations research applications in mind. It does not implement the same primitives that Cassowary does, but in theory you could use Glop to implement the same primitives as Cassowary. I would be more work, though

Like Cassowary, Glop implements a dual simplex (accessible by setting the parameter use_dual_simplex=true). A dual simplex makes it possible to very efficiently add constraintwould be in s to an already solved problem, with minimal recomputation. As for retracting constraints, the bounds of the removed constraints need to be changed to -infinity/+infinity. 

Glop implements an optimized version of the dual revised simplex. I'm not sure about Cassowary, but from their literature https://constraints.cs.washington.edu/solvers/cassowary-tochi.pdf Cassowary seems to implement the simpler and slower tableau version of the simplex. Moreover they handle unrestricted variables (with no upper- or lower-bounds) by using two simplex tableaux.

The main issue for using Glop in UI applications would most likely be the handling of constraint hierarchies. One suggestion would be to make the constraint optional by transforming a.x <= n into a.x + s = b with s>= 0, and to add a cost for s in the cost function. The cost would be all the higher as the priority of the constraint would be high.

I hope this helps. Please tell us if you implement a UI layout application using Glop.
Cheers,
BdB

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
BdB

meriah...@gmail.com

unread,
Mar 23, 2015, 1:01:38 PM3/23/15
to or-tools...@googlegroups.com
Thanks so much for your response Bruno! This is very helpful information.

Adam
Reply all
Reply to author
Forward
0 new messages