Closely related to another idea by thoughtflashes is the idea of using genetic algorithms. The genetic algorithm is an algorithm that seeks to find an optimum solution to a problem. The algorithm starts with some randomly generated solutions, and proceeds by combining pairs of solutions and seeing if they give a better solution.
This iterative process continues, with less optimal solutions removed from the population, and the more optimal ones staying. This algorithm is inspired by natural selection found in nature, and can be used to solve a variety of problems. The below animation shows genetic algorithms used to find the optimal car structure to travel over some terrain.
The following animation is courtesy of http://www.qubit.devisland.net/ga/index.html