Ala Qumsieh ([EMAIL PROTECTED]) wrote:
> This revives an old idea I had during the Santa tournament where a genetic
> algorithm is used to evolve potential hole solutions. The way it works is to
> initially create a large number of random solutions, and let them evolve by
> mating and mutating their way towards a legal solution. It would be
> extremely interesting to see how the same evolutionary process that led to
> the development of the human brain can fare against our resident Aliens :)
> 
> Anyone interested in taking that idea to the next step?

Something along these lines did strike me.  You could describe a
solution in terms of "characteristics", where characteristics were
things like:

  "loops via for(...)x pop"
  "prints the \n via -l"
  "stores the partial result in $_"
  "stores the partial result in $\"
  "stores the partial result in $^I"

then you could formally describe the cost in strokes for each
characteristic, and rules which say things like

  "a solution combining characteristics A and B saves 2 extra strokes"
  (e.g. if you store the partial result in $_, you could avoid a `=~')

  "characteristics C and D are mutually incompatible"

Then it would be a fairly simple task to navigate the decision tree
and select the optimal set of characteristics.  I think this would
save golfing time, because some time is normally spent merely trying
combinations of characteristics, and when there are many slightly
different ways of doing the same thing, it's easy to miss one
combination.

For example, I dismally failed to spot the following Cantor solution:

  s//-
  /;for$a(1..pop){s/./$& $&/g}print

even though I had thought of all its characteristics individually.

Reply via email to