VOOZH about

URL: https://www.geeksforgeeks.org/dsa/deleting-points-convex-hull/

⇱ Deleting points from Convex Hull - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Deleting points from Convex Hull

Last Updated : 23 Jul, 2025

Given a fixed set of points. We need to find convex hull of given set. We also need to find convex hull when a point is removed from the set.

Example: 

Initial Set of Points: (-2, 8) (-1, 2) (0, 1) (1, 0)
(-3, 0) (-1, -9) (2, -6) (3, 0)
(5, 3) (2, 5)
Initial convex hull:- (-2, 8) (-3, 0) (-1, -9) (2, -6)
(5, 3)
Point to remove from the set : (-2, 8)
Final convex hull: (2, 5) (-3, 0) (-1, -9) (2, -6) (5, 3)

Prerequisite : Convex Hull (Simple Divide and Conquer Algorithm)
The algorithm for solving the above problem is very easy. We simply check whether the point to be removed is a part of the convex hull. If it is, then we have to remove that point from the initial set and then make the convex hull again (refer Convex hull (divide and conquer) ). 

And if not then we already have the solution (the convex hull will not change). 

Output: 

convex hull:
-3 0
-1 -9
2 -6
5 3
2 5

Time Complexity:
It is simple to see that the maximum time taken per query is the time taken to construct the convex hull which is O(n*logn). So, the overall complexity is O(q*n*logn), where q is the number of points to be deleted.


Auxiliary Space: O(n), since n extra space has been taken.

This article is contributed by Aarti_Rathi and Amritya Vagmi.

Comment
Article Tags:
Article Tags: