By making use of the fact that sorting $n$ numbers requires $\Omega(n \log n)$ steps for any optimal algorithm (which uses 'comparison' for sorting), how can I prove that finding the convex-hull of $n$ points is bounded by $\Omega (n \log n)$ steps?
-
1For your question see, http://en.wikipedia.org/wiki/Convex_hull_algorithms#Lower_bound_on_computational_complexity . A somehow surprising fact is that even if you choose some other model (like the quadratic decision model) the complexity is still bounded by $O(n\log{n})$ – Jernej Oct 29 '12 at 08:39
1 Answers
If you could create the convex-hull in $o(n \log n)$ time, this would imply, that you can sort $n$ numbers in $o(n\log n)$ time.
You do this with contradiction. You have $n$ numbers $(x_1, x_2, \ldots, x_n)$, which you would like to sort. From these numbers, you create points $P$ in 2D space in some fashion. For example $p_i=(x_i,x_i^2)$.
On these newly constructed points $P$ you call the algorithm for convex hull, which returns you the actual convex hull.
After that, you simultaneously traverse upper and lower hull, from the lower left-most point in (which you find in $O(n)$ time), to the upper right-most point. With this traversal you actually sort the numbers. Let $p_i$ and $p_j$ be the next points on lower and upper hull, then if $x_i<x_j$, you move one step ahead on the lower hull and add $x_i$ to the end of the sorted array (else you take one step ahead on the upper hull and add $x_j$ to the array). You then finish when the traversals meet in the upper right-most point of the convex hull.
The algorithm that I described is run in $O(n)$ time. So if the convex-hull algorithm would be $o(n\log n)$, the sorting of $n$ numbers could be also done in $o(n\log n)$ time, which is a contradiction since we know that sorting $n$ numbers takes at least $\Omega(n \log n)$ time.
-
2I am not sure choosing points in this way is safe. Putting them on a parabola $p_i = (x_i,x_i^2)$ seems safer. – Jernej Oct 29 '12 at 08:34
-
-
Odd... a problem with text formatting on stackoverflow. Everything was there, I just clicked edit and then save, and everything is here. :/ – Nejc Oct 29 '12 at 08:55
-
I think, It's better to explicitly mention $f(x)=x^2$ (the way you choose for points) causes to convex polygon. – Oct 29 '12 at 09:35
-
1I straightened out your Landau symbols -- take care! Also, "The algorithm that I described is run in $O(n)$ time." is wrong; $o(n\log n) \neq O(n)$. The greater idea seems to work, though -- if you explain why the $\Omega(n\log n)$ bound applies to this setting. As far as I can see, the algorithm you construct is not (necessarily) a comparison sort. – Raphael Oct 29 '12 at 18:57
-
It seems to me that this reduction shows that producing a representation of a convex hull as a list of points or lines in the order that they appear in the cycle is $\Omega(n \log n)$, but it's not clear to me that the convex hull problem asks for this much. Is it possible that some convex hull algorithm could produce the set of points in the hull, but in unspecified order, in $o(n \log n)$? (Similar to how you can find the smallest $k$ of $n$ numbers in $O(n)$ if you don't care about their order.) Or can the reduction be modified to fix this? – j_random_hacker Mar 11 '16 at 15:55
-
1@j_random_hacker http://infolab.stanford.edu/pub/cstr/reports/cs/tr/79/733/CS-TR-79-733.pdf – Mmmh mmh Sep 20 '17 at 05:02