Programming Project1
Programming Project1
Empirical Analysis
Both analyses observe the number of operations executed compared to the input size. The input size represents the
number of points (x,y) in 2D space. The approximations are based on the shape/curve of the lines produced from the
number of points searched in relation to the number of operations executed.
25000000000
Operations
20000000000
15000000000
10000000000
5000000000
0
0 20000 40000 60000 80000 100000 120000
Elements (points)
These results would indicate that this implementation of the brute force algorithm is closer to an exponential order of
growth which is much slower than the expected quadratic order of growth. Implementation of the algorithm is a large
culprit of the slow down. This implementation is not stable as it will continue to check line segments (point 1 to point 2)
multiple time before searching a new segment. As such, this implementation not only searches every possible
combination of points, but it searches twice. Such repetitive operations result in an increase in the number of basic
operations executed to find the convex hull. This algorithm tries to reduce the number of calculations for the input set
by checking where a point lies relative to the current line segment by skipping points that are the same on either end of
the line segment. It also checks if a single point is found Is not found on the same side. If there is not one the algorithm
stops.
QuickHull Analysis
800000
Operations
600000
400000
200000
0
0 10000 20000 30000 40000 50000 60000
Elements (points)
These results display a similar decrease in the number of operations executed relative to the input size as was shown in
the brute force search algorithm. However, it is notable that thus algorithm requires significantly less operations to find
the convex hull because this implementation splits the search area in half each iteration instead of searching every
possible combination of points. Although the order of growth was still much much greater than what was expected
(expected O(nlogn)—actual O(n2)), it has been shown that Quickhull is a better implementation for determining the
convex hull of a set of points than that of the brute force implementation.
Visualization of Brute Force Search for Convex Hull Link
https://youtu.be/ep-FX31CpfM