Preliminary Background Tabu Search Genetic Algorithm

38
Preliminary Background Tabu Search Genetic Algorithm Faculty ofInform ation Technology U niversity ofScience Vietnam N ational U niversity ofH o ChiM inh City M arch 2010

description

Preliminary Background Tabu Search Genetic Algorithm. Problem used to illustrate. General problem min f ( x ) x є X Assignment type problem: Assignment of resources j to activities i min f ( x ) - PowerPoint PPT Presentation

Transcript of Preliminary Background Tabu Search Genetic Algorithm

Page 1: Preliminary Background Tabu Search Genetic Algorithm

Preliminary BackgroundTabu Search

Genetic Algorithm

Faculty of Information Technology

University of Science

Vietnam National University of Ho Chi Minh City

March 2010

Page 2: Preliminary Background Tabu Search Genetic Algorithm

Problem used to illustrate

• General problemmin f(x)

x є X

• Assignment type problem: Assignment of resources j to activities i

min f(x)

Subject to ∑1≤ j≤ m xij = 1 1≤ i ≤ n

xij = 0 or 1 1≤ i ≤ n, 1≤ j ≤ m

Page 3: Preliminary Background Tabu Search Genetic Algorithm

Neighborhood (Local) Search Techniques (NST)

• A Neighborhood (Local) Search Technique (NST) is an iterative procedure starting with an initial feasible solution x0 .

• At each iteration:

- we move from the current solution x є X to a new one x' є X in its neighborhood N(x) - x' becomes the current solution for the next iteration - we update the best solution x* found so far.

• The procedure continues until some stopping criterion is satisfied

Page 4: Preliminary Background Tabu Search Genetic Algorithm

Neighborhood

Neighborhood N(x) :

The neighborhood N(x) varies with the problem, but its elements are always generated by slightly modifying x.

If we denote M the set of modifications (or moves) to generate neighboring

solutions, then

N(x) = {x' : x' = x m , m M }

Page 5: Preliminary Background Tabu Search Genetic Algorithm

Neighborhood for assigment type problem

• For the assignment type problem: Let x be as follows: for each 1≤ i ≤ n, xij(i) = 1 xij = 0 for all other j

Each solution x' є N(x) is obtained by selecting an activity i and modifying its resource from j(i) to some other p

(i. e., the modification can be denoted m = [i, p] ): x' ij(i) = 0 x' ip = 1 x' ij = xij for all other i, j

The elements of the neighborhood N(x) are generated by slightly

modifying x:N(x) = {x' : x' = x m , m M }

Page 6: Preliminary Background Tabu Search Genetic Algorithm

Descent Method (D)

• At each iteration, a best solution x' є N(x) is selected as the current solution for the next iteration.

• Stopping criterion:

f(x') ≥ f(x)

i.e., the current solution cannot be improved or

a first local minimum is reached.

Page 7: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search

• Tabu Search is an iterative neighborhood or local search technique

• At each iteration we move from a current solution x to a new solution x' in a neigborhood of x denoted N(x),

• until we reach some solution x* acceptable according to some criterion

Page 8: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 9: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 10: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 11: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 12: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 13: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 14: Preliminary Background Tabu Search Genetic Algorithm

Selecting x'

Page 15: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

Page 16: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X

Let x:= x0

Page 17: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X

Let x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) }

At each iteration, a best solution x' є NC(x) is selected

Page 18: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X

Let x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x'

At each iteration, a best solution x' є NC(x) is selected

x' є NC(x) is the current solution for the next iteration

Page 19: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X

Let x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x)⊆

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x'

• As long as x' is better than x, the behavior of the procedure is similar to that of the descent method.

• Otherwise, moving to x' as the next current solution induces no improvement or a deterioration of the objective function, but it allows to move out of a local minimum

Page 20: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X Let TLk = Φ, k = 1, 2, …,p

Let x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆ of solutions z = x m such that tk(m) is not in TLk , k = 1, 2, …, p

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x'

Update Tabu Lists TLk , k = 1, 2,…, p

• As long as x' is better than x, the behavior of the procedure is similar to that of the descent method.

• Otherwise, moving to x' as the next current solution induces no improvement or a deterioration of the objective function, but it allows to move out of a local minimum

To prevent cycling, recently visited solutions are eliminated from NC(x) using Tabu lists

Page 21: Preliminary Background Tabu Search Genetic Algorithm

Tabu Lists (TL)

• Short term Tabu lists TLk are used to remember attributes or characteristics of the modification used to generate the new current solution

• A Tabu List often used for the assignment type problem is the following:

If the new current solution x' is generated from x by modifying the resource of i from j(i) to p, then the pair (i, j(i)) is introduced in the Tabu list TL

If the pair (i, j) is in TL, then any solution where resource j is to be assigned to i is declared Tabu

• The Tabu lists are cyclic in order for an attribute to remain Tabu for a fixed number nk of iterations

