Genetic Algorithms - SJSU Computer Science …khuri/Aalto_2017/aalto_2017.pdfIntroduction to GA...

113
Genetic Algorithms Sami Khuri Department of Computer Science San Jos´ e State University One Washington Square San Jos´ e, CA 95192-0249 U.S.A. [email protected] www.cs.sjsu.edu/faculty/ khuri

Transcript of Genetic Algorithms - SJSU Computer Science …khuri/Aalto_2017/aalto_2017.pdfIntroduction to GA...

Genetic Algorithms

Sami Khuri

Department of Computer Science

San Jose State University

One Washington Square

San Jose, CA 95192-0249

U.S.A.

[email protected]

www.cs.sjsu.edu/faculty/ khuri

Outline

Outline

A) Introduction to the Simple Genetic

Algorithm.

B) Applications I: Applying Genetic

Algorithms to Tackle NP-hard Problems.

C) Walsh and Haar Functions.

D) Applications II: Other Applications of

Genetic Algorithms:

• Bioinformatics.

• Tracking a Criminal Suspect.

• Genetic Programming.

Aalto University: Summer 2017 1

Introduction to GA [Gol89]

Introduction to Genetic Algorithms

• GA’s were developed by John Holland.

• GA’s are search procedures based on the

mechanics of natural selection and natural

genetics.

• GA’s make few assumptions about the

problem domain and can thus be applied

to a broad range of problems.

• GA’s are randomized, but not

directionless, search procedures that

maneuver through complex spaces looking

for optimal solutions.

Aalto University: Summer 2017 2

Introduction to GA [Gol89]

Comparison with otheroptimization procedures

Genetic Algorithm�

Traditional Algorithm

• works with coding • works with parameters

of parameter set themselves

• searches from population • searches from a single

of points point

• uses payoff information: • uses auxiliary knowledge:

objective function derivatives, gradients, etc...

• uses probabilistic • is deterministic

transition values

Aalto University: Summer 2017 3

Simple Genetic Algorithm [KB90]

1) Randomly generate m strings of length n each, to form the initial

population: Pop(1).

Let i 1

2) Compute fitness and relative fitness

of each string in Pop(i).

3) Form mating pool from Pop(i) by

spinning the weighted roulette wheel

4) Form Pop(i+1) by:

a) randomly pairing the strings in the

mating pool

b) choosing crossing sites at random

for each pair

c) exchanging rightmost substrings

of each pair

d) performing bit wise mutation with a very small probability

Solution:

String in Pop(i+1)

i i+1

with best fitness

value

done?

yes

no

m times.

Aalto University: Summer 2017 4

SGA Operators

• Example:

Strings Fitness Relative Fitness

1101010 52.5 .251011001 84.0 .400100110 42.0 .201000101 31.5 .15

• Roulette Wheel:

25%

40%

20%

15%

• Mating Pool:

1011001

0100110

1011001

1101010

Aalto University: Summer 2017 5

Crossover and Mutation

• Crossover

– Choose 2 strings from mating pool.

Choose a X-site:

1 0 1 1 0 0 1

1 1 0 1 0 1 0

– Children:

1 0 1 1 0 1 0

1 1 0 1 0 0 1

• Mutation:

– Flip a randomly chosen bit:

1 0 1 1 0 1 0

1 0 1 1 0 0 0

Aalto University: Summer 2017 6

The 0/1 Knapsack Problem

The 0/1 Knapsack Problem

Objects: 1 . . . i . . . nWeights: w1 . . . wi . . . wn

Profits: p1 . . . pi . . . pn

Knapsack capacity: M

Maximize∑n

i=1 xipi subject to∑n

i=1 xiwi ≤ M ,

where xi ∈ {0,1} for 1 ≤ i ≤ n.

Each string of the population represents a

possible solution. If the jth position of the

string is 1 i.e. xj = 1, then the jth object is in

the knapsack; otherwise it is not.

A string might represent an infeasible

solution: the total sum of the weights of the

objects exceeds the capacity of the knapsack.

Aalto University: Summer 2017 7

The 0/1 Knapsack Problem

Problem Instance:

Objects: 1 2 3 4 5 6 7 8 9 10Weights: 20 18 16 16 12 8 6 5 3 1Profits: 55 40 30 27 20 13 9 7 4 1

Knapsack capacity : 80

String 1001001011 is of weight 46 and has a

profit of 96.

Two alternatives for the fitness functions are:

f(~x) =∑

i=1,n

xipi,

where ~x = (x1, x2, . . . , xn) is a feasible

solution; or

f(~x) =∑

i=1,n

xipi − penalty

for any ~x, where infeasible strings are

penalized.

Aalto University: Summer 2017 8

Sample Runs

Aalto University: Summer 2017 9

Sample Runs

Aalto University: Summer 2017 10

Algorithm GA

Algorithm GA is

t := 0;

initialize P(t);

evaluate P(t);

while not terminate P(t) do

t := t + 1;

P(t) := select P(t − 1);

recombine P(t);

mutate P(t);

evaluate P(t);

od

end GA.

Aalto University: Summer 2017 11

Rank-Ordered Genetic Algorithm

Encode the problem instance

Form Pop(1) by:

randomly generating m strings of length n

computing the fitness value of each string

sorting the strings from highest to lowest fitness value

Set i

Randomly pick a pair of strings among the top 15% of Pop(i)

Form Pop(i+1) by:

choosing a crossing site at random for the chosen pairperforming crossovercomputing the fitness values of the new stringsplacing the new strings in the sorted populationdeleting 2 randomly picked strings among the bottom 15%performing mutation

1

Solution:strings withmaximum fitness

in Pop(i+1)

yes

done?

no

i+1i

Aalto University: Summer 2017 12

Other Representations and Stochastic Operators

Representations, Operators andTechniques:

• Integer, real and Gray code

representations.

• Randomly generated and seeded initial

populations.

• Inversion and mutation swap.

• 2-point, k-point, uniform, edge

recombination, and partially mapped

crossovers.

• Elitism.

Aalto University: Summer 2017 13

Partially Mapped Crossover

Partially Mapped Crossover (PMX)

• PMX is used with permutations

(eg. TSP).

• Parents: Choose 2 X-sites.

10 3 8 1 9 2 4 5 6 7

5 1 3 6 7 9 10 2 4 8

• Children: Swap middle strings, then fill

the rest.

4 3 8 1 7 9 10 5 6 2

5 1 3 6 9 2 4 7 10 8

Aalto University: Summer 2017 14

The Schema Theorem

Why does the GA work?

• H = ⋆ ⋆ 10 ⋆ 11 is a schema, hyperplane

partition, or similarity template describing

{0010011, 0110011, ...}.

• There are 3ℓ − 1 schemata in the search

space, where ℓ is the length of the

encoded string.

• Every string in the population belongs to

2ℓ − 1 different schemata.

Aalto University: Summer 2017 15

The Schema Theorem

The 3 and 4 dimensionalHypercubes [Whi94]

Aalto University: Summer 2017 16

The Schema Theorem

Implicit Parallelism

• When sampling a population, we are

sampling more than just the strings of the

population.

• Many competing schemata are being

sampled in an implicitly parallel fashion

when a single string is being processed.

• The new distribution of points in each

schema should change according to the

average fitness of the strings in the

population that are in the schema.

Aalto University: Summer 2017 17

The Schema Theorem

Schema Properties

• Order: o(H)

– Number of fixed positions in the

schema H.

– o(⋆0 ⋆ 11 ⋆ 1) = 4.

• Defining length: δ(H)

– Distance between leftmost and

rightmost fixed positions in H.

