Question: 3 Divide and Conquer Approach for Convex Hull 3 . 0 . 1 Splitting the Set of Points Problem 7 . Split a given set

3 Divide and Conquer Approach for Convex Hull
3.0.1 Splitting the Set of Points
Problem 7. Split a given set of points \(\{(0,0),(1,1),(2,2),(1,0),(2,1)\}\) into two subsets by a vertical line. Some considerations when you are splitting:
1. Avoid Collinearity: Ensure the line doesn't overlap any points you want to separate.
2. Subset Sizes: Decide if you want equal-sized subsets or if different sizes are acceptable.
3. Boundary Conditions: Determine whether points on the line belong to the left or right subset.
[5 marks]
Solution.
Problem 8. Why is it necessary to divide the points with respect to the median and not the mean? [4 marks]
Solution.
3.0.2 Merging the Convex Hulls
Definition 2(The Upper Tangent). The upper tangent between two convex hulls is the line segment that touches both hulls at exactly one point each and lies above all other points in both hulls.
Definition 3(The Lower Tangent). Similarly, the lower tangent is the line segment that touches both hulls at exactly one point each and lies below all other points in both hulls.
Problem 9. Given the following code to merge convex hulls including the code for the upper tangent, write the code finding the lower tangent. [8 marks]```
Algorithm 1 Convex Hull Merging Process
Input: Two convex hulls, Hull_A and Hull_B
Output: Merged convex hull
procedure FindUppertangent(Hull_A, Hull_B)
Set i = index of the rightmost point of Hull_A
Set j = index of the leftmost point of Hull_B
while line segment (Hull_A[i],Hull_B[j]) is not an upper tangent do
if not an upper tangent for Hull_A then
Move i counterclockwise in Hull_A
else if not an upper tangent for Hull_B then
Move j clockwise in Hull_B
return (Hull_A[i],Hull_B[j]) as the upper tangent
procedure FindLOWERTANgEnt(Hull_A, Hull_B)
procedure MErgeHulls(Hull_A, Hull_B)
upperTangent \leftarrow FindUpPERTAngEnT(Hull_A, Hull_B)
lowerTangent }\leftarrow\mathrm{ FindLOWERTAngEnt(Hull_A, Hull_B)
Initialize an empty list for the merged hull
Traverse points from upperTangent to lowerTangent on Hull_A
Traverse points from upperTangent to lowerTangent on Hull_B
return the merged convex hull
```
Solution.
Problem 10. Given the points \((1,1),(2,3),(3,2),(5,4),(6,1)\), and \((7,3)\), find the upper and lower tangents between the convex hulls of the sets \(\{(1,1),(2,3),(3,2)\}\) and \(\{(5,4),(6,1),(7,3)\}\). For finding the lower tangent, use the algorithm you wrote for the previous question. [10 marks]
Solution.
Problem 11. Merge the convex hulls \(\{(0,0),(1,0),(1,1)\}\) and \(\{(2,1),(2,2)\}\) using the algorithm mentioned above. [10 marks]
Solution.
Problem 12. Why not select the highest point for the upper tangent and the lowest points for the lower tangent? Why use the mentioned algorithm? [5 marks]
Solution.
Problem 13. Explain why the merging step in the divide and conquer algorithm takes \( O(n)\) time. [3 marks]
Solution. 3.1 Divide and Conquer Algorithm
3.1.1 Time Complexity Analysis
Problem 14. Explain the time complexity of the divide and conquer convex hull algorithm. Break down the time complexity for each step, including:
- Dividing the points into two subsets,
- Recursively solving the convex hull for each subset, and
- Merging the two convex hulls.
[10 marks]
Solution.
Problem 15. Given the recurrence relation for the divide and conquer convex hull algorithm:
\[
T(n)=2 T\left(\frac{n}{2}\right)+O(n)
\]
Solve this recurrence relation using the Master Theorem to determine the overall time complexity of the algorithm. [10 marks]
Solution.
3 Divide and Conquer Approach for Convex Hull 3 .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!