Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Building a Minimal Convex Hull (kukuruku.co)
38 points by skazka16 on Dec 12, 2014 | hide | past | favorite | 17 comments


I became pretty interested in this topic not too long ago. Convex hulls are pretty well understood. I wanted to figure out a decent notion of "concave hull" (which is not a uniquely defined construct, unlike the convex hull). It turns out alpha shapes are pretty well suited to this:

http://bl.ocks.org/zpconn/11387143


I have a hard time understanding why the author go out of his/her way to rename standard definitions.

1. The definition of convex hull of a set S in the article, is the boundary of a convex set that contains all the points in S. The standard definition is the "intersection of all convex sets that contains S". Edit: Yes, this is not a good definition for the article, but there is a equivalent for finite set of points in 2D which is much better suited: "The smallest convex polygon contain all the points in S"

2. The definition of minimal convex hull in the article, in the standard terminology, is the boundary of the convex hull.

The article links to wikipedia which clearly explains what is a convex hull, but still decides to come up with new terminology. As a warning, the "convex hull" in this article is not equivalent to the "convex hull" in wikipedia(or any other textbook definitions I have seen).


I don't think the writer is really doing anything much wrong. In the Wikipedia article on the topic "convex hull" is defined as you suggest for sets in abstract, but for a finite set of points, as being the polygon (and not the interior of the polygon), which is consistent with the writer's terms and it is rather closer to both the intuitive understanding of the matter at hand and the algorithms under discussion.

It seems to me that the term "convex hull" is ambiguous, even among geometers -- sometimes meaning the set and sometimes the boundary. A hull tends to be hollow, so I'd suggest that the boundary definition is nearer normal usage and intuition. In any event, the writer defines the terms and uses them as defined.

I think the two algorithms he examines are interesting. The second is the one I first think of. The two methods are almost duals of each other. It seems to me that if you start by taking the top, left, right, and bottom points as your initial hull and then add on for any points not in that hull, it's almost certainly faster than either algorithm (especially in practice).


Of course, using the most abstract definition is not the best idea, but anything equivalent to the standard terminology is ok. For example, in 2d, we can san say the convex hull of a finite set of points is the smallest enclosing convex polygon.

The name convex hull is related to linear hull and conic hull, therefore defining it to not contain the interior is strange, but reasonable because in many applications we only care about the description of the convex hull by describing the polygon.


Well in abstract there are plenty of possible spaces where a set can be bounded but its boundary does not exist within the set (e.g. consider the transcendentals between 0 and 1) so talking about the "hull" as a boundary is completely useless. Even so, picking the word "hull" was perhaps careless.

A lot of people, even mathematicians, are confused on the definition of circle vs. sphere (the circle is the boundary, the sphere is the volume), so even if you use these terms "correctly" you probably want to define your understanding of them.


This is a pedantic complaint. In my domain, "convex hull" normally refers to the 'elastic band', which is essentially the same concept without exactly matching either definition. In fact, the Wikipedia article surely contradicts itself in this regard.

I assume the author needs terminology for both of the listed cases, and it makes sense for case 2 to be defined as a subset of case 1.

Since the author has very clearly defined the terminology, and uses it consistently in a way which makes sense and does not cause confusion, I'm not sure what the complaint is. You cannot do better than this.

There are plenty of ambiguous over-loaded terms in mathematics. See also: sin^-1, sin^2


I don't see which part the wikipedia is contradicting it self, could you point out? I see all 4 definition which are all equivalent. What is your domain? I be interested in seeing the motivation of defining convex hull that way. Because conic hull and linear hull(span) would have very strange definitions.

"Since the author has very clearly defined the terminology, and uses it consistently in a way which makes sense and does not cause confusion."

Certainly, the author clearly defined the terminology, but it is still confusing to people who already know the terminology. It would be really strange if I suddenly define "circle" to be a triangle.