– δ(⋆0 ⋆ 11 ⋆ 1) = 5.

Aalto University: Summer 2017 18

The Schema Theorem

The Building Block Hypothesis

When f(H) > f , the representation

(instances) of H, in generation t + 1, is

expected to increase, if δ(H) and o(H) are

small.

Aalto University: Summer 2017 19

The Schema Theorem [Hol75]

The Schema Theorem

m(H, t + 1) ≥ m(H, t)f(H,t)f(t)

[

1 − pcδ(H)ℓ−1 − pmo(H)

]

where

H : schemat : generation numberf(H, t) : average fitness of Hf(t) : fitness average of stringsm(H, t) : expected number of instances of Hδ(H) : defining length of Ho(H) : order of Hpc : crossover probabilitypm : mutation probabilityℓ : length of strings

Aalto University: Summer 2017 20

The Schema Theorem [Hol75]

Limitations of the SchemaTheorem

• Computing average fitnesses to evaluate

f(H) at time t is often misleading in

trying to predict f(H) after several

generations.

• The Schema Theorem cannot predict how

a particular schema behaves over time.

• Other models, of a more dynamic nature,

have been proposed.

Aalto University: Summer 2017 21

Application Problems

Applications I

• Maximum Cut Problem.

• Minimum Tardy Task Problem.

• Minimum Set Covering Problem.

• Terminal Assignment Problem.

• Edge Coloring Problem.

Aalto University: Summer 2017 22

Applications: The Principles

Different Approaches:

• Knowledge-based restrictions on search

space and stochastic operators.

• In the coming examples, only the fitness

function is problem-dependent.

Strategy for Fitness Functions:

• The fitness function uses a graded

penalty term. The penalty is a function of

the distance from feasibility.

• Infeasible strings are weaker than feasible

strings.

• Note: The infeasible string’s lifespan is

quite short.

Aalto University: Summer 2017 23

Maximum Cut Problem [KBH94]

Maximum Cut Problem

Problem Instance: A weighted graph

G = (V, E). V = {1, . . . , n} is the set of

vertices and E the set of edges.

wij represents the weight of edge 〈i, j〉.

Feasible Solution: A set C of edges, the

cut-set, containing all the edges that have

one endpoint in V0 and the other in V1,

where V0 ∪ V1 = V , and V0 ∩ V1 = ∅.

Objective Function: The cut-set weight

W =∑

〈i,j〉∈C wij, which is the sum of the

weights of the edges in C.

Optimal Solution: A cut-set that gives the

maximum cut-set weight.

Aalto University: Summer 2017 24

Maximum Cut Problem [KBH94]

GA encoding for the Maximum Cut

Problem:

• Encode the problem by using binary

strings (x1, x2, . . . , xn), where each digit

corresponds to a vertex.

• The fitness function to be maximized is:

f(~x) =n−1∑

i=1

n∑

j=i+1

wij ·[xi(1−xj)+xj(1−xi)] .

In absence of test problems of significantly

large sizes use scalable test problems.

Aalto University: Summer 2017 25

Maximum Cut Problem [KBH94]

Test Problems for the Maximum Cut

Problem

• Consider randomly generated graphs of

small sizes. The global optimum can be a

priori computed by complete enumeration.

• Construct two graphs of n = 20 vertices

each.

Vary the probability of placing an edge

between arbitrary pairs of vertices.

Weights of edges are uniformly chosen in

the range [0,1].

• a) Sparse graph: “cut20-0.1”. Probability

of an edge is 0.1

b) Dense graph: “cut20-0.9”. Probability

of an edge is 0.9.

Aalto University: Summer 2017 26

Scalable Graph

1

2

3

4

5

6

7

8

9

10

0.5 0.5

1

1

11

1

1

10

10

10

10

10

10

10

10 10

10

10

10

10

10

10

10

1

2

3

4

5

6

7

8

9

10

0.5 0.5

1

1

11

1

1

10

10

10

10

10

10

10

10 10

10

10

10

10

10

10

10

Aalto University: Summer 2017 27

Maximum Cut Problem [KBH94]

The Scalable Graph

• For n = 10, the string 0101001010 (or its

complement) yields the optimum cut-set

with value: f∗ = 87.

• Graph can be scaled up, for any even n.

• The optimal partition is described by the

(n − 2)/4-fold repetition of the bit pattern

01, followed by a 0, then another copy of

the (n − 2)/4-fold repetition of the bit

pattern 01, followed by a 0 if n = 4k + 2

and the n/2-fold repetition of 01 if n is a

multiple of 4.

The objective function value is:

f∗ = 21 + 11 · (n − 4) for n ≥ 4.

• “cut100” is of size n = 100.

Aalto University: Summer 2017 28

Maximum Cut Problem [KBH94]

Runs for the Maximum Cut Problem:

• Recall: “cut20-0.1” is a sparse graph, and

“cut20-0.9” is a dense graph.

• Perform a total of 100 runs with

population size: 50. Use 200 generations

for the small graphs, and 1000

generations for the large one.

cut20-0.1 cut20-0.9 cut100

f(~x) N f(~x) N f(~x) N

10.11981 68 56.74007 70 1077 6

9.75907 32 56.12295 1 1055 1356.03820 11 1033 3055.84381 18 1011 35

989 12967 3945 1

Aalto University: Summer 2017 29

Maximum Cut Problem [KBH94]

Conclusions: Maximum Cut Problem

1. With the dense and the sparse graphs,

the global optimum is found by more than

two thirds of the runs.

2. For the dense and sparse graphs, the

genetic algorithm performs 104 function

evaluations, and the search space is of

size 220. Thus, the genetic algorithm

searches less than one percent of the

search space.

3. Similarly for cut100.

The optimum is found in six of the runs.

Average value from remaining runs:

f = 1022.66, which is about 5% from the

global optimum.

Only (5 · 104)/2100 · 100% ≈ 4 · 10−24 %

of the search space is explored.

Aalto University: Summer 2017 30

The Minimum Tardy Task Problem

Minimum Tardy Task Problem

Problem instance:Tasks: 1 2 . . . n , i > 0Lengths: l1 l2 . . . ln , li > 0Deadlines: d1 d2 . . . dn , di > 0Weights: w1 w2 . . . wn , wi > 0

Feasible solution: A one-to-one scheduling

function g defined on S ⊆ T ,

g : S −→ Z+ ∪ {0} that satisfies the

following conditions for all i, j ∈ S:

1. If g(i) < g(j) then g(i) + li ≤ g(j).

2. g(i) + li ≤ di.

Objective function: The tardy task weight

W =∑

i∈T−S wi, which is the sum of the

weights of unscheduled tasks.

Optimal solution: The schedule S with the

minimum tardy task weight W.

Aalto University: Summer 2017 31

The Minimum Tardy Task Problem

Fact S is feasible if and only if the tasks in S

can be scheduled in increasing order by

deadline without violating any deadline.

ExampleTasks: 1 2 3 4 5 6 7 8Lengths: 2 4 1 7 4 3 5 2Deadlines: 3 5 6 8 10 15 16 20Weights: 15 20 16 19 10 25 17 18

Aalto University: Summer 2017 32

The Minimum Tardy Task Problem

Example

Tasks: 1 2 3 4 5 6 7 8Lengths: 2 4 1 7 4 3 5 2Deadlines: 3 5 6 8 10 15 16 20Weights: 15 20 16 19 10 25 17 18

• S = {1,3,5,6}S is feasible with W = 74

• S′ = {2,3,4,6,8} ⇒ g(4) + l4 = 5 + 7 and

d4 = 8 i.e. g(4) + l4 > d4

Therefore S′ is infeasible.

