Encoding very depends on the problem. In this chapter will be introduced some encodings, which have been already used with some success. Binary Encoding Binary encoding is the most common, mainly because first works about GA used this type of encoding.
Binary encoding gives many possible chromosomes even with a small number of alleles.
The knapsack has given capacity. Select things to maximize the value of things in knapsack, but do not extend knapsack capacity. Permutation Encoding Permutation encoding can be used in ordering problems, such as travelling salesman problem or task ordering problem. In permutation encoding , every chromosome is a string of numbers, which represents number in a sequence . Travelling salesman has to visit all of them, but he does not to travel very much.