Minimum circle cover Problem _ algorithm

Source: Internet
Author: User

Minimum circle cover Problem-a very classic question.
The topic is probably, on the plane n points, to find a circle of the smallest radius, can cover all the points.
First of all, we can start with an empty set R, and continuously add the points on the plane to R, while maintaining the minimum circumcircle of R, we can get a simple solution.
Another idea is to randomly select two dots, and use the lines of the two points to circle the diameters. The remaining points are then judged to see whether they are in the circle (or round), and if they are, the circle has been found. If not all: assuming we use the first two points as p[1],p[2], and the one found is not in the circle (or the circle) of the point is p[i], so we use this point p[i] to find cover p[1] to p[i-1 of the smallest covering circle.
To find the smallest covering circle from p[1] to p[i-1] for determining the point p[i], we can first use p[1] and p[i] to do a circle, and then from 2 to i-1 to determine whether a bit not on the circle, if all in, then you have found a circle covering 1 to i-1. If not all: Suppose we find the first point that is not on this circle is p[j], so we use two known points p[j] and P[i] to find the smallest covering circle covering 1 to j-1.

And for two known points p[j] and p[i] to the minimum covering circle, as long as from 1 to J-1, the K point P[k],p[j],p[i] three points of the circle, and then judge K+1 to j-1 whether all in the circle, if all in, the description find a circle, if there is not, then with a new point p[k] Update the circle.

The problem is then translated into a number of child problems to solve.

Since three points determine a circle, our process is generally done from no definite point, to have a certain point, then to have two definite points, then to have three points to determine the work of the circle.

On the proof of correctness and the calculation of complexity here is not introduced, you can go to see the complete algorithm introduction: http://wenku.baidu.com/view/162699d63186bceb19e8bbe6.html

Related questions 1:
There are some ships on the surface that need to communicate with the land and some base stations on the coastline. Now the problem is abstracted, at the top of X week, gives the coordinates of N ships P1,P2,..., pn,pi= (xi,yi), Xi>=0,yi<=d, 1<=i<=n, the base station in the x-axis security can cover all the points in the area of radius D, Ask at least a few dots on the x-axis to cover the points above the x axis. Try to design an algorithm to solve this problem

Design ideas:
First, all the points by the horizontal axis from small to large to sort. When the point set is not empty, each time the leftmost point is taken out, the point is treated as a point on the circumference, the point to the x-axis with a distance of D as the center of the Circle, the D as the radius, a circle is drawn, and the point contained within the circle is removed. Then continue to select a leftmost point, repeat the above operation, until the point set is empty, indicating that all points are covered, the number of circles is the answer.

Related question 2:
for the minimum rectangular area of all of these points, given the coordinates of n points on a plane.
First we consider the question of the total area covered by the n rectangles on a given plane (the coordinates are integers, and the rectangle may overlap with the rectangle). The usual idea is to open a two-dimensional boolean array of two-dimensional coordinates to simulate the rectangle's "overlay" (insert the position of the rectangle in true). Unfortunately, there are some problems with this idea, because the range of coordinates is quite large (an integer between -10^8 and 10^8). But we found that the number of rectangles is n<=100 far less than the coordinate range. Each rectangle "uses" two values (the upper and lower bounds of the rectangle) on the horizontal ordinate, and the coordinates of the 100 rectangles do not use the 200 values of -10^8 to 10^8 in the horizontal (vertical) coordinates. In other words, the actual useful value is only a few. These values will be used as the new coordinates to divide the entire plane, eliminating the middle of a number of coordinate values do not affect. We can "scatter" the coordinate range to the number from 1 to 200, so a two-dimensional array of 200*200 is sufficient. The implementation method, as described at the beginning of this article, is "sort after processing." The horizontal axis (or ordinate) is sorted and mapped to integers from 1 to 2n, at the same time records the new coordinates each two adjacent coordinates before the discretization actual distance is how much (after the discretization, in fact the entire graph space becomes smaller, this is easy to calculate, but for each line must have corresponding to the original image map, In order to calculate the correct area, the following diagram of the discrete figure in the actual length of each case is different, the actual area is also different.

The above thought is an example of discretization, it can be seen that the discretization greatly reduced the space overhead, in some difficult to deal with the problem can effectively reduce the complexity of the algorithm time, it is worth learning and reference.
Finally, these algorithms and ideas refer to a lot of technical blogs, thanks to the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.