Patent ID: 8643673

Claim:
A method, comprising: receiving, at a computing device, a layout configured to specify at least a set of rectangular components within a container rectangle, wherein each rectangular component has at least one size in at least one dimension; the computing device determining a plurality of grid lines from the layout, wherein each rectangular component of the set of rectangular components is associated with at least two grid lines of the plurality of grid lines, the at least two grid lines based on the at least one size of the rectangular component; the computing device generating a system of constraints, wherein each constraint of the system of constraints is related to at least two grid lines of the plurality of grid lines; the computing device generating a graph comprising a plurality of nodes and a plurality of edges, wherein each node is associated with a node value, wherein the plurality of nodes corresponds to the plurality of grid lines, and wherein the plurality of edges corresponds to the system of constraints; the computing device topologically sorting the plurality of edges; the computing device determining locations for the grid lines by solving a single-source path-length problem for the graph using a variant of the Bellman-Ford algorithm configured to operate with the topologically-sorted plurality of edges; and the computing device generating a display of at least some of the set of rectangular components based on the locations of the grid lines.