Aalto University: Summer 2017 33

The Minimum Tardy Task Problem

Example

Tasks: 1 2 3 4 5 6 7 8Lengths: 2 4 1 7 4 3 5 2Deadlines: 3 5 6 8 10 15 16 20Weights: 15 20 16 19 10 25 17 18

Fitness FunctionString Term 1 Term 2 Term 3

0 1 1 1 0 0 0 0 w1 + w5 + w6

∑8i=1 wi w4

+w7 + w8

0 1 1 1 0 1 0 1 w1 + w5 + w7

∑8i=1 wi w4

0 0 1 1 0 0 0 0 w1 + w2 + w5 0 0+ w6 + w7 + w8

0 1 1 1 0 0 0 1 w1 + w5 + w6 + w7

∑8i=1 wi w4

0 1 1 1 0 1 0 0 w1 + w5 + w7 + w8

∑8i=1 wi w4

Aalto University: Summer 2017 34

The Minimum Tardy Task Problem

GA Specifications

• S can be represented by a vector

~x = (x1, x2, . . . , xn) where xi ∈ {0,1}. Thepresence of task i in S means that xi = 1.

• The fitness function to be minimized isthe sum of three terms:

f(~x) =∑n

i=1 wi · (1 − xi) + (1 − s) · ∑ni=1 wi

+∑n

i=1 wixi · 1R+

(

li +∑i−1

j=1 ljxj − di

)

.

In the third term, xj is for schedulable

jobs only. The whole term keeps checking

the string to see if a task could have beenscheduled. It makes use of the indicator

function:

1A(t) =

