The pairwise sorting network is a sorting network discovered and published by Ian Parberry in 1992 in Parallel Processing Letters. The pairwise sorting network has the same size (number of comparators) and depth as the odd–even mergesort network. At the time of publication, the network was one of several known networks with a depth of O ( log 2 n ) {\displaystyle O(\log ^{2}n)} . It requires n ( log n ) ( log n − 1 ) / 4 + n − 1 {\displaystyle n(\log n)(\log n-1)/4+n-1} comparators and has depth ( log n ) ( log n + 1 ) / 2 {\displaystyle (\log n)(\log n+1)/2} .
The sorting procedure implemented by the network is as follows (guided by the zero-one principle):