Presentation is loading. Please wait.

Presentation is loading. Please wait.

Divide-and-Conquer Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, June 25, 2012 slides4.ppt. 4.1.

Similar presentations


Presentation on theme: "Divide-and-Conquer Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, June 25, 2012 slides4.ppt. 4.1."— Presentation transcript:

1 Divide-and-Conquer Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, June 25, 2012 slides4.ppt. 4.1

2 Divide and Conquer Characterized by dividing problem into sub-problems of same form as larger problem. Further divisions into still smaller sub-problems, usually done by recursion. Creates a tree. Recursive divide and conquer amenable to parallelization because separate processes can be used for divided parts. Also usually data becomes naturally localized. Partitioning Partitioning simply divides the problem into parts and then compute the parts and combine results – workpool pattern probably best for this. 4.2

3 Divide and Conquer Examples Sorting - Several sorting algorithms can often be partitioned or constructed in a recursive divide and conquer fashion, e.g. Mergesort, Quicksort, Searching algorithms dividing search space recursively Numerical integration 4.3

4 Numerical Integration Computing the “area under the curve.” Parallelized by divided area into smaller areas (partitioning). Can also apply divide and conquer -- repeatedly divide the areas recursively. 4.4

5 Numerical integration using rectangles Each region calculated using an approximation given by rectangles: Aligning the rectangles: 4.5

6 Numerical integration using trapezoidal method May not be better! 4.6

7 Applying Recursive Divide and Conquer Adaptive Quadrature Solution adapts to shape of curve. Use three areas, A, B, and C. Computation terminated when largest of A and B sufficiently close to sum of remain two areas. 4.7

8 Adaptive quadrature with false termination. Some care might be needed in choosing when to terminate. Might cause us to terminate early, as two large regions are the same (i.e., C = 0). 4.8

9 Seeds Divide and Conquer pattern Not fully implemented/tested yet? Questions 4.9


Download ppt "Divide-and-Conquer Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, June 25, 2012 slides4.ppt. 4.1."

Similar presentations


Ads by Google