Cassowary Constraint Solver

An algorithm used for constraining elements in a UI such as adjusting layout based on the screen size. It is designed to handle linear equality and inequality efficiently (e.g. show window to the left of the other and gracefully degrading if there isn’t space).

Read the paper

See also:

  • tui-rs uses Cassowary for laying out text-based user interfaces in the terminal
  • GraphPlan - another kind of constraint solver that uses both a novel data representation of the problem domain and a solver