{

1 if t ∈ A0 otherwise.

s = 1 when ~x is feasible, and s = 0 when~x is infeasible.

Aalto University: Summer 2017 35

The Minimum Tardy Task Problem

Scalable Problem Instance

• Construct a problem instance of size

n = 5 that is scalable.

Tasks: 1 2 3 4 5Lengths: 3 6 9 12 15Deadlines: 5 10 15 20 25Weights: 60 40 7 3 50

• To construct a MTTP instance of size n = 5tfrom above model:

The first five tasks of the large problem areidentical to the 5-model problem instance.

The length lj, deadline dj, and weight wj of the jth

task, for j = 1,2, . . . , n, is given by: lj = li,dj = di + 24 · m and

wj =

{

wi if j ≡ 3 mod 5 or j ≡ 4 mod 5(m + 1) · wi otherwise ,

where j ≡ i mod 5 for i = 1,2,3,4,5 andm = ⌊j/5⌋.

The tardy task weight for the globally optimal

solution of this problem is 2 · n.

Aalto University: Summer 2017 36

The Minimum Tardy Task Problem

Runs for the Minimum Tardy Task

Problem

mttp20

• Population Size: 50

Number of Generations: 200

Crossover: Uniform

Probability of Crossover: 0.6

Mutation: Swap

Probability of Mutation: 0.05

• A total of 100 runs is performed.

f1(~x) d(~x, opt) N

41 0 88

46 3 1151 1 1

Aalto University: Summer 2017 37

The Minimum Tardy Task Problem

mttp100

• Scalable problem of size n = 100.

• Population Size: 200

Number of Generations: 100

Crossover: Uniform

Probability of Crossover: 0.6

Mutation: Swap

Probability of Mutation: 0.05

Note: About 1.6 · 10−23 % of the search

space is investigated.

• f2(~x) replaces infeasible strings by feasibleones.

f1(~x) d(~x, opt) N f2(~x) d(~x, opt) N

200 0 56 200 0 35240 1 2 – – –243 2 29 243 2 44276 3 3 276 3 4280 4 1 280 4 1– – – 296 4 1

329 5 9 329 5 14– – – 379 5 1

Aalto University: Summer 2017 38

The Minimum Set-Covering Problem

Minimum Set-Covering Problem

Problem instance: A set of objects

E = {e1, . . . , em} and a family of subsets

of E, F = {S1, . . . , Sn}, such that

∪ni=1Si = E. Each Si costs ci where ci > 0

for i = 1, . . . , n. Or equivalently, a 0/1

m × n matrix

A =

a11 . . . a1n. .. .. .

am1 . . . amn

such that∑n

j=1 aij ≥ 1 for i = 1,2, . . . , m.

Aalto University: Summer 2017 39

The Minimum Set-Covering Problem

Minimum Set-Covering Problem

Feasible solution:

A vector ~x = (x1, x2, . . . , xn) where

xi ∈ {0,1}, such that

n∑

j=1

aijxj ≥ 1

for i = 1,2, . . . , m.

Objective function:

A cost function P(~x) =∑n

j=1 cjxj where

~x = (x1, x2, . . . , xn) is a feasible solution.

Optimal solution:

A feasible vector that gives the minimum

cost, i.e., a vector that minimizes the

objective function.

Aalto University: Summer 2017 40

The Minimum Set-Covering Problem

Minimum Set-Covering Problem

Fitness Function B =∑n

i=1 ci.

U : the set of elements from E for which

the subsets represented by ~x have failed

to cover.

The function considers the minimum cost

required to transform the infeasible string

into a feasible one:

f(~x) =n

i=1

cixi + s(B +m∑

i=1

c∗i )

where

s =

{

0 , if ~x is feasible1 , if ~x is infeasible

and

c∗i =

{

minei∈U{cj | ei ∈ Sj} , if ei ∈ U0 , if ei /∈ U

Aalto University: Summer 2017 41

The Minimum Set-Covering Problem

Minimum Set-Covering Problem

Repair heuristic: Transform an infeasible

string into a feasible one by changing

xj = 0 to xj = 1 when

c∗i = minei∈U{cj | ei ∈ Sj} is calculated.

The repaired string is always feasible; the

fitness function in this case is simply

f ′(~x) =∑n

i=1 cixi.

Aalto University: Summer 2017 42

The Minimum Set-Covering Problem

GA Stochastic Operators and Test

Problems

• The GA is used with the one-point,

two-point, uniform, and fusion crossover

operators.

• Fusion crossover:

If ~a = (a1, a2, . . . , an) and~b = (b1, b2, . . . , bn) are the parent strings

with fitness f~a and f~b, then the offspring

~c = (c1, c2, . . . , cn) is determined in the

following fashion.

for all i ∈ {1, . . . , n}if ai = bi

then ci := ai;

else

ci :=

ai with probability p =f~b

f~a+f~bbi with probability 1 − p

Aalto University: Summer 2017 43

The Minimum Set-Covering Problem

GA Stochastic Operators and Test

Problems

• The crossover rate is 0.6

Mutation rate pm = 1/n.

Population size λ = 100.

Each experiment was run for 5,000

generations.

Problem m n Density (%)

4.1–4.10 200 1000 25.1–5.10 200 2000 26.1–6.5 200 1000 5a.1–a.5 300 3000 2b.1–b.5 300 3000 5c.1–c.5 400 4000 2d.1–d.5 400 4000 5e.1–e.5 50 500 20

Aalto University: Summer 2017 44

The Minimum Set-Covering Problem

Experimental Results

Prob 1-pt 2-pt unif fusion greedy bt kn

4.1 439 440 440 438 436 4294.2 536 551 525 556 533 5124.3 529 532 532 532 540 5164.4 528 517 508 512 512 4944.5 522 526 518 527 520 5124.6 568 579 572 568 605 5604.7 444 437 437 437 447 4304.8 504 504 509 499 525 4924.9 678 689 686 675 671 6414.10 549 538 553 553 533 5145.1 274 271 270 274 269 2535.2 318 319 319 320 330 3025.3 238 235 235 239 232 2265.4 247 245 245 244 250 2425.5 219 219 219 219 218 2115.6 229 236 238 232 227 2135.7 313 310 309 309 310 2935.8 302 309 304 306 311 2885.9 301 304 298 292 292 2795.10 275 276 276 277 278 2656.1 146 145 147 147 144 1386.2 154 154 153 154 157 1466.3 154 150 151 151 157 1456.4 140 133 136 133 141 1316.5 180 180 177 179 186 161a.1 255 261 260 260 264 253a.2 270 268 267 267 272 252a.3 247 247 244 245 245 232a.4 244 246 249 247 251 234a.5 240 239 239 239 248 236

Aalto University: Summer 2017 45

The Minimum Set-Covering Problem

Experimental Results - Continued

Prob 1-pt 2-pt unif fusion greedy bt kn

b.1 77 77 79 75 74 69b.2 87 83 84 81 78 76b.3 84 85 83 83 85 80b.4 84 82 84 84 83 79b.5 72 75 72 77 75 72c.1 234 235 234 235 239 227c.2 231 232 226 233 225 219c.3 266 261 263 264 259 243c.4 237 234 238 237 240 219c.5 220 219 222 219 219 215d.1 62 61 61 62 68 60d.2 72 72 70 70 71 66d.3 77 79 79 79 80 72d.4 66 64 66 66 67 62d.5 64 65 65 64 66 61e.1 8 7 7 8 5 5e.2 7 6 6 7 5 5e.3 7 7 8 6 5 5e.4 6 7 7 7 6 5e.5 7 8 7 7 5 5

Aalto University: Summer 2017 46

The Minimum Set-Covering Problem

Conclusions on the MSCP

• Repairing infeasible strings according to

the minimum cost principle yields better

results - the final values are close to the

best known solutions.

• The repair procedure competes well with

the greedy heuristic and yields better

solutions in most cases.

• The choice of the crossover operator has

no significant impact on the quality of the

results.

• Our simple greedy heuristic always

outperforms the genetic algorithm

without repairing. (Table not shown here)

Aalto University: Summer 2017 47

Terminal Assignment Problem [KC97]

Terminal Assignment Problem

Problem Instance:Terminals: l1, l2, . . . , lTWeights: w1, w2, . . . , wTConcentrators: r1, r2, . . . , rCCapacities: p1, p2, . . . , pC

Feasible Solution: Vector: ~x = x1 x2 . . . xTxi = j: ith terminal assigned to j.Assign all terminals to concentrators

without exceeding the concentrators’

capacities.

Objective Function: A function

Z(~x) =∑T

i=1 costij, where costij is the

distance between terminal i and

concentrator j.

Optimal Solution: A feasible vector ~x that

yields the smallest possible Z(~x).

Aalto University: Summer 2017 48

Terminal Assignment Problem [KC97]

Encoding for TA:

Use non-binary strings: x1 x2 . . . xT

The value of xi is the concentrator to which

the ith terminal is assigned.

Example:

1 2 3 4 5 6 7 8 9 10

2 3 2 2 3 2 3 1 1 2

l8

r3 l9

r1

l3

l7 l1 l6

l5 l10

l2

l4

r2

Aalto University: Summer 2017 49

Terminal Assignment Problem [KC97]

Fitness Function:

It is the sum of two terms:

1. the objective function which calculates

the total cost of all connections.

2. a penalty function used to penalize

infeasible strings. It is the sum of two

terms:

• offset term:

the product of the number of terminals

and the maximum distance on the grid.

• graded term:

the product of the sum of excessive

load of concentrators and the number

of concentrators that are in fact

overloaded.

Aalto University: Summer 2017 50

Experimental Runs

Experimental Runs

• Ten problem instances of 100 terminals

each.

Each concentrator has capacity between

15 and 25.

The number of concentrators is between

27 and 33.

• Number of generations: 20,000

Population size: 500

Crossover rate: 0.6

Mutation rates: Between 0.025 and 0.1

for LibGA and for GeneSyS.

Aalto University: Summer 2017 51

Experimental Runs

• The results for the Genetic Algorithm are

the best obtained after 20,000

generations on each problem instance.

• Probably for 100 1, 100 2, and 100 3, the

solutions obtained by LibGA (and

Procedure Greedy) are the global optima.

Problem Greedy Genetic AlgorithmsInstances Algorithm GENEsYs LibGA

100 1 928 963 928100 2 935 973 935100 3 846 881 846100 4 1076 1123 1069100 5 1116 1178 1111100 6 1071 1106 1070100 7 1315 1404 1279100 8 1211 1225 1186100 9 1088 1169 1065100 10 902 977 901

Aalto University: Summer 2017 52

The Edge Coloring Problem [KWS00]

The Edge Coloring Problem

Problem Instance

A graph G = (V, E),

V = {v1, . . . , vn} is the set of vertices,

E = {e1, . . . , em} is the set of edges.

Feasible Solution

Vector ~y = y1 y2 . . . ym,

yi = j means that the ith edge ei is given

color j, 1 ≤ j ≤ m.

The components of ~y are essentially the

colors assigned to the m edges of G, where:

• Two adjacent edges have different colors.

• The colors are denoted by 1,2, . . . , q,

where 1 ≤ q ≤ m.

Aalto University: Summer 2017 53

The Edge Coloring Problem

Objective function

For a feasible vector ~y, let P(~y) be the

number of colors used in the coloring of the

edges represented by ~y. More precisely,

P(~y) = max{yi | yi is a component of ~y}.

Optimal solution

A feasible vector ~y that yields the smallest

P(~y).

Aalto University: Summer 2017 54

The Edge Coloring Problem

Applications

Practical applications include scheduling

problems, partitioning problems, timetabling

problems, and wavelength-routing in optical

networks.

NP-Hard

Holyer proved that the edge coloring problem

is NP-hard.

Definition

∆ is maximum vertex degree of G.

χ‘(G): the chromatic index of G, is the

minimum number of colors required to color

the edges of G.

Vizing’s Theorem

If G is a nonbipartite, simple graph, then

χ‘(G) = ∆ or χ‘(G) = ∆ + 1.

Aalto University: Summer 2017 55

Bipartite Graphs

Edge-Coloring Bipartite Graphs

• Journal of Algorithms, February 2000

Article by A. Kapoor and R. Rizzi:

O(m log2 ∆ +m

∆log2

m

∆log2

2∆)

• SIAM, Journal on Computation, 1982

Article by Hopcroft and Cole:

O(m log2 ∆ +m

∆log2

m

∆log2

3∆)

Aalto University: Summer 2017 56

The Genetic Algorithm

The Genetic Algorithm

Encoding:

Use non-binary strings of length m (number

of edges):

y1 y2 . . . ym.

The value of yj represents the color assigned

to the jth edge.

For example, if a graph has 12 edges then the

following string is a possible coloring, where

edge e1 has color number 5, edge e2 has color

number 3, and so on.

1 2 3 4 5 6 7 8 9 10 11 12

5 3 5 5 1 3 2 1 4 4 1 3

Aalto University: Summer 2017 57

The Genetic Algorithm

The GA Operators

• generational genetic algorithms

• roulette wheel selection

• uniform crossover

• uniform mutation

Each string in the population occupies a slot

on the roulette wheel of size inversely

proportional (since the edge coloring problem

is a minimization problem) to the fitness

value.

Aalto University: Summer 2017 58

The Genetic Algorithm

Fitness Function

The fitness function of ~y = y1y2 . . . ym is given

by:

f(~y) = P(~y) + s[(∆ + 1) + T(~y)]

It is the sum of two terms:

1. the objective function P(~y), which

calculates the total number of colors used

to color the edges of the graph.

2. a penalty term used to penalize infeasible

strings. It is the sum of two parts:

• The first part is the maximum vertex

degree to which one is added, i.e.,

∆ + 1. It is an offset term.

• The second part of the penalty term,

T(~y), is the number of violated pairs.

Aalto University: Summer 2017 59

Grouping Genetic Algorithm [Fal93]

Grouping Problems

• Many problems consist in partitioning a

given set U of items into a collection of

pairwise disjoint subsets Uj under some

constraint.

• In essence, we are asked to distribute the

elements of U into small groups Uj. Some

distributions (i.e., groupings) are

forbidden.

• Some examples: Bin packing problem,

terminal assignment, graph coloring.

• The objective is to minimize a cost

function over the set of all possible legal

groupings.

Aalto University: Summer 2017 60

Grouping Genetic Algorithm

The Grouping Genetic Algorithm

Encoding

To capture the grouping entity of the

problem, the simple (standard) chromosome

is augmented with a group part.

For example, the chromosome of our

hypothetical 12-edge graph:

5 3 5 5 1 3 2 1 4 4 1 3 A 5 8 11 B 7 C 2 6 12 D 9 10 E 1 3 4

The colors are labeled with letters, the edges

– with numbers.

The first half is the object part (the entire

chromosome of the previous section), the

second half is the group part.

Aalto University: Summer 2017 61

Grouping Genetic Algorithm

Fitness Function

The fitness function of a string considers the

object part of the string only and computes

the fitness value as explained before.

Aalto University: Summer 2017 62

Grouping Genetic Algorithm

Crossover Operator

Two parents are randomly chosen from the

mating pool and two crossing sites are chosen

for each parent:

A 5 8 11 B 7 C 2 6 12 D 9 10 E 1 3 4

A 1 3 6 7 B 8 11 C 2 9 D 10 12 E 4 5

Inject the entire group part between the two

crossing sites of the second parent into the

first parent at the beginning of its crossing

site:

A 5 8 11 B 8 11 C 2 9 D 10 12 B 7 C 2 6 12 D 9 10 E 1 3 4

Aalto University: Summer 2017 63

Grouping Genetic Algorithm

Dealing with Redundancy

Resolve redundancy by eliminating groups B,

C, and D from their old membership (i.e.,

from the first parent string):

A 5 8 11 B 8 11 C 2 9 D 10 12 E 1 3 4

Remove duplicate edges (8 and 11) from their

old membership (from the first parent string):

A 5 B 8 11 C 2 9 D 10 12 E 1 3 4

Use the first–fit heuristic to reassign lost

edges (6 and 7): assign the edge to the first

group that is able to service it, or to a

randomly selected group if none is available.

Reversing the roles of the two parents allows

the construction of a second offspring.

Aalto University: Summer 2017 64

Grouping Genetic Algorithms

The Mutation Operator

Probabilistically remove some group from the

chromosome and reassign its edges.

Each edge is assigned to the first group that

is able to take it.

After crossover and mutation are performed

on the group part, the object part is

rearranged accordingly to reflect the changes

that the group part has undergone.

Aalto University: Summer 2017 65

Experimental Runs

Benchmarks

• Twenty eight simple graphs with the number ofedges between 20 and 2596:

– Five book graphs from the StanfordGraphBase.

– Two miles graphs from the StanfordGraphBase (denoted by mls).

– Nine queen graphs from the StanfordGraphBase (q).

– Four problem instances based on the Mycielskitransformation from the DIMACS collection(mcl).

– Seven complete graphs (not shown in tables).

• Fifteen multigraphs generated by repeatedlyassigning edges to randomly chosen pairs ofvertices until each vertex has a fixed degree.

We denote the multigraphs we generated byrexmg10 x, rexmg20 x, and rexmg30 x, where 10,20 and 30 are the number of vertices and x is thedegree and has the values of 10, 20, 30, 40 and50.

Aalto University: Summer 2017 66

Test results for the simple graphs

Test results for the GraphBase

and DIMACS problem instances

Problem Instances Greedy Algorithm LibGA GGAName VerticesEdgesDensity ∆ BestFreq. Mean BestFreq.Mean

anna 138 493 3.57 71 71 100 71 71 71 100 71david 87 406 4.67 82 82 100 82 82 82 100 82homer 561 1629 2.90 99 99 100 99 99 99 100 99huck 74 301 4.07 53 53 100 53 53 53 100 53jean 80 254 3.17 36 36 100 36 36 36 100 36gs120 120 638 5.32 13 14 38.8 14.66 14 13 96 13.04mls250 128 387 3.02 16 16 72.9 16.28 16 16 100 16mls500 128 1170 9.14 38 38 85.3 38.16 38 38 100 38q5 5 25 160 6.40 16 16 59.7 16.43 16 16 100 16q6 6 36 290 8.06 19 19 11.1 20.36 19 19 100 19q7 7 49 476 9.71 24 24 59.8 24.45 24 24 100 24q8 8 64 728 11.4 27 27 8.4 28.28 27 27 100 27q8 12 96 1368 14.3 32 33 11.3 34.66 34 32 16 32.84q9 9 81 1056 13.0 32 32 63.5 32.40 32 32 100 32q10 10 100 1470 14.7 35 35 13.7 36.18 35 35 100 35q11 11 121 1980 16.4 40 40 66.1 40.43 40 40 100 40q12 12 144 2596 18.0 43 43 20 44.09 43 43 100 43mcl3 11 20 1.82 5 5 70.4 5.30 5 5 100 5mcl4 23 71 3.09 11 11 100 11 11 11 100 11mcl5 47 236 5.02 23 23 100 23 23 23 100 23mcl6 95 755 7.95 47 47 100 47 47 47 100 47

Aalto University: Summer 2017 67

Test results for the multigraphs

Test results for the multigraph

problem instances

Problem Instances Greedy Algorithm GGAName VerticesEdgesDensity ∆ BestFreq. Mean BestFreq.Mean

rexmg10 10 10 50 5 10 11 12.5 12.177 10 99 10.01rexmg10 20 10 100 10 20 20 0.1 22.65 20 80 20.2rexmg10 30 10 150 15 30 31 2.7 32.784 30 61 30.39rexmg10 40 10 200 20 40 41 2.5 42.937 40 46 40.54rexmg10 50 10 250 25 50 51 1.7 53.138 50 48 50.52rexmg20 10 20 100 5 10 11 0.6 12.64 11 100 11rexmg20 20 20 200 10 20 22 3.0 23.528 21 6 21.94rexmg20 30 20 300 15 30 32 0.4 34.128 31 1 31.99rexmg20 40 20 400 20 40 43 10.1 44.388 42 100 42rexmg20 50 20 500 25 50 53 6.6 54.598 52 79 52.21rexmg30 10 30 150 5 10 12 28.3 12.777 11 64 11.36rexmg30 20 30 300 10 20 22 0.4 23.783 22 100 22rexmg30 30 30 450 15 30 33 8.5 34.346 32 54 32.46rexmg30 40 30 600 20 40 43 1.2 44.822 42 9 42.91rexmg30 50 30 750 25 50 53 0.8 55.094 52 1 52.99

Aalto University: Summer 2017 68

Walsh and Haar Functions

Walsh and Haar Functions

• Walsh Functions are used:

– as basis for the expansion of fitness

functions

– to compute the average fitness values

of schemata

– to design deceptive functions for the

genetic algorithm.

• Haar Functions.

• Comparison between Walsh and Haar

Functions.

• Fast Transforms.

Aalto University: Summer 2017 69

Walsh Functions

Walsh Transforms:

• Orthogonal, rectangular functions.

• Practical as bases for fitness functions of

genetic algorithms.

• Work with ±1 rather than 0 and 1.

Associate with x = xℓxℓ−1 . . . x2x1 an

auxiliary string y = yℓyℓ−1 . . . y2y1

y = aux(xℓ)aux(xℓ−1) . . . aux(x2)aux(x1)

where

yi = aux(xi) =

{

−1 if xi = 11 if xi = 0

• The Walsh functions over auxiliary

string variables form a set of 2ℓ

monomials defined for y = aux(x):

Ψj(y) = Πℓi=1 y

jii

where j = jℓjℓ−1 . . . j1 and j = Σℓi=1ji2

i−1.

Aalto University: Summer 2017 70

Walsh Functions: Basis

Example

In Ψ3(y) where ℓ = 3,

j = 3, and j3 = 0, j2 = 1, j1 = 1.

Ψ3(y) = y03y1

2y11 = y1y2.

If x = 101 then:

Ψ3(aux(101)) = Ψ3(aux(1)aux(0)aux(1))

= Ψ3(−11 − 1)

= (−1)(1)

= −1

{Ψj(x) : j = 0,1,2, . . . ,2ℓ − 1} forms a basis

for the fitness functions defined on [0,2ℓ).

Consequently, any fitness function defined on

binary strings of length l can be represented

by a linear combination of dicrete Walsh

functions.

Aalto University: Summer 2017 71

Walsh Functions: Basis

Example continued

f(x) = Σ2ℓ−1j=0 wjΨj(x)

wj: Walsh coefficients,

Ψj(x): Walsh monomials.

The Walsh coefficients are given by:

wj =1

2ℓΣ2ℓ−1

x=0 f(x)Ψj(x).

Aalto University: Summer 2017 72

Walsh functions on [0,8)

Walsh functions on [0,8)

x Ψ0(x) Ψ1(x) Ψ2(x) Ψ3(x) Ψ4(x) Ψ5(x) Ψ6(x) Ψ7(x)000 1 1 1 1 1 1 1 1001 1 -1 1 -1 1 -1 1 -1010 1 1 -1 -1 1 1 -1 -1011 1 -1 -1 1 1 -1 -1 1100 1 1 1 1 -1 -1 -1 -1101 1 -1 1 -1 -1 1 -1 1110 1 1 -1 -1 -1 -1 1 1111 1 -1 -1 1 -1 1 1 -1ind j 0 1 2 3 4 5 6 7j3j2j1 000 001 010 011 100 101 110 111mono y0

3y02y0

1 y03y0

2y11 y0

3y12y0

1 y03y1

2y11 y1

3y02y0

1 y13y0

2y11 y1

3y12y0

1 y13y1

2y11

yj3

3 yj2

2 yj1

1 1 y1 y2 y1y2 y3 y1y3 y2y3 y1y2y3

Aalto University: Summer 2017 73

Hadamard Matrices

• Lowest-order Hadamard matrix:

H2 =

[

1 11 −1

]

.

Recursive relation:

HN = HN2⊗ H2

⊗: Kronecker product (also known as

direct product).

HN =

HN2

HN2

HN2

−HN2

H8 =

1 1 1 1 1 1 1 11 −1 1 −1 1 −1 1 −11 1 −1 −1 1 1 −1 −11 −1 −1 1 1 −1 −1 11 1 1 1 −1 −1 −1 −11 −1 1 −1 −1 1 −1 11 1 −1 −1 −1 −1 1 11 −1 −1 1 −1 1 1 −1

Aalto University: Summer 2017 74

Schema Average Fitness

• Average fitness value of a schema can be

expressed as a partial signed summation

over Walsh coefficients.

• A schema h (hyperplane):

hℓ, hℓ−1, . . . , h2, h1 where hi ∈ {0,1, ⋆}.

f(h) =1

|h|Σx∈hf(x).

f(h) =1

|h|Σx∈hΣ2ℓ−1j=0 wjΨj(x)

=1

|h|Σ2ℓ−1j=0 wjΣx∈hΨj(x),

• The lower the order of the schema, the

fewer the number of terms in the

summation.

Aalto University: Summer 2017 75

Schema Average Fitness

Schema Fitness Averages⋆ ⋆ ⋆ w1

⋆ ⋆ 0 w0 + w1

1 ⋆ ⋆ w0 − w4

⋆01 w0 − w1 + w2 − w3

11⋆ w0 − w2 − w4 + w6

001 w0 − w1 + w2 − w3 + w4 − w5 + w6 − w7

Fitness averages as partial Walsh sums ofsome schemata.

Aalto University: Summer 2017 76

Easy and Hard Problems for the GA

Goldberg’s minimal deceptive functions

using Walsh coefficients

• Two Types of Minimal Deceptive

Functions.

• Fully 3 − bit Deceptive Function:

If 111 is the optimal point, then all

order-one schemata lead away from it.

In other words:

f(⋆ ⋆ 1) < f(⋆ ⋆ 0),

f(⋆1⋆) < f(⋆0⋆),

f(1 ⋆ ⋆) < f(0 ⋆ ⋆).

Similarly, for order-two schemata:

f(⋆00) > f(⋆01),

f(⋆00) > f(⋆10),

f(⋆00) > f(⋆11).

Aalto University: Summer 2017 77

Goldberg’s ANODE

Analysis of Deception

• Goldberg used neighborhood arguments

in:

ANODE: analysis of deception:

an algorithm for determining whether and

to what degree a coding-function

combination is deceptive.

• The diagnostic is problem-instance

dependent.

Aalto University: Summer 2017 78

Haar Functions

Haar Functions

• Functions were proposed by the

Hungarian mathematician Haar in 1910.

• Haar got his PhD from Germany.

Thesis title:

Zur Theorie der Orthogonalen

Funktionensysteme.

• Haar functions take values of 1, 0 and −1,

multiplied by powers of√

2.

Aalto University: Summer 2017 79

Haar Functions

Haar Functions

H0(x) = 1 for 0 ≤ x < 2ℓ

H1(x) =

{

1 for 0 ≤ x < 2ℓ−1

−1 for 2ℓ−1 ≤ x < 2ℓ

H2(x) =

{ √2 for 0 ≤ x < 2ℓ−2

−√

2 for 2ℓ−2 ≤ x < 2ℓ−1

0 elsewhere in [0,2ℓ)

H3(x) =

{

0 for 0 ≤ x < 2ℓ−1√2 for (2)2ℓ−2 ≤ x < (3)2ℓ−2

−√

2 for (3)2ℓ−2 ≤ x < (4)2ℓ−2

...

H2q+m(x) =

{

(√

2)q for (2m)2ℓ−q−1 ≤ x < (2m + 1)2ℓ−q−1

−(√

2)q for (2m + 1)2ℓ−q−1 ≤ x < (2m + 2)2ℓ−q−1

0 elsewhere in [0,2ℓ)

...

H2ℓ−1(x) =

{

(√

2)ℓ−1 for 2(2ℓ−1 − 1) ≤ x < 2ℓ − 1−(

√2)ℓ−1 for 2ℓ − 1 ≤ x < 2ℓ

0 elsewhere in [0,2ℓ)

For every value of q = 0,1, . . . , ℓ− 1, we have m = 0,1, . . . ,2q − 1.

Aalto University: Summer 2017 80

Haar functions on [0,8)

Haar functions on [0,8)

Aalto University: Summer 2017 81

Haar Functions

Haar funcions on [0,8)

x H0(x) H1(x) H2(x) H3(x) H4(x) H5(x) H6(x) H7(x)

000 1 1√

2 0 2 0 0 0

001 1 1√

2 0 -2 0 0 0010 1 1 -

√2 0 0 2 0 0

011 1 1 -√

2 0 0 -2 0 0

100 1 -1 0√

2 0 0 2 0

101 1 -1 0√

2 0 0 -2 0110 1 -1 0 -

√2 0 0 0 2

111 1 -1 0 -√

2 0 0 0 -2index j 0 1 2 3 4 5 6 7degree q undef 0 1 1 2 2 2 2order m undef 0 0 1 0 1 2 3

Haar functions H2q+m(x) for ℓ = 3.

Aalto University: Summer 2017 82

Haar Functions

• The set {Hj(x) : j = 0,1,2, . . . ,2ℓ − 1}forms a basis for the fitness functions

defined on the integers in [0,2ℓ).

•f(x) = Σ2ℓ−1

j=0 hj Hj(x),

• hj’s, for j = 2q + m, are the Haar

coefficients given by:

hj =1

2ℓΣ2ℓ−1

x=0 f(x) Hj(x).

• The higher q, the smaller the subinterval

with non-zero values for Hj(x). Each

Haar coefficient depends only on the local

behavior of f(x).

Aalto University: Summer 2017 83

Haar Functions

Haar coefficients and Haar functions

• Haar Coefficients

Every Haar coefficient of degree q has at

most 2ℓ−q non-zero terms.

The linear combination of each Haar

coefficient hj, where j = 2q + m, has at

most 2ℓ−q non-zero terms.

h0 has at most 2ℓ non-zero terms.

• Haar Functions

For any fixed value x ∈ [0,2ℓ), f(x) has at

most ℓ + 1 non-zero terms.

Aalto University: Summer 2017 84

Comparison between Walsh and Haar Functions

• Total number of terms required for the

computation of the expansion of f(1011):

Walsh is 256 (16 × 16);

Haar is 46 (16 each for h0 and h1;

8 for h3, 4 for h6, and 2 terms for h13).

• For ℓ = 20, there are about 240 ≈ 1012

more terms using Walsh expansion.

• wj depends on the behavior of f(x) at all

2ℓ points.

hj depends only on the local behavior of

f(x) at a few points which are “close

together”

• When used to approximate continuous

functions: Walsh expansions might

diverge at some points, whereas Haar

expansions always converge.

Aalto University: Summer 2017 85

Comparison between Walsh and Haar Functions

Computing the number of non-zero terms

Non-zero terms Total num of non-zero termsSchema Walsh Haar Walsh Haar

**** 1 1 16 16***d 4 20 64 64**d* 4 10 64 64*d** 4 6 64 64d*** 4 4 64 64**dd 16 36 256 160*d*d 16 28 256 160d**d 16 24 256 160*dd* 16 20 256 160d*d* 16 16 256 160dd** 16 12 256 160*ddd 64 56 1024 352d*dd 64 48 1024 352dd*d 64 40 1024 352ddd* 64 32 1024 352dddd 128 80 2048 736

Total 469 433 7952 3376

Computing schemata for ℓ = 4 with Walsh and Haarfunctions.

Aalto University: Summer 2017 86

Comparison between Walsh and Haar Functions

Maximum number of non-zero terms for

d**d

For example: d**d:

E = {0**0,0**1,1**0,1**1}.Average fitness of 1**0 with Walsh functions:

f(1**0) = w0 + w1 − w8 − w9.

E has 4 schemata, the maximum number of

non-zero terms for all schemata represented

by d**d is 4 × 4 = 16 (2nd column).

Each Walsh coefficient requires 16 terms for

its computation.

So total number of terms required in the

computation of the expansion of f(1**0) is

4 × 16; and that of all schemata represented

by d**d, 4 × 64 (column 4).

Aalto University: Summer 2017 87

Comparison between Walsh and Haar Functions

Maximum number of non-zero terms for

d**d

With Haar functions:

f(1**0) = h0 − h1 +1

4(h12 + h13 + h14 + h15).

The third column has: 4 × 6.

Two terms are required for the computation

of each of h12, h13, h14, and h15, while 16

are needed for h0 and 16 for h1.

Forty terms are required in the computation

of the expansion of the other 3 schemata in

E, therefore, the total is 4 × 40.

Aalto University: Summer 2017 88

Fast Transforms

Fast Transforms

By taking advantage of the many repetitive

computations performed with orthogonal

transformations, the analysis can be

implemented to form fast transforms.

These are in-place algorithms and were

modelled after the fast Fourier transform

The fast transforms can be implemented

with:

• on the order of at most ℓ2ℓ

computations in the case of fast Walsh

transforms;

• and on the order of 2ℓ for the fast

Haar transforms.

Aalto University: Summer 2017 89

Fast Transforms

Fast Haar Transform

Aalto University: Summer 2017 90

Fast Transforms

The Fast Walsh-Haar Transform

Aalto University: Summer 2017 91

Application Problems

Applications II

• DNA Fragment Assembly Problem.

• Tracking a Criminal Suspect.

• Genetic Programming.

Aalto University: Summer 2017 92

Applications II: DNA Fragment Assembly [SM97

DNA Fragment Assembly

• In large scale DNA sequencing, we are

given a collection of many fragments of

short DNA sequences.

• The fragments are approximate substrings

of a very long DNA molecule.

• The Fragment Assembly Problem

consists in reconstructing the original

sequence from the fragments.

Aalto University: Summer 2017 93

The DNA Fragment Assembly Problem

DNA Fragment Assembly

• It is impossible to directly sequence

contiguous stretches of more than a few

hundred bases.

• On the other hand, there is technology to

cut random pieces of long DNA molecule

and to produce enough copies of the

piece to sequence.

• A typical approach to sequence long DNA

molecules is to sample and then sequence

fragments from them.

• The problem is that these pieces have to

be assembled.

Aalto University: Summer 2017 94

The DNA Fragment Assembly Problem

DNA Fragment Assembly

• In sequencing DNA, the approximate

length of the target sequence is known

within 10 percent.

• It is impossible to sequence the entire

molecule directly.

• Instead, we obtain a piece of the molecule

starting at a random position in one of

the strands and sequence it in the

canonical direction for a certain length.

• Each such sequence is called a fragment.

Aalto University: Summer 2017 95

The DNA Fragment Assembly Problem

Fragments of a DNA Molecule

Each fragment corresponds to a substring of

one of the strands of the target molecule.

We do not know:

• which strand the fragment belongs to,

• the position of the fragment relative to

the beginning of the strand,

• if the fragment contains errors.

Aalto University: Summer 2017 96

The DNA Fragment Assembly Problem

• A large number of fragments are obtained

by a sequencing technique known as the

shotgun method.

• The reconstruction of the target

molecule’s sequence is based on fragment

overlap.

• Fragment lengths vary from 200 to 700

bases.

• Target sequences are between 30,000 and

100,000 base-pairs.

• The total number of fragments is between

500 and 2000. The problem consists in

obtaining the whole sequence of the

target DNA molecule. In other words,

piecing together a collection of fragments.

Aalto University: Summer 2017 97

The DNA Fragment Assembly Problem

DNA Fragment Assembly [All99]

Aalto University: Summer 2017 98

The DNA Fragment Assembly Problem

Complicating Factors

DNA sequencing is very challenging since:

• Real problem instances are very large.

• Many fragments contain errors:

– Base call errors

– Chimeras

– Vector contamination

• The orientation of the fragments is

frequently unknown; and both strands

must be analyzed.

• There might be a lack of coverage.

Aalto University: Summer 2017 99

The DNA Fragment Assembly Problem

Modelling the Fragment Assembly

Problem

Models of the fragment assembly problem:

• Shortest Common Superstring

• Reconstruction

• Multicontig

None addresses the biological issues

completely.

They all assume that the fragment collection

is free of contamination and chimeras.

Aalto University: Summer 2017 100

Encoding for the Fragment Assembly

Problem

Given fragments 0,1,2, . . . , n − 1,

I = f [0], f [1], . . . , f [n − 1] is an ordering of the

fragments, where f [i] = j denotes that

fragment j appears in position i of the

ordering.

Since the strings are permutations of the

fragments, operators that have traditionally

been used with permutation problems, such

as the Travelling Salesperson Problem, can

be used.

Aalto University: Summer 2017 101

The DNA Fragment Assembly Problem

Fitness Functions for the Fragment

Assembly Problem [PFB95]

Two fitness functions have been tested.

1. Function F1 gives the overlap strength of

directly adjacent fragments in the

ordering I.

F1(I) =n−2∑

i=0

wf [i],f [i+1]

The genetic algorithm attempts to

maximize F1(I), thus favoring layouts

that contain adjacent fragments with

strong overlaps.

Aalto University: Summer 2017 102

The DNA Fragment Assembly Problem

Fitness Functions for the Fragment

Assembly Problem

2. Fitness function F2 attempts to do more

than F1.

F2 considers the overlap strenths among

all pairs of fragments. It penalizes layouts

in which fragments with strong overlap

are far apart.

F2(I) =n−1∑

i=0

n−1∑

j=0

|i − j| · wf [i],f [j]

The genetic algorithm attempts to

minimize F2(I) by using the absolute

value of the distance of the fragments in

the layout.

Aalto University: Summer 2017 103

The DNA Fragment Assembly Problem

Problem Instances

The fragment data sets where artificially

generated from actual DNA sequences.

DNA sequenceAccession numberLength in base pairs

HUMATPKOI M55090 2026HUMMHCFIB X60189 3835HUMAPOBF M15421 10089

The parent DNA sequence was:

1. replicated by the program,

2. fragmented at random locations to derive

a fragment set.

Genetic Algorithms were successful with

10KB-parent sequences and with a seven-fold

base coverage on the average.

Aalto University: Summer 2017 104

Other Applications: Tracking Criminal Suspect [CJ91]

Tracking a Criminal SuspectThrough “Face-Space” with aGenetic Algorithmby C. Caldwell and V. Johnston

Aalto University: Summer 2017 105

Other Applications: Tracking Criminal Suspect [CJ91]

Tracking a Criminal Suspect

• Humans have excellent facial recognition

ability.

• GA relies on the fact that “recognition” is

stronger than “recallection”.

• Witness rates twenty chosen pictures

according to its resemlance to the culprit.

• Twenty more pictures are shown after

crossover and mutation, etc.

Aalto University: Summer 2017 106

Other Applications: Genetic Programming [Koz92]

Genetic Programming

• The structures undergoing adaptation in

Genetic Programming are general,

hierarchical computer programs of

dynamically varying size and shape.

• The search space consists of all possible

computer programs composed of

functions and terminals appropriate to

the problem domain.

Aalto University: Summer 2017 107

Concluding Remarks

Conclusion

• Simple Genetic.

Grouping Genetic Algorithms.

Genetic Programming.

Other Evolutionary-based Algorithms:

Evolution Strategies and Evolutionary

Programming.

• Seeding the initial population seems to

work well.

• More experimentation with repair

mechanism.

• Hybrid Algorithms and Parallel Genetic

Algorithms.

Aalto University: Summer 2017 108

Concluding Remarks

• Static nature of the analysis.

More dynamic models of genetic

algorithms are needed.

• What problems are suitable for Genetic

Algorithms?

Weak classification of problems between

hard and easy.

• The study of Genetic Algorithms is still in

its embryonic stage.

Aalto University: Summer 2017 109

References

References

1. [All99] C. Allex Computational Methods For Fast andAccurate DNA Fragment Assembly, PhD, University ofWisconsin-Madison, 1999.

2. [CJ91] C. Caldwell and V. Johnson. Tracking a CriminalSuspect through “Face-Space” with a GeneticAlgorithm, Proceedings of the Fourth InternationalConference on Genetic Algorithms, San Diego, CA, 1991,pp. 416-421.

3. [CW93] A. Corcoran and R. Wainwright. LibGA: AUser-friendly Workbench for Ordered-based GeneticAlgorithm Research, Proceedings of the 1993ACM/SIGAPP Symposium on Applied Computing, ACMPress, 1993, pp. 111-117.

4. [Fal93] E. Falkenauer. The Grouping Genetic Algorithms- Widening the Scope of Genetic Algorithms, BelgianJournal of Operations Research, Statistics and ComputerScience, vol. 33, 1993, pp. 416-421.

5. [Gol89] D. Goldberg. Genetic Algorithms in Search,Optimization, and Machine Learning, Addison-Wesley, NY,1989.

6. [Hol75] J. Holland. Adaptation in Natural and ArtificialSystems, The University of Michigan Press, Ann Arbor,1975.

7. [KB90] S. Khuri and A. Batarekh. Heuristics for theInteger Knapsack Problem, Proceedings of the Xth

International Conference of the Chilean Computer ScienceSociety, Santiago, Chile, 1990, pp. 161-172.

Aalto University: Summer 2017 110

References

8. [KBH94] S. Khuri, T. Back and J. Heitkotter. AnEvolutionary Approach to Combinatorial OptimizationProblems, Proceedings of the 22nd ACM Computer ScienceConference, ACM Press, NY, 1994, pp. 66-73.

9. [KC97] S. Khuri and T. Chiu. Heuristic Algorithms forthe Terminal Assignment Problem, Proc. of the 1997ACM/SIGAPP Symp. on App. Comp., ACM Press, 1997.

10. [KWS00] S. Khuri, T. Walters and Y. Sugono. A GroupingGenetic Algorithm for Coloring the Edges of Graphs,Proceedings of the 2000 ACM/SIGAPP Symposium onApplied Computing, ACM Press, 2000.

11. [Koz92] J. Koza. Genetic Programming: On theProgramming of Computers by Means of Natural Selection,Cambridge, MA, MIT Press, 1992.

12. [SM97] J. C.Setubal and J. Meidanis. Introduction toComputational Molecular Biology, PWS PublishingCompany, Boston, 1997.

13. [PFB95] R.J. Parsons, S. Forrest, C. Burks. GeneticAlgorithms, Operators, and DNA Fragment Assembly,Machine Learning 21(1-2), pp. 11-33, 1995.

14. [Whi94] D. Whitley. A Genetic Algorithm Tutorial,Statistics and Computing, vol. 4, 1994, pp. 65-85.

Aalto University: Summer 2017 111

More Information

Where to go for More Information

Books and Articles:

1. T. Back, D. Fogel, and Z. Michalewicz. Handbook ofEvolutionary Computation, Oxford University Press, UK,1997.

2. D. Fogel. Evolutionary Computation, IEEE Press, NJ,1995.

3. Z. Michalewicz. Genetic Algorithms + Data Structures= Evolution Programs, Springer-Verlag, NY, 3rd ed., 1996.

4. M. Mitchell. An Introduction to Genetic Algorithms, TheMIT Press, Cambridge, MA, 1998.

5. C. Prince, R. Wainwright, D. Schoenfield, and T. Tull.GATutor: A Graphical Tutorial System for GeneticAlgorithms, SIGCSE Bulletin, vol. 26, ACM Press, 1994,pp. 203-212.

6. H.P. Schwefel. Evolution and Optimum Seeking,John-Wiley, NY, 1995.

Aalto University: Summer 2017 112