language: en

The Cassowary Linear Arithmetic Constraint Solving Algorithm: Interface and Implementation

Greg J. Badros Alan Borning
Technical Report UW-CSE-98-06-04
Department of Computer Science and Engineering University of Washington
Box 352350, Seattle, WA 98195-2350 USA
fgjb,borningg@cs.washington.edu 29 June 1998

Abstract Linear equality and inequality constraints arise naturally in specifying many aspects of user interfaces, such as requiring that one window be to the left of another, requiring that a pane occupy the leftmost 1/3 of a window, or preferring that an object be contained within a rectangle if possible. Current constraint solvers designed for UI applications cannot efficiently handle simultaneous linear equations and inequalities. This is a major limitation. We describe Cassowary|an incremental algorithm based on the dual simplex method that can solve such systems of constraints efficiently.

[This informal technical report describes the latest version of the Cassowary algorithm. It is derived from the paper "Solving Linear Arithmetic Constraints for User Interface Applications" by Alan Borning, Kim Marriott, Peter Stuckey, and Yi Xiao [7], published in the UIST'97 Proceedings. The UIST paper also contains a description of QOCA, a closely related solver that finds least-squares solutions to linear constraints. This technical report, which is intended to be self-contained, includes material on Cassowary from the UIST paper, plus a description of the Java, C++, and Smalltalk implementations and their interfaces. along with additional details, corrections, and clarifications. An earlier technical report also discussed QOCA and the similarities between Cassowary and that algorithm [6].]

1 Introduction