Convex Hull (convex hull)

Source: Internet
Author: User
Given a (finite) Point Set (a group of points) on a plane, the convex hull of this point set is a convex polygon that contains the minimum area of all points in the point set.
In a two-dimensional Euclidean space, a convex bag can be imagined as a rubber circle containing just all vertices. This can be vividly thought like this: place some unmovable wooden piles on the ground, and use a rope to enclose them as tightly as possible. This is a convex bag.
For example, the point set contains nine points, and the hexagonal in the figure is the convex hull of the point set. The six points that constitute the hexagonal form are called the "hull point", and the other three points are not the "points on the convex hull ". Note the restriction "minimum area" in the above definition, because in addition to the convex hull, there are an infinite number of convex polygon containing all vertices in the vertex set. For example, a quadrilateral with a sufficient area can enclose any given point set. Therefore, without this restriction, it is very easy to find the convex hull, but there is no unique solution. In addition, the so-called convex polygon ). Intuitively, a convex polygon is a polygon without any concave position. The triangles, squares, rectangles, parallelogram, pentagons, and hexagonal shapes we learned in lower-grade mathematics are examples of convex polygon. But the "convex" shape is not a convex polygon because it has a concave position. In mathematics, convex polygon has another strict definition. Suppose we take any two points on a polygon (including the boundary and boundary range of the polygon) and link the two points with a line segment. If each point on the line segment is on the polygon, the polygon is convex.
Convex hull algorithm:

   Incremental algorithm 1Add points one by one, and then check whether the previous points are on the new convex hull. Because all previous points need to be checked each time, the time complexity is O (n2 ). Package method (Jarvis step method)The first point must start at the Convex Point, for example, the leftmost Point A1. Then select A2 so that all vertices are on the right side of a1a2. the time complexity of this step is O (n). Compare the polar coordinates of all vertices starting with A1. Repeat this step to find A_3, A_4, \ ldots, A_k, and A_1. There are K Steps in total. Therefore, the time complexity is O (n2 ). Convex Hull GE liheng Scanning MethodStarting from the lowest point A1, calculate the line between it and other points and the angle of the X axis. Sort these angles in ascending order, and their corresponding points are A_2, A_3, \ ldots, a_n. The time complexity here can reach O (nlogn ). Consider the point A3 corresponding to the smallest angle. If the path from A2 to A3 is right relative to the path from A1 to A2 (you can imagine the direction of a person walking along A1 to A2 when he is standing at A2 ), it indicates that A3 cannot be a Convex Point. Consider the path from A2 to A4; otherwise, consider whether the path from A3 to A4 is right ...... Until A1 is returned. The overall time complexity of this algorithm is O (nlogn). Note that each vertex is considered only once, unlike the Jarvis step-by-step method. This algorithm was invented by GE liheng in 1972. [1] its disadvantage is that it cannot be extended to two or more dimensions. Monotonous chainSort points by the X coordinate values and then by the Y coordinate values. Select the points whose X coordinates are the minimum. In these points, find the points whose Y coordinates are the largest and whose Y coordinates are the smallest. This is also the case when the X coordinate is the maximum value. Connect the points with smaller y coordinate values in the two groups of points. Find the point under the line segment, find the point with the largest y coordinate value among them, and find the X coordinate value between them to the smallest and largest point ...... And so on. The time complexity is O (n log n ). Divide and conquer LawDivide point set X into two non-Intersecting subsets. After obtaining the convex packets of the two, calculate the convex packets of the Two convex packets. The convex packet is the convex packet of X. The time complexity is O (n log n ). Quick Packet Method (Akl-TOUSSAINT heuristic)Select the leftmost, rightmost, rightmost, and rightmost points. They must form a convex Quadrilateral (or triangle ). The points in the Quadrilateral must not be on the convex hull. Then, divide the remaining points into four parts based on the nearest edge, and then perform the quick Packet Method (quickhull ).

Related Keywords:

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.