The initial layout should be read from a text file that is structured
as follows.
-
The first line gives the number of rigid objects R.
-
The second line gives the number of horizontal wires H.
-
The second line gives the number of vertical wires V.
-
The next R lines declare the rigid objects, where each line has
the form:
<object number> <lower-left X> <lower-left Y>
<upper-right X> <upper-right Y>
The object number (between 1 and R) identifies the rigid object
and is later used for the specfication of wires.
-
The next H lines declare the horizontal wires, where each line has
the form:
<horizontal wire number> <lower Y> <width>
<left rigid object> <right rigid object>
The horizontal wire number (between 1 and H) identifies the
wire.
The left boundary of the wire coincides with the right boundary
of the <left rigid object> while the right boundary coincides with
the left boundary of the <right rigid object>. The bottom boundary
is equal to <lower Y> and the top boundary is <width> units
higher.
-
The next V lines declare the vertical wires, where each line has
the form:
<vertical wire number> <left X> <width>
<bottom rigid object> <top rigid object>
The vertial wire number (between 1 and V) identifies the
wire.
The bottom boundary of the wire coincides with the top boundary
of the <bottom rigid object> while the top boundary coincides with
the bottom boundary of the <top rigid object>. The left boundary
is equal to <left X> and the right boundary is <width> units
further.
Using this syntax, a layout that is topologically close to the one
of Figure 6.4(a) in the book is described as follows:
9
5
3
1 0 0 3 3
2 4 0 7 3
3 12 0 15 3
4 8 4 11 7
5 12 4 15 7
6 0 8 3 11
7 0 12 3 15
8 4 12 7 15
9 12 12 15 15
1 2 1 1 2
2 2 1 2 3
3 4 1 4 5
4 12 1 7 8
5 12 1 8 9
1 2 1 1 6
2 12 1 3 5
3 2 1 6 7
A graphic rendering of this example layout is available in a separate
PDF document. You can assume that the input
description is consistent and do not need to check for errors (such as
for wires that connect objects outside each other's scope).