How can I construct a sorting network for $k$ numbers?
My goal is to implement sorting networks in Java for $k$ in the range $[3,\hspace{-0.03 in}32]$.
To be even more specific, I only want to sort integers.
I found some implementation in this article (pages 2-3), but I don't understand it.
I been trying to convert this problem to SAT. I started with a simple non-optimal network: $[01, 12, \ldots, (n-1)n, 01, 12, \ldots, (n-2)(n-1), \ldots, 01, 12, 01]$ (source). The idea is to convert it to SAT, find the shortest equal-satisfiable SAT formula, and convert it back to a network representation. The problem is that in the network, the order of comparisons is important, so I don't know hot to convert it to SAT. It sounds like some one has already been trying to do something like this, but I don't understand it completely.