AMS 345/CSE 355 (Fall, 2010)
Joe Mitchell
COMPUTATIONAL GEOMETRY
Homework Set # 8 – Solution Notes
(1).
[25 points]
Consider the set
S
of 7 line segments given by
S
=
{
s
0
, s
1
, . . . , s
6
}
=
{
((-1,12),(5,3)), ((7,12.5),(3,1)),
((8,11),(12.5,5)), ((4,13),(10,5.3)), ((11,8),(5,2)), ((14,15),(4,7)), ((8,14),(14,6))
}
, where each segment
s
i
= (
a
i
, b
i
)
has upper endpoint
a
i
and lower endpoint
b
i
. I draw horizontal lines through the endpoints and the intersection points
in the Fgure, to help you order the events.
5
10
15
5
10
15
1
3
4
6
5
2
0
Apply the Bentley-Ottmann sweepline algorithm to
S
. Give the event queue
Q
and the sweep status
L
just after
each event. (Use the notation as in the text that
x
ij
denotes the point (if any) at the intersection of segment
s
i
and
segment
s
j
.)
Show the chart, just as in the handout given in class. (You need not compute the actual intersection points
x
ij
.)
You may use either the “usual” Bentley-Ottmann sweep or the “modiFed” version (which removes from the event
queue those crossing events that no longer correspond to segments that are adjacent in the sweep line status (SLS)).
But please
state
which method you are using. (My solutions will show both, as on the handout, using the notation
that an entry “
[
x
ij
]
” means that the event point
x
ij
would appear in the usual algorithm but not in the modiFed
algorithm. You should understand both versions.)
I show the execution of the algorithm in the table below. I place an event point
x
ij
in square brackets (“[
x
ij
]”)
if it would not be present if we follow the modi±ed Bentley-Ottmann algorithm, which deletes crossing events from
the queue whenever the corresponding segments stop being adjacent in the sweep status (they are reinserted later,
when the segments are again adjacent).
The rightmost column shows which intersection tests are done at each event: We test is
s
i
intersects
s
j
whenever
s
i
and
s
j
become newly adjacent in the sweep status,
L
.