in reply to Re^2: Brute force perl
in thread Brute force perl

you would have a lot more expensive fitness evaluations than necessary

Why? With the OP's brute force method, you're fully enumerating the search space. With a GA, you're "intelligently" pruning, or picking a path through the search space. That's the whole point, actually. As I said, the building block hypothesis makes sense here. Building blocks such as $_ or print are more likely to survive, for example.

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Replies are listed 'Best First'.
Re^4: Brute force perl
by bart (Canon) on Jun 13, 2007 at 10:49 UTC
    The score for the generated code is just "is this valid", hence, a boolean. Just replacing one character is enough to make invalid code valid, or vice versa. There is no such thing as "almost valid code".

    Hence, there is no way to "prune intelligently".

      You're absolutely right. Put another way - the fitness landscape has no gradient; hence, no algorithm can "climb" toward a better solution. Foo. :-(

      A word spoken in Mind will reach its own level, in the objective world, by its own weight
Re^4: Brute force perl
by lima1 (Curate) on Jun 12, 2007 at 18:49 UTC
    "A lot" was probably wrong here, but what I wanted to say is that I don't believe it is possible to generate more "correct strings" in a given time with a GA. And if you want to find ALL (as stated by the OP) correct strings, you can't use GAs at all.