Patent ID: 8599216

Claim:
A method, comprising: receiving, at a computing device, a user-interface layout configured to specify at least a first rectangular component and a second rectangular component, both within a container rectangle, wherein the first rectangular component has a first size in a horizontal or vertical dimension, and wherein the second rectangular component has a second size in the horizontal or vertical dimension; the computing device determining a plurality of grid lines based on the user-interface layout, wherein the first rectangular component is associated with a first set of at least two grid lines of the plurality of grid lines, and wherein the second rectangular component is associated with a second set of at least two grid lines of the plurality of grid lines; the computing device generating a system of constraints, wherein a first constraint in the system of constraints is related to the first set of at least two grid lines, and wherein a second constraint in the system of constraints is related to the second set of at least two grid lines; the computing device solving the system of constraints to determine, for each respective grid line in the first and second sets of grid lines, a respective location for the respective grid line, wherein solving the system of constraints comprises: generating a graph comprising a plurality of nodes and a plurality of edges, wherein the plurality of nodes correspond to the plurality of grid lines, and wherein the plurality of edges correspond to the system of constraints, and using a variant of a Bellman-Ford algorithm to solve a single-source path-length problem for the graph to determine the respective locations for the respective grid lines of the plurality of grid lines; based on the respective locations of the respective grid lines, the computing device generating a user-interface display including the first and second rectangular components; and the computing device displaying the user-interface display.