Optimizing Inefficiency: the quest for the worst sorting algorithm
Codified by 18th-century Austrian composer Johann Joseph Fux (among others), species counterpoint is a set of strict rules governing how musical notes should move with respect to one another (this was long before modern chord symbols were developed). For hundreds of years, music students learned to do counterpoint in more or less this way, basically trying a series of notes, checking to see if they violate any rule of the species, and then erasing back to an earlier point whenever they got stuck. Hiller and Isaacson used a stochastic approach in which their software found only a single solution to a contrapuntal problem meeting certain minimum requirements, but more recent research has improved on this method with decision tree pruning and best-first search which exploits the fact that certain species counterpoint rules are more restrictive than others.
Source: medium.freecodecamp.org