Skip to main content
gamedev.net
🔒 Locked

C# genetic algorithm

Started by Khaos Jun 4, 2004 at 5:45 PM 1 replies 2.7k views
Original Post
Khaos
Khaos
All right, I am trying very hard to figure out how to create the most simplistic genetic algorithm possible. I would like to consider this the "hello world" of C# genetic algorithms. I've looked at many examples, but so many go into the concept a little too far. Thus, I can't get ahold of the concept properly. Could anyone guide me along in the setup or theory of such an algorithm, in C#? Code would be great, but understandable theory would be nice also. Is this correct: genetic algorithms are used to find the most optimal path to a solution.. when the solution is already known? If not, help me out. For my simple intro to GAs, I want to create a program that will solve: a + b = 4 . For integer solutions, there is a finite solution set (edit: or wait.. is there still an infinite?). But if I include floats, does that become infinite? We talked about this in an earlier thread, and someone was going to post some code and theory on this exact question, but the thread was closed sadly. I would appreciate any help on this. ... a + b = 4 ... [edited by - khaos on June 4, 2004 6:50:22 PM]
Zipster
Zipster
Using simple linear algebra, when you have a system of two variables and one equation, there is an infinite solution set. It doesn't matter if you only use integers, because that's just a subset of real numbers.

[edited by - Zipster on June 4, 2004 8:15:46 PM]
Magius
Magius
I always thought that conjunctive normal form was a nice easy starting point for genetic algorithms - i.e. finding solutions that make the conjunctive normal form statement true. It has a compact representation for individuals and a clear idea of what to use for the fitness function to propagate populations. I think that it can teach the very basic principles of genetic algorithms without getting very complex.

Magius

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.