Example Classes
We used the following example classes for comparing different
implementations of a rectangle intersection algorithm. These
benchmarks have also been used to analyse the quality of a map labeling
algorithm experimentally [WW98].
RandomRect
We choose n points uniformly distributed in a square of size
25n × 25n. Each point corresponds to the lower
left corner of a rectangle. To determine the size of each rectangle,
we choose the length of both edges independently under normal
distribution, take its absolute value and add 1 to avoid non-positive
values. Finally we multiply both rectangle dimensions by 10.
DenseRect
Here we try to place as many rectangles as possible on an area of size
alpha sqrt(n) ×
alpha sqrt(n). alpha is a
factor chosen such that the number of successfully placed rectangles
is approximately n, the number of sites asked for. We do this
by randomly selecting the rectangle size as above and then trying to place
the rectangle 50 times. If we don't manage, we select a new rectangle size
and repeat the procedure. If none of 20 different sized rectangles could
be placed, we assume that the area is well covered, and stop. For
each rectangle we placed successfully, we return its height and width
and a corner picked at random.
RandomMap and DenseMap
These example classes try to imitate a real map using the same point
placement methods as RandomRect and DenseRect, but more realistic
rectangle sizes. We assume a distribution of 1:5:25 of cities, towns
and villages. After randomly choosing one of these three classes
according to the assumed distribution, we set the rectangle height to
12, 10 or 8 points accordingly. The length of the rectangle text then
follows the distribution of a set of German Railway
station names. We assume a typewriter font and set the rectangle
length to the number of characters times the font size times 2/3. The
multiplicative factor reflects the ratio of character width to height.
VariableDensity
This example class is used in the experimental map labeling paper by
Christensen et al. [CMS95].
There, the points are distributed uniformly on a rectangle of size
792 × 612. All rectangles are of equal size, namely
30 × 7.
HardGrid
In principle we use the same method as for Dense, that is, trying to
place as many rectangles as possible into a given area. In order to do
so, we use a grid of floor(beta sqrt(n))
× ceil(beta sqrt(n)) cells with edge
lengths n. Again, beta is a factor chosen
such that the number of successfully placed squares is approximately
n. In a random order, we try to place a square of edge length
n into each of the cells. This is done by randomly choosing a
point within the cell and putting the lower left corner of the square
on it. If it overlaps any of the squares placed before, we repeat at
most 10 times before we turn to the next cell. Finally, we choose a
random corner of the square we placed and use that as the lower left
corner of the square we return.
RegularGrid
We use a grid of floor(sqrt(n)) × ceil(sqrt(n))
squares. For each cell, we randomly choose a corner and place a point
with a small constant offset near the chosen corner. On this point,
we place a square with an edge length of grid cell size minus the
offset.
MunichDrillholes
The municipal authorities of Munich provided us with the coordinates
of roughly 19,400 ground water drillholes within a 10 by 10 kilometer
square centered approximately on the city center. From these sites,
we randomly pick a center point and then extract a given number of
sites closest to the center point according to the
maximum norm. Thus we get a rectangular section
of the map. Its size depends on the number of points asked for. The
drillhole labels are abbreviations of fixed length. By scaling the
x-coordinates, we make these rectangular labels into squares and
subsequently apply an exact solver for label size maximisation. The
label size determined in this way is the size of the squares we
return. We place them with their lower left corner on the scaled
drillholes.