Evolving compare-exchange networks using grammars

We apply a genetic algorithm whose genotypes represent simple grammars to search for families of compare-exchange networks that are merging networks. The grammars are restricted to be of a simple form based on prior knowledge about the search domain. Finding merging networks in this fashion leads to the discovery of networks that also sort if the data is cycled through them a small number of times. Random network and grammar generation results show that the problem is difficult and suggest some conjectures about how the genetic algorithm is operating for this problem. The genetic algorithm finds the best-known network of the kind for which we search, and further finds a novel, slightly suboptimal network that turns out to be an interesting combination of ideas from known, theoretically derived networks.