<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" 
               "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
  <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="../../../comsci/css/s011.css"/>
<link rel='SHORTCUT ICON' href='../../../comsci/images/FrameHome.ico' />
<style type="text/css">
</style>
<title> Convex Hull Algorithms
 </title>
</head>
<body>

<div class="message_right">
  <a href="http://validator.w3.org/check/referer">
    <img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid
	XHTML 1.1!" height="31" width="88" />
  </a>

  <a href="http://jigsaw.w3.org/css-validator/">
    <img style="width:88px;height:31px"
       src="http://jigsaw.w3.org/css-validator/images/vcss" 
       alt="Valid CSS!" />
  </a>
  <br/>
  Created 2005-06-24 &nbsp; Modified 
<!--UPDATE_DATE_MODIFIED-->
<!--UPDATE_DATE_BEGIN-->
2007-01-01
<br/>
<a href="mailto:chelton.evans@yahoo.com">Chelton Evans</a>
<!--UPDATE_DATE_END-->
</div>


<h1> 
<a href="geom.html"> <img alt="proj" src="../../../comsci/images/compgeom.png" /></a>
Convex Hull Algorithms
<a href="../../../../index.html">
<img alt="home" src="../../../comsci/images/Frame.gif" /> </a>
</h1>

<p>
<a href="#Divide_and_Conquer">
  Divide and Conquer</a><br/>
<a href="#Algorithm">Algorithm</a><br/>
<a href="#Discussion">Discussion</a><br/>
<a href="#Sublinear_Time">Sublinear Time</a><br/>
<a href="#Point_Deletion">Point Deletion</a><br/>



<a href="#References">References</a>
</p>

<div class="float25">
<a id="Divide_and_Conquer"></a>
<h2>Divide and Conquer</h2>

<p class="equ">
<math xmlns="&mathml;">
  <mi>hull</mi>
  <mo>(</mo>
  <mi>s</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>hull</mi>
  <mo>(</mo>
  <mi>hull</mi>
  <mo>(</mo>
  <mi>a</mi>
  <mo>)</mo>
  <mo>&cup;</mo>
  <mi>hull</mi>
  <mo>(</mo>
  <mi>b</mi>
  <mo>)</mo>
  <mo>)</mo>
</math>
<br/>

<math xmlns="&mathml;">
  <mi>s</mi>
  <mo>=</mo>
  <mi>a</mi>
  <mo>+</mo>
  <mi>b</mi>
</math>

</p>

<p> The hull can be formed by divide-and-conquer.
</p>

</div>




<div class="float25">
<h2>Algorithm</h2>

<p class="alg0">
Partition s into two sets of points a and b as equally
 as possible.
</p>

<p class="alg0">
Recursively find the convex hulls of a and b.
</p>

<p class="alg0">
Merge the two hulls together to from hull(s).
</p>

</div>

<div class="spacer" />

<div class="float25">
<a id="Discussion"></a>
<h2>Discussion</h2>

<p>Shamos[1] described algorithms and variations, some of which
 related to angle sorting which is a pain.
</p>

<p>
However Shamos described merging of two convex hulls.
 He referred to the property that the hull is actually
 already sorted in an angular sense because it is convex.
</p>

<p>
I would like to point out that this is not only an angle
 property. You can transverse the boundary. If two convex
 objects intersect the intersection is inside.  
</p>

<p>
The transversal goes from visibility to the intersection
 where the other boundary is not visible. Continuing the
 iteration until the other intersection is reached and
 the other convex object is again visible.
</p>

<p>
The point is that the "order" property is not restricted
 to angles, but boundary transversal too.  Since Shamos
 referred to algorithms that were built using the angle
 perspective, it should be clear that these could have
 equally been built using boundary transversal instead.
</p>

<h3>Quick-Hull</h3>

<p>Comparing the basic divide-and-conquer of hulls
 and merge with quick-hull you will notice that
 its worst case is 

<math xmlns="&mathml;">
  <mi>O</mi>
  <mo>(</mo>
  <mi>n</mi>
  <mi>log</mi>
  <mi>n</mi>
  <mo>)</mo>
</math>

  because it evenly divides the set in two before 
 rejoining. Since quickhull has no guarantee of set 
 division its complexity in the worst case is quadratic.
</p>

</div>

<div class="float25">
<a id="Sublinear_Time"></a>
<h2>Sublinear Time</h2>

<p>
If the convex hull merge can be done in
 sublinear time then every things cosha.
</p>


<p class="equ">
<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>(</mo>
  <mi>n</mi>
  <mo>)</mo>
  <mo>&leq;</mo>
  <mi>O</mi>
  <mo>(</mo>
  <mi>n</mi>
  <msup>
    <mi></mi>
    <mrow><mi>p</mi></mrow>
  </msup>
  <mo>)</mo>
  <mo>+</mo>
  <mi>2</mi>
  <mi>t</mi>
  <mo>(</mo>
  <mfrac>
    <mrow><mi>n</mi></mrow>
    <mrow><mi>2</mi></mrow>
  </mfrac>
  <mo>)</mo>
</math>
,
 &nbsp; &nbsp;

<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>&lt;</mo>
  <mi>1</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>(</mo>
  <mi>n</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>O</mi>
  <mo>(</mo>
  <mi>n</mi>
  <mo>)</mo>
</math>

</p>

<p>
I suggest keeping not just the hull but the tessellation.
 So a transversal through the tessellations a and b
 could be used to find and merge two convex hulls.
</p>


<a id="Point_Deletion"></a>
<h2>Point Deletion</h2>

<p>
Another strategy is to use point deletion.
Maintain a mesh with the hull points only.
 I suggest a balanced mesh approach.
See <a href="g028.xml#Convex_Meshes_with_Hull_or_Boundary_Points_Only">
Convex Meshes with Hull or Boundary Points Only</a>.
</p>

<p> 
A really ambitious strategy is to use an on line  
<a href="g033.xml#Inclusion_in_a_Convex_Polygon">
 Inclusion in a Convex Polygon</a> algorithm
 for constant time where the function is adaptive.
 As new points are added the function is updated to
 reflect the change.  It inserts the new entry and
 as all the entries are already sorted, all higher 
 entries have their indexes added by one.
 I imagine this to be a really big job as I would
 guess to start looking at approximations, the 
 heavy side function and how a function could be
 altered to do this.
</p>

<p>If such a function could be built it would
 have dramatic impact on the problem giving constant
 access time.
</p>
 
<p>
Its beauty is that it 
 breaks the  
<math xmlns="&mathml;">
  <mi>O</mi>
  <mo>(</mo>
  <mi>n</mi>
  <mi>log</mi>
  <mi>n</mi>
  <mo>)</mo>
</math>
 theoretical restriction. By exploiting a finite process,
 so the function will only be valid for some finite
 number of points. Still this is powerful stuff
 as its not easy to break the barrier.
</p>

</div>


<div class="float25">
<a id="References"></a>
<h2>References</h2>


<ol>
<li>
Shamos M I (1978). Computational Geometry.  Dissertation for PhD.
</li>


</ol>


</div>


</body>
</html>


