upper tree, but the claim is that their absence cannot increase the complexity of this operation, only
decrease it. However, a careful proof needs to take this into account.) Since the zone of each line in
the arrangement has complexity
O
(
n
), all
n
zones have total complexity
O
(
n
2
). Thus, the total time
spent in updating the UHT and LHT trees is
O
(
n
2
).
Lecture 28: HamSandwich Cuts
Ham Sandwich Cuts of Linearly Separated Point Sets:
In this short lecture, we consider an appli
cation of duality and arrangements, namely computing a HamSandwich cut of two linearly separable
point sets.
We are given
n
red points
A
, and
m
blue points
B
, and we want to compute a single
line that simultaneously bisects both sets. If the cardinality of either set is odd, then the line passes
through one of the points of the set (see Fig. 147(a)). It is a wellknown theorem from mathematics
Lecture Notes
155
CMSC 754
that such a simultaneous bisector exists for any pair of sets (even for shapes, where bisection is in
terms of area).
(a)
(b)
∈
A
∈
B
Fig. 147: Ham sandwich cuts (a) general and (b) linearlyseparable.
This problem can be solved in
O
(
n
2
) time through the use of duality and line arrangements, but we
will consider a restricted version that can be solved much faster.
In particular, let us assume that
the two sets can be separated by a line (see Fig. 147(b)). We may assume that the points have been
translated and rotated so the separating line is the
y
axis. Thus all the red points (set
A
) have positive
x
coordinates, and all the blue points (set
B
) have negative
x
coordinates. As long as we are simplifying
things, let’s make one last simplification, that both sets have an odd number of points. This is not
difficult to get around, but makes the pictures a little easier to understand.
HamSandwich Cuts in the Dual:
Consider one of the sets, say
A
. Observe that for each slope there
exists one way to bisect the points. In particular, if we start a line with this slope at positive infinity,
so that all the points lie beneath it, and drop in downwards, eventually we will arrive at a unique
placement where there are exactly (
n

1)
/
2 points above the line, one point lying on the line, and
(
n

1)
/
2 points below the line (assuming no two points share this slope). This line is called the
median
line
for this slope.
What is the dual of this median line?
Suppose that we dualize the points using the standard dual
transformation, where a point
p
= (
p
a
, p
b
) is mapped to the line
p
*
:
y
=
p
a
x

p
b
. We obtain
n
lines in
the plane. By starting a line with a given slope above the points and translating it downwards, in the
dual plane we moving a point from
∞
upwards in a vertical line. Each time the line passes a point
in the primal plane, the vertically moving point crosses a line in the dual plane. When the translating
line hits the median point (see Fig. 148(a)), in the dual plane the moving point will hit a dual line such
that there are exactly (
n

1)
/
2 dual lines above this point and (
n

1)
/
2 dual lines below this point
(see Fig. 148(b)). We define a point to be at
level
k
,
L
k