batcher sorting network, n = 4
DESCRIPTION
Batcher Sorting Network, n = 4. Batcher Sorting Network, n = 8. n = 4. n = 4. sorted. sorted. Lemma 1. Any subsequence of a sorted sequence is a sorted sequence. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 1. 1. 1. sorted. Lemma 2. - PowerPoint PPT PresentationTRANSCRIPT
Batcher Sorting Network, n = 4
n = 4
n = 4
Batcher Sorting Network, n = 8
Lemma 1
Any subsequence of a sorted sequence is a sorted sequence.
00011111
00111
sorted
sorted
Lemma 2
For a sorted sequence, the number of 0’s in the even subsequence is either equal to, or one greater than, the number of 0’s in the odd subsequence.
00000111
0
0
0
1
0
0
1
1
sorted
even odd
denotes the the number of 0’s in y y
For two sorted sequences and : x x
11 OEOE xxxx
denotes the even subsequence of Ey y
denotes the odd subsequence of Oy y
Lemma 3
Lemma 3
00000111x
0
0
0
1
Ex
0
0
1
1
Ox
00011111
x
0
0
1
1
Ex
0
1
1
1
Ox
Lemma 3
1 OEO xxx
1 OEO xxx
For two sorted sequences and : x x
11 OEOE xxxx
(by Lemma 2)
(by Lemma 2)
Merge Network
0x
1x
2x
3x
0x
1x
2x
3x
sorted
sorted
Merge[4]
Merge[4]
sorted
0y
1y
2y
3y
4y
5y
6y
7y
Merge Network (pf.)
0x
1x
2x
3x
0x
1x
2x
3x
sorted
sorted
Merge[4]
Merge[4]
sorted
sorted
(by Lemma 1)
(by Lemma 1)
Merge Network (pf.)
Merge[4]
Merge[4]
sorted
sorted
Ex
Ox
Ex
Ox
OE xx OE xx and
differ by at most 1
By Lemma 3
Merge Network (pf.)
Merge[4]
Merge[4]
sorted
0y
1y
2y
3y
4y
5y
6y
7y
Ex
Ox
Ex
Ox
OE xx OE xx and
differ by at most 1
By Lemma 3
Merge Network (pf.)
Merge[4]
Merge[4]
Ex
Ox
Ex
Ox
OE xx OE xx and
differ by at most 1
By Lemma 3
0
0
1
1
0
0
0
1
0
0
0
0
0
1
1
1
Batcher Sorting Network
0x
1x
2x
3x
4x
Sort[4]
Sort[4]
0y
1y
2y
3y
4y
5y
6y
7y
5x
6x
7x
Merge[8] sorted
Merge[4]
Batcher Sorting Network, n = 4
Sort[2]
Sort[2]
Sort[4]
Sort[4]
Batcher Sorting Network, n = 8
Merge[8]
Sorting Networks
Batcher
n2log 1830depth
AKS (Chvátal)
)log1(log 2
1depth 22 nn
AKS (Ajtai, Komlós, Szemerédi) Network:),(logdepth nO based on expander graphs.
AKS better for 36592n