In the research on sorting networks, two parameters are typically of interest: The number of comparators required and the depth required. They have practical implications for throughput and latency. Results in latter category are usually easier to achieve than corresponding results in the former. Already in 1989, Parberry demonstrated that the optimal depth for nine-input and ten-input sorting networks is seven:
Ian Parberry. "A computer assisted optimal depth lower bound for sorting networks with nine inputs." In Proceedings of the 1989 ACM/IEEE Conference on Supercomputing, November 1989, pp.152-161
Not until 2014 was it shown by Codish et. al. that the optimal number of comparators for nine-input sorting networks is 25, while the optimal number of comparators for ten-input sorting networks is 29:
Michael Codish, Luís Cruz-Filipe, Michael Frank, and Peter Schneider-Kamp. "Twenty-five comparators is optimal when sorting nine inputs (and twenty-nine for ten)." In Proceedings 26th IEEE International Conference on Tools with Artificial Intelligence, November 2014, pp. 186-193
In general, sorting networks of optimal depth cannot necessarily be achieved by using the optimal number of comparators. Knuth (TAOCP, Vol. 3, 2nd ed.) states that often "one or two extra comparator modules" are required, and shows (Fig. 51) a ten-input sorting network of optimal depth seven that requires 31 comparators, that is, two more than optimal.
In a multi-hour search of the literature and the internet at large, I have been unable to find a worked-out example of a nine-input sorting network of depth seven, nor have I been able to find information on the minimum number of comparators needed to construct such network. I am currently unable to construct any nine-input sorting networks of optimal depth with my home-grown software.
What nine-input sorting networks of depth seven are known? Following Knuth, they should require no more than 26 or 27 comparators.
structurally equivalent to those found in Knuth
. $\endgroup$SWAP (0, 7); SWAP (1, 6); SWAP (2, 5); SWAP (3, 4); /*1*/ SWAP (0, 3); SWAP (4, 7); SWAP (1, 2); SWAP (6, 8); /*2*/ SWAP (0, 1); SWAP (2, 6); SWAP (3, 4); SWAP (5, 8); /*3*/ SWAP (1, 2); SWAP (3, 5); SWAP (7, 8); SWAP (4, 6); /*4*/ SWAP (1, 3); SWAP (5, 7); SWAP (2, 4); /*5*/ SWAP (0, 1); SWAP (2, 3); SWAP (4, 5); SWAP (6, 7); /*6*/ SWAP (3, 4); SWAP (5, 6); /* depth=7 */
$\endgroup$