Page 22: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X Let TLk = Φ, k = 1, 2, …,p

Let x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆ of solutions z = x m such that tk(m) is not in TLk , k = 1, 2, …, p

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x'

Update Tabu Lists TLk , k = 1, 2,…, p

• As long as x' is better than x, the behavior of the procedure is similar to that of the descent method.

• Otherwise, moving to x' as the next current solution induces no improvement or a deterioration of the objective function, but it allows to move out of a local minimum

To prevent cycling, recently visited solutions are eliminated from NC(x) using Tabu lists

Page 23: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X Let TLk = Φ, k = 1, 2, …,p

Let x* := x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆ of solutions z = x m such that tk(m) is not in TLk , k = 1, 2, …, p or f(z) < f(x*)

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x' Update Tabu Lists TLk , k = 1, 2,…, p

• Since Tabu lists are specified in terms of attributes of the modifications used, we required an Aspiration criterion to bypass the tabu status of good solutions declared Tabu without having been visited recently

may include z in NC(x) even if z is Tabu whenever f(z) < f(x*) where x* is the best solution found so far

Page 24: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X Let TLk = Φ, k = 1, 2, …,p

Let x* := x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆ of solutions z = x m such that tk(m) is not in TLk , k = 1, 2, …, p or f(z) < f(x*)

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x' If f(x) < f(x*) then x* := x , Update Tabu Lists TLk , k = 1, 2,…, p

Update x* the best solution found so far

Page 25: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X Let TLk = Φ, k = 1, 2, …,p

Let x* := x:= x0 and stop:= false

• While not stop Determine a subset NC(x) N(x) ⊆ of solutions z = x m such that tk(m) is not in TLk , k = 1, 2, …, p or f(z) < f(x*)

Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x' If f(x) < f(x*) then x* := x ,

Update Tabu Lists TLk , k = 1, 2,…, p

• No monotonicity of the objective function!!!

• Stopping criterion ???

Page 26: Preliminary Background Tabu Search Genetic Algorithm

Tabu Search (TS)

• Initialize Select an initial solution x0 є X Let TLk = Φ, k = 1, 2, …,p Let iter := niter := 0 Let x* := x:= x0 and stop:= false

• While not stop iter := iter + 1 ; niter := niter + 1 Determine a subset NC(x) N(x) ⊆ of solutions z = x m such that tk(m) is not in TLk , k = 1, 2, …, p or f(z) < f(x*) Determine x' є NC(x) such that x' := argmin z є NC(x) { f(z) } x:= x' If f(x) < f(x*) then x* := x , and niter := 0 If iter = itermax or niter = nitermax then stop := true Update Tabu Lists TLk , k = 1, 2,…, p• x* is the best solution generated

Stopping criteria: - maximum number of iterations - maximum number of successive iterations where f(x*) does not improve

Page 27: Preliminary Background Tabu Search Genetic Algorithm

Improving Strategies

• Intensification

• Multistart diversification strategies:

- Random Diversification (RD)

- First Order Diversification (FOD)

• Variable Neighborhood Search (VNS)

• Exchange Procedure

Page 28: Preliminary Background Tabu Search Genetic Algorithm

Intensification

• Intensification strategy used to search more extensively a promissing region

Page 29: Preliminary Background Tabu Search Genetic Algorithm

Diversification

• The diversification principle is complementary to the intensification. Its objective is to search more extensively the feasible domain by leading the NST to unexplored regions of the feasible domain.

• Numerical experiences indicate that it seems better to apply a short NST (of shorter duration) several times using different initial solutions rather than a long NST (of longer duration).

Page 30: Preliminary Background Tabu Search Genetic Algorithm

Genetic Algorithm (GA)

• Population based algorithm

• At each iteration (generation) three different operators are first applied to generate a set of new (offspring) solutions using the N solutions of the current population:

selection operator: selecting from the current population parent-solutions that reproduce themselves crossover (reproduction) operator: producing offspring-solutions from

each pair of parent-solutions mutation operator: modifying (improving) individual offspring-solution

• A fourth operator (culling operator) is applied to determine a new population of size N by selecting among the solutions of the current population and the offspring-solutions according to some strategy

Page 31: Preliminary Background Tabu Search Genetic Algorithm

Encoding the solution

• The phenotype form of the solution x є ℝn is encoded (represented) as a genotype form vector z є ℝm (or chromozome) where m may be different from n.

• For example in the assignment type problem:

let x be the following solution: for each 1≤ i ≤ n,

xij(i) = 1

xij = 0 for all other j

x є ℝnxm can be encoded as z є ℝn where

zi = j(i) i = 1, 2, …, n

i.e., zi is the index of the resource j(i) assigned to activity i

Page 32: Preliminary Background Tabu Search Genetic Algorithm

Selection operator

• This operator is used to select an even number (2, or 4, or …, or N) of parent-solutions.

• Each parent-solution is selected from the current population according to some strategy or selection operator.

