sorting-network
sorting-network copied to clipboard
Python script to check sorting networks and generate sorting network diagrams
While plotting a machine generated network I noticed that the order of nodes matters (for the layer assignment) while it should not AFAICT. For example 2:5,0:1,4:5,0:3 yields:  While 2:5,4:5,0:1,0:3...
Some important sorting networks (e.g. Batcher's bitonic and odd-even networks) are based on a mergesort-like algorithm: 1. Merge each element into sorted pairs: merge(0, 1), merge(2, 3), merge(4, 5), ......
First of all, thanks for the very useful script. Consider the following input, corresponding to a Batcher odd-even sorting network with n = 16: ``` 0:1,2:3,4:5,6:7,8:9,10:11,12:13,14:15 0:2,1:3,4:6,5:7,8:10,9:11,12:14,13:15 1:2,5:6,9:10,13:14 0:4,1:5,2:6,3:7,8:12,9:13,10:14,11:15 2:4,3:5,10:12,11:13...