Download presentation
Presentation is loading. Please wait.
Published byDamian Jennings Modified over 9 years ago
1
A family of optimization methods that search for an optimum minimum or maximum for a given problem (but never finds it ). The methods are best suited for (very) complicated optimization problems. Application areas: scheduling, robotics, routing. My interest is in scheduling!
2
Stems from the nature on how different species behave and have developed. Examples: ant colony, fish swarms, bird flocks, brain cells, and likes. Always population based. The individuals of the population represents possible (candidate) solutions. All solutions are usually developed concurrently (at the same speed).
3
At some point the development is interrupted to do one or both of the following: 1. Recombination: some of the best solutions are combined to get better solutions. Usually two solutions are combined to get one new solution. 2. Mutation: One solution is mutated somehow to get a new solution. The strongest solutions replaces the weakest ones in the population.
4
The level (amount) of recombination and mutation can be different. It should be strongly noted that one (or even both) can be omitted. It can be argued that if both are omitted then we are not using an EA (it though still uses the population)
6
How to decide when to perform EA? When to stop the algorithm? How to do recombination? How to use mutation? When to use only one of these? When to stick only with the population? How to evaluate the solutions?
7
N (usually 8) queens has to be placed on a chess board in a way that no two queens can check each other. Usually solved by an incremental approach: the queens are placed one by one on the chess board in a way that the latest placed queen do no check any other previously placed queen. If and when a queen can not be placed on the chess board backing of previously placed queens is done.
8
When solving this with a very simple EA we take a totally different approach. We do not follow every step of the previously showed pseudo-algorithm. We use a population of one just to be able to go through this example. Therefore we also do not use recombination nor mutation. After we have gone through the example we will take a look at how to apply all these to the problem.
9
For simplicity, let’s use 4 queens. Here we only demonstrate how to develop and evaluate the solution. First we make a random solution (usually called candidate solution)
10
Randomized startCostPossible moves, cost and the cost changes. x 2x 20x 11x 11 x 3x 21 x 12 x12 x 1 x 10 x 10 x 01 x2 x11 x11 x20 8644 x 1x 10x 01x 01 x1 x01 x10 x01 x 0 x 1 x 1 x 1 x2x 20 x 20 x 11 4442 x 0x 1 x 1 x 0 x0 x00 x1 x1 x 1x 10 x 3-2 x2 x 1 x 01 x 10 x 1 2264 x 1 x 01 x 3 x10 x0 x00 x1 x1 x 1x 01x 10x 01 x 0 x 00 x 1 x 00 2062
11
So, that was an easy problem. What if we had an infinite number of queens? We wouldn’t have enough time to evaluate the solutions. What to do? There must always be enough time to evaluate the solutions, so we must take a short cut somewhere else.
12
We must narrow the search space. We could choose only some of the rows of the chess board. We could choose only some of the columns where to place the queens. The only rule that matters here is: there must be enough computing time to perform all the required operations.
13
So what if we can’t find a solution to the problem? We might be (are) forced to be satisfied with a non-optimal solution. For almost all of the problems the minimum (or maximum) is not known. You can test your algorithm with a lot of bench mark problems. They might not fit your algorithm, though.
14
The code must always be ”well” done. The data structures must be perfect. Evaluation is always an update – never a total calculation (and this is really hard to accomplish!). Very soon you have to forget about ”stylish” programming. In the end every line of code depends on every other line of the code.
15
There are a lot of pitfalls in using EA. Representing the problem. Choosing the recombination and mutation operators. Or choosing not to use them. Getting stuck in a local optimum is a very big problem. How to escape from it?
16
Recombination x 2x 2 x 2 x 1 x 3x 2 x 2 x 2 x 3 x 1 x 2 x 1 x2 x1 x 2x 0 10684 How to recombine these? Choose the best rows. If the best rows are equally good, randomize. (We check them all as an example.) x 2 x 1 x 2 x 1 x 3x 2 x 2 x 2 x 3 x 0 x 3 x 1 x 2x 1x 1x 0 10484 After this we should replace the worst candidate solution with this best one. The worst has a cost of 10 so the probability to get a better solution to the population is 3/4 = 0.75. This kind of EA was just a simple example. It can be done in other ways also. F.ex. We could be smart and allow only candidate solutions where every queen is in an unique column. We could also be even more "stupid" and allow more than one queen in a row.
17
Mutation Lets try mutation to the best solution from the original population. We could mutate every queen with three new positions (4*3 = 12 possibilities). x 3 x 2 x1 x 1 x 2 x 2 x 1x 2 x 2 x 2 x 1 x 0 x 1x 0x 1x 1 8644 x 1 x 0 x 1 x 2 x 3 x1 x 2 x 2 x 1 x 1x 2 x 3 x 1x 0x 1x 1 6268 x 1 x 2 x 1 x 1 x 1 x 3 x 2 x 3 x0 x 2 x 2 x 2 x 0 x 3 x 1 x2 21068 So, by mutation we get a better solution to the population with probability 11/12 = 0.92.
18
The schedule of the Finnish Ice Hockey League. Rosters of employees.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.