"I assume the author needs terminology for both of the listed cases, and it makes sense for case 2 to be defined as a subset of case 1." I would have less problem if this is the case, but I could still suggest better ways to describe this. However, "convex hull" (and it's variation) appeared without "minimal" exactly 3 times.

1. One is express interests in convex hull, in the introduction sentence. 2. One is to define "convex hull". 3. One is to define "minimal convex hull".


>I be interested in seeing the motivation of defining convex hull that way.

For example, to computationally identify the likely boundary of something - a microscopic cell, or submicroscopic cellular component.

Perhaps you are not as knowledgeable about this field as you think. I found it rude of you to simply trash the author's article when they spent time preparing an extremely good resource - and I don't agree that your correction was useful. You did the author a disservice on that site and should consider an apology.


"For example, to computationally identify the likely boundary of something - a microscopic cell, or submicroscopic cellular component."

I still don't know which field you are from, thus I kindly request you to give me a definite reference where convex hull is defined that way. I'm cornered in the world of computational geometry, and doesn't know how other fields use the word.

In fact, I don't even know what definition you are talking about. You said 'elastic band', but do you mean the 'elastic band' that bounds the points freely and somehow still convex(which is what the "convex hull" meant in the author's article), or do you mean the tightened 'elastic band'. Thus asking for seeing this definition is important for me to even understand what you are talking about.

"Perhaps you are not as knowledgeable about this field as you think." Perhaps. This is why having definitive references help.

This is the top 5 links that contains the definition of convex hull when I searched "convex hull" in google. (These exclude the wikipedia(wikibooks) pages because I have already use them)

1. http://mathworld.wolfram.com/ConvexHull.html (The convex hull of a set of points S in n dimensions is the intersection of all convex sets containing S.)

2. http://doc.cgal.org/latest/Convex_hull_2/ (A subset S⊆ℝ^2 is convex if for any two points p and q in the set the line segment with endpoints p and q is contained in S. The convex hull of a set S is the smallest convex set containing S. )

3. http://www.cs.uu.nl/docs/vakken/ga/slides1.pdf (For any subset of the plane (set of points, rectangle, simple polygon), its convex hull is the smallest convex set that contains that subset)

4. http://www.cs.jhu.edu/~misha/Fall05/09.13.05.pdf (Given a finite set of points P={p1,…,pn}, the convex hull of P is the smallest convex set C such that P⊂C)

5. http://geomalgorithms.com/a10-_hull-1.html (The most common form of this algorithm involves determining the smallest convex set (called the "convex hull") containing a discrete set of points.)

All of the definitions are not equivalent to the authors, but equivalent(or a special case when restricted to finite set/R^2) to each other. I also have book excerpts if you really need them.

"I found it rude of you to simply trash the author's article when they spent time preparing an extremely good resource" I did not have object of their work, just particular terminology. I pointed out specific flaws in the article and constructively offered how to fix them. In fact it took out a huge amount of my time in order to come up with equivalent definition that also preserve the author's intuition. My definition is not obviously equivalent to the ones I presented above. It requires a proof, and I can only prove the case when there is only a finite number of points, which works great because that's the exact case the author is thinking about.

" - and I don't agree that your correction was useful. " If you always take convex hull of a set of point S to mean "a convex curve that bounds a set of points S" then you won't think the correction is useful because my definition doesn't equal yours.

"You did the author a disservice on that site and should consider an apology." I do not agree.


The only thing that seemed strange to me was the use of the word "minimal" in front of convex hull. I don't recall ever seeing that.


This does make sense under author's definition: convex hull is defined as the boundary of any convex set enclosing the set of points.

But in standard terminology, convex hull of a set S is the smallest convex set containing the set of points. The convex hull is always minimal because it's unique.


It actually makes sense to call it a minimal convex hull, since you can construct and envelope, or hull, for a set of points that is convex but not necessarily minimal: e.g. a large square with edges (min{xi},max{xi}) along each direction i.


I guess the problem is that the author sounds less credible saying "minimal convex hull," because that's the only type anybody cares anything about. In the computational geometry literature the phrase "convex hull" almost always implies the minimal, unique convex hull.

Using the phrase makes it sound like he googled the algorithms for half an hour and wrote up an article about it.


That's what I thought about convex hull too. Nobody would use it or implement it, if not for the minimal case.


There's also Chan's algorithm (http://en.wikipedia.org/wiki/Chan%27s_algorithm)


Output-sensitive algorithms are pretty interesting in general. Previous to Chan's algorithm there was the Kirkpatrick-Seidel algorithm (https://en.wikipedia.org/wiki/Kirkpatrick%E2%80%93Seidel_alg...), which is more complicated but runs in the same time complexity. Their paper also provides a proof of optimality.

For interested students, Dave Mount's computational geometry notes (http://www.cs.umd.edu/~mount/754/Lects/754lects.pdf) provides an excellent overview of algorithms used for most things.


Another good source for convex hull code (I was using this recently): http://marknelson.us/2007/08/22/convex/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: