Jump to content
• Advertisement

#### Archived

This topic is now archived and is closed to further replies.

# C# genetic algorithm

This topic is 5280 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

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]

#### Share this post

##### Share on other sites
Advertisement
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]

#### Share this post

##### Share on other sites
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

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5
• Advertisement

• 18
• 20
• 14
• 14
• 9
• ### Forum Statistics

• Total Topics
633368
• Total Posts
3011538
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!