1.02k likes | 1.05k Views
Learn about the construction of Bitonic Sorting Networks and Counting Networks, including recursive sorting, merging networks, and token-balancing techniques.
E N D
Sorting 4 10 9 9 3 8 1 7 4 2 3 10 2 8 1 7
Sorting Network (Bitonic Sorting Network)
Sorting Network (Bitonic Sorting Network)
Comparator max(x,y) x min(x,y) y
Comparator max 1 9 9 1 min
Comparator max 100 100 4 4 min
Levels 1 2 3 Width = 4 Depth = 3
1 8 2 5
8 1 5 2 Level 1
8 5 1 2 Level 2
8 5 2 1 Level 3
Input Output 1 8 8 5 2 2 5 1
Input Output 4 10 9 9 3 8 1 7 2 4 10 3 8 2 7 1
levels 2 1 3 4 5 6 4 10 9 9 3 8 1 7 2 4 10 3 8 2 7 1
Recursive construction of Bitonic Sorting Network Sort(n) Sort(n/2) In Merge(n) Out Sort(n/2) depth
Recursive construction of merging network Merge(n) Merge(n/2) Merge(n/2) depth
Induction Basis Sort(2) Merge(2)
Width Sorting network depth: Merger width Total depth
The Counting Problem 0 Shared variable
Token = Increment request 0 Shared variable
Increment request 0 1 Shared variable
1 Shared variable
Increment request 1 Shared variable
Increment request 1 2 Shared variable
2 Shared variable
Increment request 2 Shared variable
Increment request 2 3 Shared variable
Sequential Bottleneck 2 3 1 4 0 5 6 Shared variable The requests have to be serialized
Counting Network Outputs Inputs
Balancer Token Outputs Inputs
Balancer Outputs Inputs
Balancer All tokens together
Balancer Step property
Balancer Step property Another example
Balancer Step property Another example
Balancer Step property Another example
Counting Network (Bitonic Counting Network)