Wednesday, April 27, 2011

Genetic Algorithms, Combinatorially

I've been thinking about the combinatorial structure of Genetic Algorithms. I've decided to completely ignore the whole probabilistic thing and just describe it as a series of functions between combinatorial species, hoping that setting it in some suitable category will recover the stochastic part (perhaps a state monad-like thing?).

A normal, bit vectored population, can be described by (2^n)^m, where n is the size of the individuals, and m the size of the population. This is of course isomorphic to 2^(n*m), but I like to think of the m -> n -> 2 form.

Point mutation is a function 2 -> 2, lifted twice to (2^n)^m -> (2^n)^m.

Crossover is (2^n)x(2^n) -> (2^n)x(2^n) lifted and composed with a function (2^n)^m -> ((2^n)x(2^n))^(m/2) that pairs up individuals.

Selection is ultimately a function (2^n)^m -> (2^n)^m, but it should be composed of a lifted function R> that pairs individuals with their fitness, giving the structure ((2^n)xR)^m and a selection function ((2^n)xR)^m -> (2^n)^m.

In general the 2^m can be any combinatorial object and the vector of individuals replaced with any function. It is possible that we would want a multi-sorted species, as in GEP when using multiple domains.

Thats all for now I think. I would be interested to see a combination of species and monads, although I have no idea how it would work.

1 comment: