Genome Rearrangements: from Biological Problem to Combinatorial Algorithms (and back)
Combinatorial Problem
-
Upload
reece-moon -
Category
Documents
-
view
57 -
download
1
description
Transcript of Combinatorial Problem
![Page 1: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/1.jpg)
1
Combinatorial Problem
![Page 2: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/2.jpg)
2
Graph Partition
Undirected graph G=(V,E)V=V1V2, V1V2=
minimize the number of edges connect V1 and V2
![Page 3: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/3.jpg)
3
Graph Partition
Binary coding: 0-->V1, 1-->V2Fitness function: the number of edges connect V1 and
V2
![Page 4: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/4.jpg)
4
Knapsack
max pi xis.t. sixiC xi={0,1}
![Page 5: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/5.jpg)
5
Binary coding
0-->not in the knapsack1-->in the knapsackThe problem is how to get feasible solution
![Page 6: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/6.jpg)
6
Penalty function
fitness= pi xi+g(x)If si xiC, then g(x)=0If si xi>C, then g(x)=(C- si xi)
![Page 7: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/7.jpg)
7
Repair algorithm
If the chromosome is not feasible, choose some genes and convert them to 01) Random choose the genes2) Choose according to the order of pi/si
![Page 8: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/8.jpg)
8
Crossover
c1=p1 AND p2c2=p1 OR p2
![Page 9: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/9.jpg)
9
Permutations: Now it Gets Interesting!
Use permutations when bit strings fall short: TSP Knapsack Graph coloring N Queens
![Page 10: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/10.jpg)
10
TSP
The expression of the chromosome Ordinal Adjacency Path
![Page 11: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/11.jpg)
11
Ordinal expression
The ith gene belongs to the region [1,n-i+1]. It determines which city will be chosen from the city list.City list (1 2 3 4 5 6 7 8 9)Chromosome ( 1 1 2 1 4 1 3 1 1)Then the path is (1 2 4 3 8 5 9 6 7)
![Page 12: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/12.jpg)
12
Adjacency expression
If and only if go from city i to j, city j is on the position i
chromosome (2 4 8 3 9 7 1 5 6) path (1 2 4 3 8 5 9 6 7)
For every path there is only one adjacency expression, some adjacency expression may be illegal.
(2 4 8 1 9 3 5 7 6) will leads to (1 2 4 1)
![Page 13: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/13.jpg)
13
Crossover
Alternating edgesSubtour chunksHeuristic crossover
![Page 14: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/14.jpg)
14
Alternating edges
Build an offspring by choosing (at random) an edge from the first parent, then selects an appropriate edge from the second parent, etc.----The operator extends the tour by choosing edges from alternating parents. If the new edge (from one of the parents) introduces a cycle into the current (still partial) tour, the operator selects instead a (random) edge from the remaining edges which does not introduce cycles.
It can be considered as uniform crossover.
![Page 15: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/15.jpg)
15
p1=(2 3 8 7 9 4 1 5 6) tour1=(1 2 3 8 5 9 6 4 7)p2=(7 5 1 6 9 2 8 4 3) tour2=(1 7 8 4 6 2 5 9 3)The offspring might bec=(2 5 8 7 9 4 1 6 3) tour=(1 2 5 9 3 8 6 4 7)The process starts from the edge (1,2) from p1. The
6th edge should be (6,4) because of the edge (1,2). The 8th edge could be neither (8 5) nor (8 4). It could only be one of (8 3) and (8 6). Since (8 3) will introduce a premature cycle, the 8th edge has to be (8 6).
![Page 16: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/16.jpg)
16
Subtour chunksConstruct an offspring by choosing a (random length) subtour from one of the parents, then choosing a (random length) subtour from another parent, etc. ---- the operator extends the tour by choosing edges from alternating parents, Again if some edge (from one of the parents) introduces a cycle into the current (still partial) tour, the operator selects instead a (random) edge from the remaining edges which does not introduce cycles.
![Page 17: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/17.jpg)
17
Heuristic crossover
Build an offspring by choosing a random city as the starting point for the offspring’s tour. Then it compares the two edges (from both parents) leaving this city and selects the better (shorter) edge. The city on the other end of the selected edge serves as a starting point in selecting the shorter of the two edges leaving this city, etc. If, at some stage, a new edge would introduce a cycle into the partial tour, then the tour is extended by a random edge from the remaining edges which does not introduce cycles.
![Page 18: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/18.jpg)
18
Path expression
It is perhaps the most natural representation of a tour.
A tour(5 1 7 8 9 4 6 2 3) is represented simply as (5 1 7 8 9 4 6 2 3)
![Page 19: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/19.jpg)
19
How to Make a initial solution
for( i = 1; i <= N; i++ ) P[i] = i;for( i = 1; i <= N; i++ ){ k = random_int( N - i ); interchange P[i] with P[i + k];}This uniformly generates permutations of {1; ;N}
![Page 20: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/20.jpg)
20
Crossing Over: the Problem
Cross over the two permutations6 7 | 4 3 1 8 | 5 28 1 | 2 3 4 5 | 6 7by swapping the indicated substrings.The results are not permutations:6 7 2 3 4 5 5 28 1 4 3 1 8 6 7
![Page 21: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/21.jpg)
21
Repairing the Crossover Damage
PMX: "partially matched crossover"OX: "ordered crossover"CX: "cycle crossover"
![Page 22: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/22.jpg)
22
PMX: Partially Matched Crossover
Build an offspring by choosing a subsequence of a tour from one parent and preserving the order and position of as many cities as possible from the other parent.
A subsequence of a tour is selected by choosing two random cut points, which serve as boundaries for swapping operations.
![Page 23: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/23.jpg)
23
p1=(1 2 3 | 4 5 6 7 | 8 9)p2=(4 5 2 | 1 8 7 6 | 9 3)First the segments between cut points are swappedc1=(x x x | 1 8 7 6 | x x)c2=(x x x | 4 5 6 7 | x x)This swap defines also a series of mappings:1--4 8--5 7--6 6--7
![Page 24: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/24.jpg)
24
We can fill further cities (from the original parents), for which there is no conflict:
c1=(x 2 3 | 1 8 7 6 | x 9)c2=(x x 2 | 4 5 6 7 | 9 3)
![Page 25: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/25.jpg)
25
Finally the first x in c1 (which should be 1, but there is a conflict) is replaced by 4 because of the mapping 1--4. Similarly the second x in the offspring c1 is replaced by 5, and the x and x in the c2 are 1 and 8.
c1=(4 2 3 | 1 8 7 6 | 5 9)c2=(1 8 2 | 4 5 6 7 | 9 3)
![Page 26: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/26.jpg)
26
OX: Ordered Crossover
Build offspring by choosing a subsequence of a tour from one parent and preserving the relative order of cities from the other parent.
p1=(1 2 3 | 4 5 6 7 | 8 9)p2=(4 5 2 | 1 8 7 6 | 9 3)
![Page 27: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/27.jpg)
27
First the segments between cut points are copied into offspring
c1=(x x x | 4 5 6 7 | x x)c2=(x x x | 1 8 7 6 | x x)
![Page 28: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/28.jpg)
28
Next, starting from the second cut point of one parent, the cities from the other parent are copied in the same order, omitting symbols already present. Reaching the end of the string, we continue from the first place of the string. The sequence of the cities in the second parent (from the second cut point) is
(9 3 4 5 2 1 8 7 6) (p2=(4 5 2 | 1 8 7 6 | 9 3))
![Page 29: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/29.jpg)
29
After removal of cities 4, 5, 6 and 7, which are already in the first offspring, we get
(9 3 2 1 8)This sequence is placed in the first offspring (starting
from the second cut point) c1=(2 1 8 | 4 5 6 7 | 9 3)Similarly we get the other offspring c2=(3 4 5 | 1 8 7 6 | 9 2)
![Page 30: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/30.jpg)
30
The OX crossover exploits a property of the path representation, that the order of cities (not their positions) are important, i.e., the two tours
(9 3 4 5 2 1 8 7 6)(4 5 2 1 8 7 6 9 3)are in fact identical
![Page 31: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/31.jpg)
31
CX: Cycle Crossover
Build offspring in such a way that each city (and its position) comes from one of the parents.
p1=(1 2 3 4 5 6 7 8 9) p2=(4 1 2 8 7 6 9 3 5)would produce the first offspring by taking the first
city from the first parent c1=(1 x x x x x x x x)and c2=(4 x x x x x x x x)
![Page 32: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/32.jpg)
32
Since every city in the offspring should be taken from one of its parents (from the same position), we dot have any choice now: the next city to be considered must be city 4, as the city from the p2 just “below” the selected city 1. In p1 this city is at position ‘4’, thus
c1=(1 x x 4 x x x x x)and c2=(1 x x 8 x x x x x)
![Page 33: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/33.jpg)
33
This, in turn, implies city 8, as the city from p2 just “below” the selected city 4. Thus
c1=(1 x x 4 x x x 8 x)Following this rule, the next cities to be included in
the first offspring are 3 and 2.However, that the selection of city 2 requires
selection of city 1, which is already on the list----thus we have completed a cycle
c1=(1 2 3 4 x x x 8 x)
![Page 34: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/34.jpg)
34
The remaining cities are filled from the other parentc1=(1 2 3 4 7 6 9 8 5)Similarly c2=(4 1 2 8 5 6 7 3 9)The CX preserves the absolute position of the
elements in the parent sequence.
![Page 35: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/35.jpg)
35
Comparison
p1=(1 2 3 | 4 5 6 7 | 8 9) p2=(4 5 2 | 1 8 7 6 | 9 3)PMXc1=(4 2 3 | 1 8 7 6 | 5 9) c2=(1 8 2 | 4 5 6 7 | 9 3)OXc1=(2 1 8 | 4 5 6 7 | 9 3) c2=(3 4 5 | 1 8 7 6 | 9 2)CXc1=(1 5 2 4 8 6 7 9 3) c2=(4 2 3 1 5 7 6 8 9)
![Page 36: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/36.jpg)
36
Exercise
p1=(9 8 7 | 6 5 4 3 | 2 1) p2=(4 5 2 | 1 8 7 6 | 9 3)
PMXc1=( ) c2=( )OXc1=( ) c2=( )CXc1=( 9 5 x 6 x x x x x) c2=( )
![Page 37: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/37.jpg)
37
Answer
p1=(9 8 7 | 6 5 4 3 | 2 1) p2=(4 5 2 | 1 8 7 6 | 9 3)PMXc1=(9 5 4 | 1 8 7 6 | 2 3) c2=(7 8 2 | 6 5 4 3 | 9 1)OXc1=(1 8 7 | 6 5 4 3 | 9 2) c2=(5 4 3 | 1 8 7 6 | 2 9)CXc1=(9 5 7 6 8 4 3 2 1) c2=(4 8 2 1 5 7 6 9 3)
![Page 38: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/38.jpg)
38
Mutation
inversion: the substring between the two selected points is reversedinsertion: selects a city and inserts it in a random placedisplacement: selects a subtour and inserts it in a random placereciprocal exchange: swaps two cities
![Page 39: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/39.jpg)
39
Knapsack again: Permutation expression
Let the GA creatures be permutations of (1; ;n):Interpret this as a object placement:If the placement of one object cause the solution
infeasible, delete this object and consider the next one.
![Page 40: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/40.jpg)
40
Graph coloring
Undirected graph G=(V,E) and n colorsEvery two vertexes connected can not be given the
same colorMaximize the total weight of the colored vertexes
![Page 41: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/41.jpg)
41
Greedy algorithm
Sort the vertexes according to their weightChoose the vertex according to the rank, try to color that vertexEg: (9 7 8 4 2 6 5 1 3)one colorVertex 9 4 2 are colored.The total weight is 32
![Page 42: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/42.jpg)
42
Eg2: (7 3 4 1 6 5 2)one colorVertex 7 will be chosen and
the total weight is 15.The optimal solution is (1 5
3) and the total weight is 35.
Only the weight of vertex 7 is larger than 35, greedy algorithm will get the global optimum.
![Page 43: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/43.jpg)
43
Permutation expression
Let the GA creatures be permutations of (1; ;n)Individual = (c1; ; cN).Interpret this as the order of coloring process.First try to give a color to c1, then consider c2, and so on.
![Page 44: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/44.jpg)
44
N Queens
Place N mutually un-attacking Queens on an N N chess board.
(Queens attack on rows, columns, and diagonals.)
![Page 45: Combinatorial Problem](https://reader035.fdocuments.in/reader035/viewer/2022062218/568134f7550346895d9c415a/html5/thumbnails/45.jpg)
45
Permutation Is Placement
Let the GA creatures be permutations of (1; 2; ;N):Individual = (c1; ; cN).Interpret this as a Queens placement:The Queen in row k is in column ck.Fitness: number of Queens unattacked by other Queens.