SkyBlue

Created on 2020-08-31T01:03:00+00:00

Return to the Index

This card can also be read via Gemini.

2022-10-12T03:53:00+00:00 Revisit

Constraints map input values to an executable function and one or more output values. There is also a strength level assigned to constraints.

All constraints are added to a set. The set is walked and constraints are enforced so long as a constraint of equal or higher strength does not conflict with the same output values.

Higher strengths are allowed to bump lower strengths out of a solution.

If there is a conflict the weaker constraint is bumped and re-added to the set of unenforced constraints.

Repeat picking a constraint from the unenforced set and trying to enforce it until there are no elements remaining.

Constraints might be unenforcable if there is no alternative that does not try to claim a higher ranking constraint. In that case the constraint has to be left as failed.

Cycles are allowed but they are basically cut out of the graph and isolated. Those isolated islands are replaced with a single constraint with multiple inputs and outputs and solving the cycles are undefined. Another solver like Cassowary is needed to run inside those blocks.

Stay constraints just assign a variable to some fixed value.

Changing values involves provisionally setting a new value, running all constraints outward from the variable that changed, and either failing if a constraint fails or committing the new value of each variable on success.

2020-08-31T01:03:00+00:00

A constraint solver. Although does not solve constraints so much as selects methods which claim to solve the constraint in such a way that none of the methods conflict.

Walk bounds