• Note that the same solution can be selected more than once.

• The parent-solutions are paired two by two to reproduce themselves.

• Selection operators:

Random selection operator

Proportional (or roulette whell) selection operator

Tournament selection operator

Diversity preserving selection operator

Page 33: Preliminary Background Tabu Search Genetic Algorithm

Crossover (recombination) operators

• Crossover operator is used to generate new solutions including interesting components contained in different solutions of the current population.

• The objective is to guide the search toward promissing regions of the feasible domain X while maintaining some level of diversity in the population.

• Pairs of parent-solutions are combined to generate offspring-solutions according to different crossover (recombination) operators.

Page 34: Preliminary Background Tabu Search Genetic Algorithm

One point crossover

• The one point crossover generates two offspring-solutions from the two parent-solutions

z1 = [ z11, z2

1, …, zm1]

z2 = [ z12, z2

2, …, zm2]

as follows: i) Select randomly a position (index) ρ, 0 ≤ ρ ≤ m. ii) Then the offspring-solutions are specified as follows:

oz1 = [ z11, z2

1, …, zρ1, zρ+1

2, …, zm2]

oz2 = [ z12, z2

2, …, zρ2, zρ+1

1, …, zm1]

Hence the first ρ components of offspring oz1 (offspring oz2) are the corresponding ones of parent 1 (parent 2), and the rest of the components are the corresponding ones of parent 2 (parent 1)

Page 35: Preliminary Background Tabu Search Genetic Algorithm

Two points crossover

• The two points crossover generates two offspring-solutions from the two parent-solutions

z1 = [ z11, z2

1, …, zm1]

z2 = [ z12, z2

2, …, zm2]

as follows: i) Select randomly two positions (indices) μ,ν, 1 ≤ μ ≤ ν ≤ m. ii) Then the offspring-soltions are specified as follows: oz1 = [ z1

1, …, zμ-11, zμ2, …, zν2, zν+1

1, …, zm1]

oz2 = [ z12, …, zμ-12, zμ1, …, zν

1, zν+12, …, zm

2]

Hence the offspring oz1 (offspring oz2) has components μ, μ+1, …, ν of parent 2 (parent 1), and the rest of the components are the corresponding ones of parent 1 (parent 2)

Page 36: Preliminary Background Tabu Search Genetic Algorithm

Uniform crossover

• The uniform crossover requires a vector of bits (0 or 1) of dimension m to generate two offspring-solutions from the two parent-solutions

z1 = [ z11, z2

1, …, zm1] , z2 = [ z1

2, z22, …, zm

2] :

i) Generate randomly a vector of bits, for example [0, 1, 1, 0, …, 1, 0] ii) Then the offspring-solutions are specified as follows:

parent 1: [ z11, z2

1, z31, z4

1,…, zm-11, zm

1]

parent 2: [ z12, z2

2, z32, z4

2,…, zm-12, zm

2]

Vector of bits: [ 0 , 1 , 1 , 0 , …, 1 , 0 ]

Offspring oz1 : [ z11, z2

2, z32, z4

1,…, zm-12, zm

1]

Offspring oz2: [ z12, z2

1, z31, z4

2,…, zm-11, zm

2]

Page 37: Preliminary Background Tabu Search Genetic Algorithm

Uniform crossover

• The uniform crossover requires a vector of bits (0 or 1) of dimension m to generate two offspring-solutions from the two parent-solutions

z1 = [ z11, z2

1, …, zm1] , z2 = [ z1

2, z22, …, zm

2] :

i) Generate randomly a vector of bits, for example [0, 1, 1, 0, …, 1, 0] ii) Then the offspring-solutions are specified as follows:

parent 1: [ z11, z2

1, z31, z4

1,…, zm-11, zm

1]

parent 2: [ z12, z2

2, z32, z4

2,…, zm-12, zm

2]

Vector of bits: [ 0 , 1 , 1 , 0 , …, 1 , 0 ]

Offspring oz1 : [ z11, z2

2, z32, z4

1,…, zm-12, zm

1]

Offspring oz2: [ z12, z2

1, z31, z4

2,…, zm-11, zm

2]

Hence the ith component of oz1

(oz2) is the ith component of parent 1 (parent 2) if the ith

component of the vector of bits is 0, otherwise, it is equal to theith component of parent 2 (parent 1)

Page 38: Preliminary Background Tabu Search Genetic Algorithm

Mutation operator

• Mutation operator is an individual process to modify offspring-solutions

• In traditional variants of Genetic Algorithm the mutation operator is used to modify arbitrarely each componenet zi with a small probability:

For i = 1 to m

Generate a random number β є [0, 1]

If β < βmax then select randomly a new value for zi

where βmax is small enough in order to modify zi with a small probability

• Mutation operator simulates random events perturbating the natural evolution process

• Mutation operator not essential, but the randomness that it introduces in the process, promotes diversity in the current population and may prevent premature convergence to a bad local minimum