The Cassowary linear arithmetic constraint solving algorithm

Greg J. Badros, Alan Borning and Peter J. Stuckey

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 third of a window, or preferring that an object be contained within a rectangle if possible. Previous constraint solvers designed for user interface applications cannot handle simultaneous linear equations and inequalities efficiently. This is a major limitation, as such systems of constraints arise often in natural declarative specifications. We describe Cassowary---an incremental algorithm based on the dual simplex method, which can solve such systems of constraints efficiently. We have implemented the algorithm as part of a constraint-solving toolkit. We discuss the implementation of the toolkit, its application programming interface, and its performance.

Venue
TOCHI 2001
Volume
ACM Transactions on Computer-Human Interaction, Volume 8
DOI
10.1145/504704.504705
PDF
https://dl.acm.org/doi/pdf/10.1145/504704.504705
Anthology ID
2001.tochi-8.10

Cite

@article{badros-etal-2001-cassowary,
    title = {{The Cassowary linear arithmetic constraint solving algorithm}},
    author = {Greg J. Badros and Alan Borning and Peter J. Stuckey},
    journal = {ACM Transactions on Computer-Human Interaction},
    volume = {8},
    issn = {1073-0516},
    year = {2001},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    doi = {10.1145/504704.504705},
    url = {https://doi.org/10.1145/504704.504705},
    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 third of a window, or preferring that an object be contained within a rectangle if possible. Previous constraint solvers designed for user interface applications cannot handle simultaneous linear equations and inequalities efficiently. This is a major limitation, as such systems of constraints arise often in natural declarative specifications. We describe Cassowary---an incremental algorithm based on the dual simplex method, which can solve such systems of constraints efficiently. We have implemented the algorithm as part of a constraint-solving toolkit. We discuss the implementation of the toolkit, its application programming interface, and its performance.}
}