Title: Genetic Algorithms for Optimized Book Embedding
1Genetic Algorithms for Optimized Book Embedding
by Katie Dahmen and Ann Kilzer
- Gonzaga University Center for Evolutionary
Algorithms
2The Traveling Salesman Problem (TSP)
- The salesman visits each city once, and returns
to the starting point (Hamiltonian Circuit) - We want to find the shortest route.
3Traveling Salesman Problem
- NP-Complete
- O(n!) - for a problem of size n (n cities), the
solution requires c n! operations for some
constant c and n gt N0. - For a computer running 1 billion operations per
sec, it would take 9.83 billion years to solve
the 24 city problem with a brute-force algorithm
(check every possible tour)
4Genetic Algorithms
- Also called Evolutionary Algorithms
- A form of artificial intelligence based on the
theory of evolution - Best solutions are combined to form better
solutions - An attempt to find optimal or near optimal
solutions to NP-Complete problems more quickly,
without checking every possible solution
5Genetic Algorithm Terminology
- Gene Contains a single element of a solution
- Ex One city in the tour, such as Butte (B).
- Chromosome Contains a solution to the problem,
often in the form of a sequence - Ex A travel route of Butte, Coeur DAlene,
Edmonton, Davenport, and Anaconda can be
represented as B-C-E-D-A. - It is assumed that we will return to the starting
city.
6Genetic Algorithm Terminology
- Population A set of possible solutions
(chromosomes) - Cost The efficiency of a solution
- Ex In a tour of cities, the total distance
traveled.
7Genetic Algorithms applied to TSP
- Randomly generate a population of solutions
(chromosomes)
SOLUTION ADBCE BACED EABDC EBACD BDCEA DECAB CEAD
B DABCE
8Genetic Algorithms applied to TSP
- Evaluate cost Find distance traveled
SOLUTION COST ADBCE 28 BACED 25 EABDC
25 EBACD 21 BDCEA 23 DECAB 25 CAEDB 31 DABCE
23
9Genetic Algorithms applied to TSP
- Sort population
- Throw out worst solutions
- Pair parents
SOLUTION COST EBACD 21
BDCEA 23 DABCE 23 BACED 25 EABDC 25 DECAB 25
ADBCE 28 CAEDB 31
SOLUTION COST EBACD 21
BDCEA 23 DABCE 23 BACED 25
10Genetic Algorithms applied to TSP
- Mate
- Two parents create two children
- Combine solutions, avoiding duplicates
- Place children in bottom half of population
BDACE EBCDA DABEC BACDE
SOLUTION COST EBACD 21
BDCEA 23 DABCE 23 BACED 25
11Mate Function How it Works
- Partially Matched Crossover A pivot point is
randomly chosen between two genes - The genes on one side of the pivot are swapped
between the parents - Duplicates are eliminated
- Now we have created two children from two
parents.
BDACE EBCDA
BDACD EBCEA
12Genetic Algorithms applied to TSP
- Mutate
- Avoid duplication by swapping genes
- We can experiment with the percent of the
population to mutate, though its usually around
5
SOLUTION COST EBACD 21
BDCEA 23 DABCE 23 BACED 25 BDACE EBCDA DAB
EC BACDE
DCBAE 22
13Genetic Algorithms applied to TSP
- 8. Redo Steps 2 - 7
- Until population converges
- or a certain number of generations
SOLUTION COST DABEC 18 EBCDA 20 BACDE
21 EBACD 21 DCBAE 22 BDCEA 23 BDACE 23 BACED
25
SOLUTION COST EBACD 21
BDCEA 23 DCBAE 22 BACED 25 BDACE 23 EBCDA 20
DABEC 18 BACDE 21
14Graph Theory
- A Graph is made up of edges and vertices
- Applications include social networks, travel
routes, and circuits
K5 graph (Complete graph with five vertices)
15Complete Graphs
K4 graph
K5 graph
16Complete Bipartite Graphs
- A Complete Bipartite Graph Kn,m can be drawn with
n vertices on one side and m vertices on the
other side. - Each vertex on the left is connected to each
vertex on the right
17Square Grids
3 x 3
4 x 4
18X - Trees
X Trees are formed by creating a binary tree,
and then connecting each level.
19Squares, Cubes, Hypercubes
Q2 Graph
Q3 Graph
Q4 Graph
20Book Embedding
- Part of Graph Theory
- NP-Complete Problem
- Our work involves applying Genetic Algorithms to
the Book Embedding Problem - This works very similar to the TSP application
21Embedding a Graph
2
1
3
4
5
- We can make a list of edges in the graph
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
22Book Embedding
- The spine is a line containing all the vertices.
A page is a half-plane extruding from the spine.
23Book Embedding
Edge 2
Edge 1
1
4
3
5
2
Edge 3
- We draw edges of a graph on a page so that they
do not cross. To avoid a collision, we begin
embedding on a new page.
24Book Embedding
Edge on Page 3
1
4
3
5
2
- Here, the first page is drawn above the spine,
and the second page below it. Additional pages
can be denoted by using patterned lines for the
edges.
25Embedding a Graph
2
1
3
4
5
- We can make a list of edges in the graph
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
26Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
27Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
28Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
29Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
30Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
31Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
32Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
33Embedding a Graph
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4 - A 2 Page Embedding
34Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
35Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
36Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
37Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
38Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
39Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
40Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4
41Embedding a Graph Reverse Order of Edge
Placement
2
1
3
4
5
- 5 4, 5 3, 4 3, 1 2, 1 4, 2 5, 2 3,
2 4 - A 3 Page Embedding of the same graph
42Book Embedding and Genetic Algorithms
- The ordering of the edge placement affects the
number of pages in the book - Our genetic algorithm tries to find the minimal
page embedding by alternating the order of the
edges placed in the book - It is also possible to adjust the page number by
manipulating the vertex ordering on the spine
43Results Complete Graphs
44Results X-Trees
45Results Square Grids
46Results Hypercube
47Results Complete Bipartite
48Future Plans
- Try to make the genetic algorithm adjust the
spine (vertex) ordering and the edge placement
ordering - Experiment with different types of graphs
49Questions?
- Katie Dahmen
- kdahmen1_at_gonzaga.edu
- Ann Kilzer
- akilzer_at_gonzaga.edu
Thank you to the McDonald Family for sponsoring
our research project.