This is a basic problem solving technique and has proven to be very useful for geometric problems as well. This technique mainly involves partitioning of the given problem into several subproblems, recursively solving each subproblem, and then combining the solutions to each of the subproblems to obtain the final solution to the optimal problem.
We demonstrate its working by considering the problem of computing the common intersection of half planes in the plane. Given is the set of half-planes, , represented by,
(3.1) |
It is simple to understand that, common intersection of half-planes, denoted by,
(3.2) |
is a convex set, which may or may not be bounded. If it is bounded, it is convex polygon. In figure the shaded area is common intersection.
The divide and conquer algorithm computes the following steps:
|
The key step is the merge of two common intersections. Because CI() and CI() are convex, the merge step basically calls for the computation of the intersection of two convex polygons, which can be solved in time proportional to the size of the polygons. The running time of D&C algorithm is due to following recurrence formula, where .
where, denotes the merge time (step 5).