The document discusses methods for solving the smallest k-enclosing circle problem, which is finding the smallest circle that encloses at least k points from a set of n points. It presents two simple algorithms: 1) generating circles that pass through every pair of points, running in O(n^3 log(n)) time; and 2) generating circles hinged at each point, running in O(n^2 log(n) log(d)) time where d is the geometric span of the points. The problem has applications in facility location and military targeting.
1. Simple methods for solving Smallest k-Enclosing
Circle Problem
Anirban Mitra and Dhruv Matani
{reachnomind,dhruvbird}@gmail.com
Abstract. We discuss the problem of finding the smallet circle enclosing
K points out of a given set of N 2-Dimensional points, known as Small-
est k-Enclosing Circle Problem. The runtime complexity of the methods
discussed are O(N 3 × log(N )) and O(N 2 × log(N ) × log(d)) where d is
the geometric span of the set of points. The space complexity for both
the methods is O(n).
Keywords: Smallest k-Enclosing Circle, Minimum Disk Problem, Small-
est Enclosing Circle, Bomb Problem
1 Introduction
Now, we define the problem, known as Smallest k-Enclosing Circle Problem
Given a set S of 2D points of size N, find the smallest circle containing at
least K(2 ≤ K ≤ N ) of the points in S.
The problem has an O(N × K) expected runtime solution using randomised
algorithms [1] [2] and a deterministic solution with a runtime of O(N × K ×
log 2 N ) [3]. Here, we present simple methods to solve the problem with compa-
rable efficiency with the later. The Smallest Enclosing Circle problem [4] [5] [6],
which is a special case of the above, is the problem of finding the circle of small-
est radius enclosing all the points. There is an O(N ) time solution by Nimrod
Megiddo [8] using linear programming.
This problem belongs to shape fitting class of problems which is a funda-
mental problem in computational geometry. The problem is useful in deciding
the location of a shared facility like a university for a group of small cities. In
military this is called the Bomb Problem which is, given location of many bombs,
determine the location to drop a bomb with a certain impact radius to destroy
the maximum number of bombs.
1.1 Smallest circle pass through two or more points
There can be many candidates for the smallest circle containing K or more
points. And, all of the smallest circles will have 2 or more points on its circum-
ference [9]. Here is an argument for the same.
2. 2 Simple methods for solving Smallest k-Enclosing Circle Problem
Let us assume that we know any one of the smallest circle and the correspond-
ing set of K points. Ignore all other points for now. Start with an arbitrary large
circle containing all the K points. Now, go on shrinking the circle till one or
more of the points lie on its circumference. If there is only one point on the
circumference, then rotate the circle about the point (in either direction) till
another point lies on the circumference. So, in either cases, we end up with a
circle with two points on the circumference.
If the points on the circumference are diametrically opposite then this is the
smallest circle because any smaller circle can not contain both the points. So, in
this case the smallest circle has two points on the circumference.
Else, let L be the line segment joining the points on the circumference and
M be the perpendicular bisector as shown in Fig. 1. We further shrink the circle
by moving the centre towards L along M till either another point lies on the
circumference or the L becomes a diameter. In either case, no smaller circle
containing all the points is possible, hence it is the smallest circle and it has 2
or more points on its circumference.
M
C F
E
D
A O B L
Fig. 1. Shrinking circle to get smallest circle containing K = 4 points
Using this result, the naive solution is to draw circles for every triplet of
points on its circumference and every pair as diameter, and count the number
of points lying inside. The runtime complexity of the method is O(N 4 ).
3. Simple methods for solving Smallest k-Enclosing Circle Problem 3
2 A solution generating circles passing through two
points
We choose any two points from the set, say P and Q. Now, we find the smallest
circle passing through these two points and containing K points.
Let L be the line passing through A and B (see Fig. 2). Now consider any
third point X. We know that for the circumcircle passing through A, B, and X,
any point on the circumference (on the same side of AB) subtends an equal angle
at AB, any point outside subtends a smaller angle and points inside subtend
greater angles. We sort the points by the angles subtended at AB. Now if we
choose any point from the sorted sequence say Y , then all the points to the right
of it will also be inside the circle. To include the points from the other side of
AB too, consider any random point say M (i.e. L(M ) < 0) and
1. If AM B is equal to (180 − AXB), it lies on the circumference
2. If AM B greater than (180−AXB), it lies inside the circle, otherwise outside
C
D
F
A B
E
Fig. 2. C, D, E and F - Points sorted according to the rules presented above
To be complete, for points on L, the ones that lie between AB, the they will
always be inside and others can be ignored.
Altogether, we sort all the points and choose the optimal third point to draw
the circumcircle and calculate the radius. We repeat the same for every pair of
points and choose the optimal. For one pair of points the runtime complexity is
O(N × log(N )) and hence the overall runtime complexity is O(N 3 × log(N )).
4. 4 Simple methods for solving Smallest k-Enclosing Circle Problem
3 A solution generating circles hinged at a point
Consider all the circles of a certain radius R hinged at one of the given points
say X. The locus of centres of all such circles is a circle of radius R centered at
X, call it Circle-1. Now, consider any other point in the set, say Y and let it be
outside Circle-1. Drop line segments from Y on the circumference of the circle
(Y A and Y B as shown in the Fig. 3) such that Y A = Y B = R. The distance
of any point on arc ACB from Y is less than or equal to R. Hence, any circle
centered on arc ACB having a radius R and passing through X will contain Y .
Circle-3
B R
Y
C Circle-2
R
A
X
Circle-1: Locus of centers of circle hinged at X
Fig. 3. Both Circle-2 and Circle-3 contains Y
This is true for points in the set lying inside the Circle-1 too. So, if we can
calculate the arc intervals for all the points (other than X) in the set and find out
where maximum number of intervals overlap, we will have the maximum points
contained in a cicle of radius R and passing through X. There is a solution for
maximum interval overlap problem in O(N × log(N )) (note that the interval
5. Simple methods for solving Smallest k-Enclosing Circle Problem 5
here is circular).
– This is true for points in the set lying inside the Circle-1 too. So, if we can
calculate the arc intervals for all the points.
A dsjdf
A dsjdf
A dsjdf
A dsjdf
References
1. Matousek, J.: On enclosing k points by a circle, Inform. Process. Lett. 53, 217221,
1995
2. Har-Peled, S. and Mazumdar S.: Fast Algorithms for Computing the Smallest k-
Enclosing Circle, Algorithmca 41, 147-157, 2005
3. Efrat A., Sharir M., and Ziv A.: Computing the smallest k-enclosing circle and
related problems, Comput. Geom. Theory Appl. 4, 119136, 1994.
4. Smallest circle problem, Wikipedia - The Free Encyclopedia, http://en.
wikipedia.org/wiki/Smallest_circle_problem
5. Weisstein, Eric W.: Minimal Enclosing Circle, MathWorld–A Wolfram Web Re-
source, http://mathworld.wolfram.com/MinimalEnclosingCircle.html
6. Muhammad, R. B.: Smallest Enclosing Circle Problem, http://www.personal.
kent.edu/~rmuhamma/Compgeometry/MyCG/CG-Applets/Center/centercli.htm
7. Weisstein, Eric W.: Geometric Span, MathWorld–A Wolfram Web Resource, http:
//mathworld.wolfram.com/GeometricSpan.html
8. N. Megiddo: Linear-time algorithms for linear programming in r3 and related prob-
lems, SIAM Journal on Computing 12 (1983), 759776
9. Eliosoff, J., Unger, R.: What is the Problem?, http://www.cs.mcgill.ca/~cs507/
projects/1998/jacob/problem.html
10. H.W.E., Jung: Ueber den kleinsten Kreis, der eine ebene Figur einschliesst, J.
Reine Angew. Math. 130, pp. 310313, 1901
11. Weisstein, Eric W.: Jung’s Theorem, MathWorld–A Wolfram Web Resource,
http://mathworld.wolfram.com/JungsTheorem.html