L12 - Convex Hull: Grahams Scan Flashcards

1
Q

What is the worst case time complexity of Jarvis March?

A

O(N^2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define the geometric property of Convex Hull that Grahams Scan is built on…

A

Convex hull can be traversed via making CCW turns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the task specification for Grahams Scan? (Problem, input, output, input-output relation)

A

Problem: Find the convex hull of S points
Input: is a set of points in multi-dimensional space
Output: is a list of H convex hull points in CCW ordering.
Input-output relation: H is the smallest convex set in S.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What was the motivation for Grahams Scan? When was it developed?

A

Grahams Scan was developed in 1972. The motive was to improve on the worst case time complexity of other convex hull algorithms such as Jarvis March. For example, Bell Labs were establishing hull for 10k points, and found the execution to be too slow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the step by step process of the algorithm…

A

Start from the left most point, find next point with smallest polar angle, if the previous, current, and next point create a CCW turn, discard the current point from the stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are the points sorted?

A

Points are sorted via Polar angle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the most computationally expensive step of the algorithm?

A

Sorting via polar angle is the most expensive step -> O(n log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the worst case time complexity? Give proof…

A

Sort by polar angle + stack operations -> O(n log n) + O(n) = O( n log n )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the polar angle of a point?

A

Polar angle is the CCW angle of a point from the X axis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the improvement that Grahams Scan makes to Jarvis March?

A

Interior elimination, which ignores points known to not be on the convex hull.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Give 3 applications of Convex Hull…

A

Robotics pathfinding, Classification (if hulls don’t overlap).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly