A novel method is disclosed for laying out a plurality of rectangles onto a bounding
box area, where bboxArea represents a total area of the bounding box and totalRectArea
represents the sum of the areas of all the rectangles. The method comprises the
steps of: first adjusting all rectangles to a specified aspect ratio and then computing
a sum of areas of all rectangle intersections (overlap) occurring as a result of
said arrangement. Next, the function blackArea=totalRectArea-;overlap is used to
approximate the black area and all non-overlapping spaces remaining between the
arranged rectangles are computed by: WhiteSpace=bboxArea-;blackArea. Then, for
the current arrangement, an energy function E=whiteSpace+(overlapPenlalty * overlap)
is calculated and for each energy function, a state probability function is calculated
such that: Pr=exp(-;(Enew-;Eold)/kT), where Eold
is the energy computed for the previously accepted state, Enew is the
energy calculated for the current state, T is a control parameter from T0-;Tend,
and k is a constant. Typically, initial value of T0=100 and Tend=0.0
and the overlapPenalty has an initial value of 100. The value for the control parameter
T is subsequently lowered by a fraction of its present value using the relationship:
TN+1=TN* 0.95. A random number between 0 . . 1 is then selected
and if the random number is less than the value of Pr then the new state Enew
is accepted thus new states are always accepted where Enew is
less than Eold. The rectangles are again randomly arranged on the bounding
box area and the method repeats itself until either Tend is reached
or the value of Pr is within acceptable limits.