190 likes | 319 Views
Comparator. outputs. inputs. min( x, y ). x. max( x, y ). y. Balancer. outputs. inputs. x. y. Balancer. outputs. inputs. 7. 4. 2. 5. 0. 1. 1. 1. 3. 2. 2. 2. width n. 1. 2. 2. 2. 3. 2. 2. 2. depth d. Balancing Network. for any. smooth property:. Balancing
E N D
Comparator outputs inputs min(x, y) x max(x, y) y
Balancer outputs inputs x y
Balancer outputs inputs 7 4 2 5
0 1 1 1 3 2 2 2 width n 1 2 2 2 3 2 2 2 depth d Balancing Network
for any smooth property: . . . . Balancing Network . . Smooth Sequences
for any smooth property: . . . Smooth Sequences 3 4 3 Balancing Network 3 3 4 3 3
step property: for any . . . . . . Step Sequences Balancing Network
step property: for any . . . Step Sequences 3 3 3 Balancing Network 3 4 4 4 4
. . . . . . for any Counting Network Balancing network with step output sequences: Counting Network for all inputs
? . . . . Balancing Network Comparison Network . . . . . . . . Sorting vs. Counting Counts Sorts isomorphic
? . . . . . . . . . . . . Sorting vs. Counting Counts Sorts Balancing Network Comparison Network isomorphic
? . . . . . . . . . . . . Sorting vs. Counting Counts Sorts Balancing Network Comparison Network isomorphic
Sorting vs. Counting Theorem If a balancing network counts, then its isomorphic comparison network sorts, but not vice-versa.
min(x, y) x x max(x, y) y y comparator balancer Sorting vs. Counting Counts Sorts • By 0/1 principle, we need only consider 0/1 inputs.
Sorting vs. Counting Counts Sorts • By 0/1 principle, we need only consider 0/1 inputs. • A step sequence of 0’s and 1’s is a sorted sequence of 0’s and 1’s. 1 0 1 0 0 1 0 1 comparator balancer
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 Sorting vs. Counting Sorts Counts Insertion Sort: a network which sorts but doesn’tcount.
32 16 16 12 12 10 10 8 0 16 8 12 8 10 7 9 0 0 8 4 8 5 8 8 0 0 0 4 2 5 5 5 0 0 0 0 2 2 2 2 Sorting vs. Counting Sorts Counts