3 ms·
I wonder if this could be improved with genetic algorithms or similar. The code is pretty small, but the seach space is still pretty huge.
by joelthelion 15y ago
I wonder if this could be improved with genetic algorithms or similar. The code is pretty small, but the seach space is still pretty huge.
- ars 15y agoDid you post in the wrong thread?
- joelthelion 15y agoNope. Why couldn't you use a generic optimizer to optimize a piece of code?
- ars 15y agoBecause it doesn't make any sense? What, are you planning just randomly try every permutation of 142 bytes? You can't have a genetic algorithm run on something where almost every attempt will simply produce invalid code. Genetic algorithms work when you can try various strategies to maximize a fitness function. But here the fitness is yes or no, does it work or not. There is nothing to maximize - and you can't try to maximize the "size fitness" because pretty much all the attempts will produce invalid code, so there is nothing to mix together for various generations.
- joelthelion 15y agoI disagree completely. The fitness function is clear, and that fact that many children will produce invalid code is not that much of a problem, really. You just eliminate them. Google "automatic programming" if you think it's never been done, your mind is about to be expanded. You should really learn to think for a while before you dismiss ideas as "nonsensical".
- joelthelion 15y agoCheck this out: https://secure.wikimedia.org/wikipedia/en/wiki/Genetic_programming https://secure.wikimedia.org/wikipedia/en/wiki/Genetic_progr...