kotecha03hybrid.pdf

A Hybrid Genetic Algorithm for Minimum Vertex
Cover Problem
Ketan Kotecha and Nilesh Gambhava
Department of Information Technology
G H Patel College of Engineering and Technology
Vallabh Vidyanagar 388 120, India.
[email protected], [email protected]
www.gcet.ac.in
Abstract. Minimum vertex cover problem (MVCP) is an NP-hard problem and
it has numerous real life applications. This paper presents hybrid genetic
algorithm (HGA) to solve MVCP efficiently. In this paper we have
demonstrated that when local optimization technique is added to genetic
algorithm to form HGA, it gives near to optimal solution speedy. We have
developed new heuristic vertex crossover operator (HVX) especially for
MVCP, which converges faster to the global optimal solution. HVX gives far
better results compared to classical crossover operators. We have also studied
the effect of mutation on optimal solution in MVCP.
Keywords. Heuristic vertex crossover; vertex cover; genetic algorithm; hybrid
genetic algorithm; local optimization technique
1. Introduction
Genetic Algorithms (GAs) are heuristic search algorithms premised on the
evolutionary ideas of natural selection and genetic [10]. The basic concept of GA is
designed to simulate the processes in natural system necessary for evolution,
specifically for those that follow the principle of survival of the fittest, first laid down
by Charles Darwin. As such they represent an intelligent exploitation of a random
search within a defined search space to solve a problem. GAs are best suited for those
problems, that do not have a precisely defined solving method and if it is, then by
following that method, it will take far too much time. So GAs are best suited for NPhard and optimization problems and also it can be used for other wide category of
problems [2].
A Hybrid Genetic Algorithm (HGA) combines local optimization technique
(LOT) with a classical GA. The most common form of HGA uses LOT to improve
the strings produced by genetic recombination. The resulting improvements are then
coded onto the strings processed by the GA. Here we have used same concept of
HGA to solve minimum vertex cover problem (MVCP). Our study shows that HGA
works far better compared to GA for normal graphs. GA fails to obtain consistent
results for specific type of regular graph [11][16], where as HGA still gives near to
optimal solution.
We have developed Heuristic Vertex Crossover Operator (HVX) especially for
the MVCP because it uses heuristics to create offspring and converges faster to the
global optimal solution. HVX uses problem specific information.
2. Genetic Algorithm
GA is an optimization technique based on the natural evolution. It maintains a
population of strings, called chromosomes that encode candidate solutions to a
problem. The algorithm selects some parent chromosomes from the population set
according to their fitness value [8], which are calculated using fitness function. The
fittest chromosomes have more chances of selection for genetic operations in next
generation. Different types of genetic operators are applied to the selected parent
chromosomes; possibly according to the probability of operator, and next generation
population set is produced. In every generation, a new set of artificial creatures is
created using bits and pieces of the fittest chromosomes of the old population [15].
Although GA is probabilistic, in most cases it produces better population
compared to their parent population because selected parents are the fittest among the
whole population set, and the worse chromosomes die off in successive generations.
This procedure is continued until some user defined termination criteria are satisfied.
Reproduction, crossover (recombination), mutation are widely used genetic
operators in GA. The primary objective of the reproduction is to emphasize good
solutions and eliminate bad solutions in a population. So reproduction just copies
good chromosomes from current population to next generation population. Mutation
is used rarely to avoid local minima. During crossover, two parent chromosomes are
selected on the basis of fitness and they produce new offspring by genetic
recombination. So crossover operator should be selected carefully.
3. Heuristic Vertex Crossover Operator
One-point crossover, two-point crossover, uniform crossover, partially mapped
crossover, order crossover are widely used crossover operators. When we do not have
any problem specific information and if we use binary encoding then they are best
suited. But here we have used problem specific pure literal encoding scheme [7],
which is easy to handle with HVX. HVX uses heuristic to generate offspring from
parent chromosomes, which works as follows:
Let G = (V, E), where G is undirected graph, V is the set of vertices and E
denotes the set of edges. VT and ET are vertex table and edge table respectively, v are
vertices (genes) of chromosome; P1 and P2 are two parent chromosomes selected for
crossover; in our case set of vertices for vertex cover. V’ is the solution for vertex
cover.
Algorithm HVX
begin
V’ = { }
create tables VT and ET
VT = (F(v), N(v)), where F(v) is the frequency of the vertex v in P1 and P2,
N(v) is the degree of vertex v in G, for ∀ v ∈ P1 and ∀ v ∈ P2
ET = E (x, y) for ∀ E ∈ G
while ET <> { } do
select v1 ∈ VT such that N(v1) > N(v) for ∀ v ∈ VT. If more than
one vertex has same number of degree then select that vertex, whose
frequency (F(v1)) is high. If still more than one vertex is candidate
for selection then select any vertex randomly. Say v1
ET = ET — {E(x, y)  x = v1 or y = v1)}
V’ = V’
{v1}
end while
return V’
end
Graph – 1 (Fig. 1) is used to show how HVX works. Initially chromosomes are
generated randomly by selecting vertices one by one such that all the edges are
covered. In the successive generations, two chromosomes are selected on the basis of
fitness for the HVX. Suppose for Graph -1, two parent chromosomes P1, P2 are as
shown below,
P1 = {1,3,4,6}
P2 = {1,2,3,4}
2
1
4
3
5
6
Fig. 1. Graph - 1
Now follow the procedure HVX as per below to produce offspring,
1. Create VT (Table 1) and ET (Table 2)
2. Select vertex with highest N(v) from VT. As shown in Table 3, for Run-1, it
is vertex 3
3. Remove all the edges from ET, which are connected to vertex 3
4. Add 3 to V’
Repeat this procedure until ET becomes empty and N(v) = 0 for ∀ v ∈ VT. This
procedure is shown step by step in Table 3.
Table 1. Vertex Table (VT) for Graph-1
Vertex
(v)
1
2
3
4
6
Frequency of Vertex
in Parents F(v)
2
1
2
2
1
Number of Edges Connected
to the vertex N(v)
4
4
5
3
2
Table 2. Edge Table (ET) for Graph-1
Vertex
1
2
3
4
5
6
2
1
1
1
1
2
3
3
2
2
3
3
4
4
4
3
5
6
5
6
Table 3. How HVX works is shown
Vertex
(V)
F(v)
N(v)
1
2
3
4
6
2
1
2
2
1
4
4
5
3
2
Run 1
v1 = 3
V’={3}
N1(v1)
3
3
0
2
1
Run 2
v1 = 1
V’= {3,1}
N2(v1)
0
2
0
1
1
Run 3
v1 = 2
V’ = {3,1,2}
N3(v1)
0
0
0
0
0
4. Heuristic Vertex Crossover and Schema Theory
The theory behind most GA implementations assumes that crossover and selection
change the sampling rate or hyperplanes in an n-dimensional hypercube, where n
refers to the length of some explicit or underlying binary representation of the
problem. It is easy to show that our HVX manipulates an underlying binary encoding
that conforms to the existing theory [8][10].
We have used Graph-1 (Fig.1) to demonstrate how HVX follows the schema
theorem. We have two feasible solutions.
P1 = {1, 3, 4, 6}
P2 = {1, 2, 3, 4}
For P1, it means that vertex number 1, 3, 4 and 6 are the part of solution and
vertex number 2 and 5 are not the part of solution. We can easily represent this with
binary encoding. We have 6 vertices in the graph so length of our chromosome is 6
bit. Each bit represents whether the vertex is included in solution or not and can be
shown as binary representations as per below,
Index: 1
2
3
4
5
6
P1:
1
0
1
1
0
1
P2:
1
1
1
1
0
0
Now offspring produced by HVX using P1 and P2 is V’ = {1,2,3}. So let us also
represent it as a binary string and then check for schema theorem. P1 and P2 are
instances of the schema 1X110X. Where as V’ is the instance of schema 1X100X. We
can see that fourth bit is mutated. This is due to mutation by omission.
Index: 1
2
3
4
5
6
P1:
1
0
1
1
0
1
P2:
1
1
1
1
0
0
V’:
1
1
1
0
0
0
Despite occasional explicit and implicit mutation, HVX is clearly manipulation
schemata in this representation space. Further, HVX uses only those vertices, which
are part of the parent chromosomes, so it is obvious that it follows the constructive
nature of schema theorem.
5. Local optimization technique
The idea of combining GA and LOT has been investigated extensively during the past
decade and various forms of HGA are proposed [7]. One of most common forms of
HGA involves incorporating LOT to a classical GA. With the hybrid approach, LOT
is applied to each newly generated offspring to move it to a local optimum before
inserting it into the new population. Genetic search is used to perform global
exploration among the population and LOT is used to strengthen local exploitation
around chromosomes.
In the hybrid approach, artificial organisms first pass through Darwin’s biological
evolution and then pass through Lamarckian’s intelligence evolution. A traditional
hill climbing routine is used as Lamarckian evolution to try to inject some smarts into
the offspring organism before returning it to be evaluated (Fig. 2).
In MVCP, we have a list of vertices as a solution. Initially some vertices are
required to cover some specific edges but at a later stage if we remove some vertices
then also it does not make any difference because all the edges may be covered by the
set of other vertices. Suppose in Graph-1, one feasible solution is V’ = {1,5,3,2} but if
we remove vertex 5 then also V’ = {1,3,2} covers all the edges. So this type of LOT
can be done easily and it is very much useful.
Regular graph [16] consists of three levels. The first two levels contain k + 2
vertices and third level has k vertices. Total vertices are V= 3k + 4, total number of
edges are E = (k+2)(k+1). A regular graph with k = 2 is shown in Fig. 3. For this type
of graph heuristic approach fails [16] and GA also cannot give consistent results [11].
So we have combined local optimization with GA to achieve global optimal solution
consistently.
Fig. 2. Hybridization of GA with local optimization
Fig. 3. Regular Graph with k = 2, V = 10, E = 12
6. Hybrid Genetic Algorithm
The fitness function plays an important role in GA because it is used to decide how
good a chromosome is. Our fitness function is the number of vertices used to cover all
the edges of the graph.
V
F=
i =1
Vi
where Vi = 1, if Vi ∈ V’, else 0
In HGA, one offspring is produced from two parent chromosomes. So, in that
way best 50% chromosomes will directly go in the next generation using
reproduction. All the chromosomes are used to create offspring using HVX. Because
we believe that each chromosome has some important genes, which may become
useful to obtain global optimal solution. Then mutation operator is applied to
offspring. Mutation is used to avoid local minima and it should be applied on all the
offspring [13].
Let P(t) be parent population and C(t) be offspring produced from P(t) in current
generation t. µ is the number of chromosomes in P(t).
Algorithm HGA
begin
t←0
initialize P(t) randomly
while (t < number_of_generation) do
evaluate P(t) using fitness function
elitism(best_found_so_far)
select best 50% chromosomes from P(t) and put them in P(t+1)
m←0
while (m < µ) do
select mth & (m+1)th chromosome from P(t)
n’ ← HVX(m, m+1)
n ← mutation(n’)
place n in C(t)
m←m+2
end while
apply LOT on C(t) and place them in P(t+1)
t←t+1
end while
return best_found_so_far from P(no_of_generation)
end
7. Experimental Results
For experiment, we have used population size µ 25, because HVX converges faster
to global optimal solution, and also LOT helps to do so. Our selection method is like
steady state selection, because in successive generations only 50 % of the current
population changes.
First we have tested HGA with regular graph consist of 100 vertices, so k = 32.
We got surprising results compared to [11]. Due to local optimization, we got global
optimal solution every time. Our results are compared with [11] in Table 4. F is
fitness value, which represents number of vertices required to cover all the edges and
N represents number of particular solution achieved from 100 runs of the algorithm.
Then we have tested different instances of various types of graphs [5] with
various numbers of vertices and edge density. These instances are available from [5].
Results are shown in Table 5. We can see that almost in all the types of graph, we got
near to global optimal solutions consistently.
Then we have tested effect of mutation and LOT on results. Experimental results
are summarized in Table 6. Considering average of the fitness value of 100 runs of
the algorithm, we can see that effect of mutation and LOT is not much except RG.20,
because RG.20 is specially constructed challenging graph. Table 6 shows average
value of fitness obtained from 100 runs of algorithm.
But effect of the mutation and LOT technique on the number of exact optimal
solution is dramatic (Fig. 4). We can see that using HGA we got nearly 100 times
optimal solution for 100 runs of algorithm, but when we don’t use either mutation or
LOT, we got very less optimal solution.
Table 4. Comparisons of Back’s result with HGA’s result
V = 100, E = 1122, V’ = 34, Simulation = 100
Back’s results
HGA’s result
F
N
F
N
34
65
34
100
66
35
Average Fitness= 45.20
Average Fitness = 34
Table 5. Experimental results obtained by HGA. 100 runs of HGA are performed
RG.20
V=50, E=225
V’ = 30
F
N
30
66
32
4
33
3
34
11
35
16
F’= 31.71
G.315
V=73, E=314
V’=50
F
N
50
51
G.346
V=88, E=395
V’ = 60
F
N
97
3
60
61
F’ = 50.09
94
6
F’ = 60.6
G.408
V=119,E=569
V’=81
F
N
81
82
G.409
V=120, E=575
V’=82
F
N
94
6
F’ = 81.06
82
83
52
48
F’ = 82.48
Table 6. Effect of mutation and LOT on optimal solution
Graph Type
Algorithm
Optimal
HGA
without mutation
without LOT
RG.20
G.315
G.346
G.408
G.409
30
31.71
38.01
38.11
50
50.09
50.35
50.20
60
60.06
60.94
60.19
81
81.06
81.62
82.89
82
82.48
83.86
83.88
8. Conclusion
In this work, we have demonstrated how LOT can be added to classical GA to form
HGA. Moreover, the results found by HGA are far better compare to classical GA,
heuristic and approximate algorithms. We have also designed HVX especially for
MVCP, which works very well and converges fast to optimal solution. With the help
of HVX and LOT, we can achieve optimal solution with less number of generation
and small population size, which is useful to converge speedy to the global optimal
solution. HVX is also applicable to same family of problem like set covering, etc…
We have also shown that mutation plays an important role to avoid local minima.
Fig. 4. Effect of mutation and LOT on the number of optimal solutions
References
1.
2.
3.
4.
R. Arakaki, and L. Lorena, “A Constructive Genetic Algorithm for the Maximal
Covering Location Problem”, in Proceedings of Metaheuristics International
Conference, 2001, pp 13-17.
T. Bäck, D. Fogel, and Z. Michalewicz, Handbook of Evolutionary Computation,
Oxford University Press, 1997.
L. Chambers, Practical Handbook of Genetic Algorithm, New York, CRC Press,
1999.
T. H. Cormen, C. E. Leiserson, and R. L. Rivest, Introduction to Algorithms. New
Delhi: Prentice-Hall, 2001.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
F. Dehne, A. Rau-Chaplin, U. Stege, P.J. Taillon, “Solving Large FPT Problems On
Coarse Grained Parallel Machines”, from http://www.dehne.net.
I. K. Evans, “Evolutionary Algorithms for Vertex Cover”, in Proceedings of seventh
International Conference on Evolutionary Programming 1998, pp 377-386, Berlin,
Springer-Verlag, 1998.
M. Gen, and R. Cheng, Genetic Algorithms & Engineering Optimization, New York,
Wiley, 2000.
D. E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning.
Massachusetts: Addison Wesley, 1989.
D. S. Hochbaum, ed., Approximation Algorithms for NP-Hard Problems, PWS
Publishing Company, 1997.
J. H. Holland, Adaptation in natural and artificial systems, MA: MIT Press, 1992.
S. Khuri and Th. Bäck: “An Evolutionary Heuristic for the Minimum Vertex Cover
Problem”, J. Hopf, editor: Genetic Algorithms within the Framework of Evolutionary
Computation, pp. 86-90,Max Planck Institut für Informatik, Saarbrücken, 1994.
V. Kommu, “Enhanced Genetic Algorihtms in Constrained Search Spaces with
Emphasis in Parallel Environments”, Ph.D. Thesis, The University of Iowa, 1993.
K. Kotecha, and N. Gambhava, “Solving Precedence Constraint Traveling Salesman
Problem using Genetic Algorithm”, in Proceedings of National Conference on
Software Agents and Embedded System, July 2003, Coimbatore.
Z. Michalewicz, Genetic Algorithms + Data Structures = Evolution Programs, 2nd
ed., New York, Springer-Verlag, 1994.
M. Mitchell, Introduction to genetic algorithms. New Delhi: Prentice-Hall, 2002.
C. H. Papadimitriou and K. Steiglitz, Combinatorial Optimization. Prentice Hall,
1982.
D. Whitley, “Modeling Hybrid Genetic Algorithms”. Genetic Algorithms in
Engineering and Computer Science, Winter, Periaux, Galan and Cuesta, eds. pp: 191201, Wiley, 1995.