# An Introduction to Genetic Algorithms

## Overview

After reading an interesting tutorial by Chris Stones on Artificial Intelligence, I decided to follow this up with a different problem-solving technique, known as the Genetic Algorithm. Genetic Algorithms, or GAs, have been around since the 1970’s, and provide a method of solving vast problems quickly.

The solution to any problem may be found eventually by simply considering every possibility in turn.  Imagine a combination lock with only two numbers each accepting the digits 0 – 9, the possible combinations are:

Although this may work when trying to discover a two digit combination, if this is increased to a forty digit combination the time needed to discover the combination is greatly increased.  Genetic Algorithms are just one of a number of tools which aim to discover answers to problems in a much quicker time.

Before we demonstrate how a GA works it is necessary to define the term “Problem Space”: consider the combination example above, instead of representing the possible answers in a list as we have above, consider them in a grid:

This is what is called a problem space, i.e. the solution to the combination problem lies somewhere in this grid.  In order to find the solution we potentially have to look at every position in this grid.  Simply put - Genetic Algorithms just “bounce around” until they find the answer.

## You might also like...

### Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

### Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.”