On Varying Perspectives of Problem Decomposition - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

On Varying Perspectives of Problem Decomposition

Description:

Coarse-grain counting: Count # of representatives of each sub-range in the input. ... 3. Fine-grain counting: If there is, zoom' into it. Range Decomposition ... – PowerPoint PPT presentation

Number of Views:590
Avg rating:3.0/5.0
Slides: 17
Provided by: tau1
Category:

less

Transcript and Presenter's Notes

Title: On Varying Perspectives of Problem Decomposition


1
On Varying Perspectivesof Problem Decomposition
  • David Ginat
  • Tel-Aviv University
  • February 2002

2
Majority in a Large Set
  • N integers
  • N may be very large
  • The range of integers is large
  • Is there an integer that appears more then N/2
    times?
  • 7 8 3 3 7 3 3 22 3
  • - Cannot keep a counter for each possible integer
    value
  • - Sorting will be very inefficient

3
Range Decomposition
  • Quick-Sort array partitioning
  • dynamic partitioning, relative to the
    pivot value
  • Here, we may fix the partition a-priori, by
    possible values
  • Range-partitioning,
  • into equal-size sub-ranges
  • 0..100, 101.. 200, 201.. 300,

4
Range Decomposition
  • If majority element then majority
    sub-range
  • 17 18 3 3 17 3 3 22 3
  • Coarse-grain counting Count of
    representatives of each sub-range in the input.
  • 2. Is there a majority sub-range?
  • 3. Fine-grain counting If there is, zoom
    into it.

5
Range Decomposition
  • Two-stage counting
  • Array of counters for each stage
  • Optimal array size?
  • R the range of integers
  • K sub-ranges
  • R/K values in each sub-range
  • Optimal value for minimizing both K and R/K?
    ?R

6
Range Decomposition
  • Coarse-Grain Fine-Grain
  • - B-Trees
  • Skip-Lists Pugh 1990
  • Distributed mutual exclusion scheme Maekawa
    1985 - message complexity of O(?N)

7
Element Decomposition
  • Bucket-Sort element partitioning into atomic
    (digit) components
  • Here, we may partition in the same way atomic
    components may be bits
  • 011 101 110 101 101
  • 3 5 6 5 5

8
Element Decomposition
  • If majority element then for each
    bit Bi of the majority element, its value will
    dominate the Bi-th bit values across the input
  • 011 101 110 101 101
  • 3 5 6 5 5

9
Element Decomposition
  • Zi the number of times 0 appears in bit i
  • 3 5 6 5 5
  • 011 101 110 101 101
  • Z01, Z13, Z21
  • 3 5 6 5 5 4
  • 011 101 110 101 101 100
  • Z02, Z14, Z21

10
Element Decomposition
  • Compute the Zi values across the input, in one
    input scan.
  • Is there a majority candidate?
  • If there is a candidate, then count its number of
    appearances in the input.

11
Element Decomposition
  • Partitioning and processing by atomic components
  • Orthogonal processing across the input
  • The N-th power of a number
  • De-Bruijn sequences Euler circuits
  • Hypercube paths
  • Bucket-Sort, Radix-Sort

12
Inductive Decomposition
  • Insertion-Sort reduce problem instances
    inductively
  • Here, we may examine what we can gain by
    eliminating input elements inductively
  • 3 5 6 5 5 7 5
  • 4 3 5 6 5 5 5 7

13
Inductive Decomposition
  • If two input elements X, Y are different and X is
    majority then X will remain majority after
    removing both
  • K/N lt K-1/N-2 e.g., 6/10 lt 5/8
  • Boyer Moore 1980
  • Variables Candidate, Counter
  • 3 3 5 5 5 7 5 7 5

14
Inductive Decomposition
  • Eliminate pairs of different elements, in one
    input scan.
  • Is there a majority candidate?
  • If there is a candidate, then count its number of
    appearances in the input.

15
Inductive Decomposition
  • Inductive processing
  • Mutual cancellation
  • Many algorithms are designed inductively e.g.,
    Manber 1988 - Greedy algorithms
  • Elections with two candidates
  • Extension Misra Gries 1982

16
Variety of Perspectives
  • Case study
  • Diverse decompositions
  • Underlying mathematical patterns
  • Space-Efficiency improvements O(R) ?
    O(?R) ? O(log R) ? O(1)
  • Relation to sorting schemes
  • Binary representation, induction, various
    counting schemes, two-stage processing
Write a Comment
User Comments (0)
About PowerShow.com