Finding Near Optimal Solution For Graph Coloring Problem Using Parallel Genetic Algorithm PDF
Finding Near Optimal Solution For Graph Coloring Problem Using Parallel Genetic Algorithm PDF
Abstractin this paper a new parallel genetic algorithm is the vertex set into k independent sets, and the terms k-
proposed to find near optimal solution for k-graph coloring partite and k-colorable have the same meaning.
problem. In the algorithm we have applied a coarse-grained
model of parallelism, along with two new algorithms for cros- Problem (k-GCP): Let G=(V,E) be a connected graph where
sover and mutation are represented: FCX and Fmm. these V is set of vertices (|V|=n), EVV is set of edges and
algorithms compared with CEXs First Fit and Transposition kN+ is a number of colors used. Our target is to find: :
mutation operators. We will see that combining FCX and
Fmm will yield more correct solutions in better time. In com- V1,2,3,,k (u,vV and [u,v]E) subject that (v)
puter simulations of PGA we used DIMACS benchmark. (u).
Key wordsparallel genetic algorithm; Graph coloring There are already different algorithms for crossover oper-
problem; FCX; Fmm; migration model; migration strategy ator, including SPPX, UISX, GPX and CEX [2] which are
applicable to GCP, however as shown in [2] CEX is more
1. Introduction efficient than others finding correct solution.
Genetic Algorithms are the most recognized form of evo- In this paper two new breeding operators for coloring
lutionary algorithms. They are being applied successfully to chromosomes are proposed: FCX (Find Conflict Crossover)
find acceptable solutions to problems in business, engineer- that is an extended version of CEX (Conflict Elimination
ing, and science .GAs are generally able to find good solu- Crossover) [2], and FMM (Find Maximum mutation) in
tions in reasonable amount of time, but as they are applied which conflicts are substituted by randomly chosen color.
to harder and bigger problems there is an increase in the The graph coloring instances for feeding our approach are
time required to find adequate solutions. Fortunately, GAs taken from [7, 8, 9], these instances are presented in DI-
work with a population of independent solutions, which MACS standard format.
makes it feasible to distribute the computational load among
several processors. Indeed, some may say that GAs are 2. Genetic Operators for k-GCP
embarrassingly parallel programs, and that it is trivial to
make fast parallel GAs [1]. In order to achieve better results, some parameters and
specifications need to be explained. Encoding in genomes,
We have applied parallel genetic algorithm to represent a methods for Genetic Operators, selection function, defining
new algorithm for GCP (graph coloring problem). Graph a proper fitness function, and Migration Topology have
coloring problem (GCP) belongs to the class of NPhard considerable influence on how much the results are optimal.
combinatorial optimizations problems. GCP is defined for In this section we try to explain some of these parameters in
an undirected graph as a problem of assignment of available our PGA.
colors to graph vertices providing that adjacent vertices are
assigned different colors and the number of colors is mi- 2.1. Chromosome Representation
nimal [2]. The first decision which has direct impact on perfor-
A coloring using at most k colors is called a (proper) k- mance is chromosome structure. Assignment representation
coloring. The smallest number of colors needed to color a and partition representation are widely used for k-GCP. In
graph G is called its chromatic number, (G). A graph that assignment representation, each genome is represented as a
can be assigned a (proper) k-coloring is k-colorable, and it vertex assignment array which contains the colors assigned
is k-chromatic if its chromatic number is exactly k. A sub- to the vertices. For instance, value j at index i means that
set of vertices assigned to the same color is called a color color Cj is assigned to vertex Vi. On the other hand, in parti-
class; every such class forms an independent set. Thus, a k- tion representation, each genome is represented as a parti-
coloring is the same as a partition of tion of graph vertices. Every member of a subset in the par-
tition has a same color.
246 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security,
Example 1
Two parents represent different 4-coloring of a graph
with 10 vertices i.e. sequences par1=<1,2,4,3,1,4,4,3,1,2>
and par2=<1,3,4,3,2,4,1,2,1,2>. Vertices with color con-
flicts are marked bold and underlined. As example1 shows
both par1 and par2 have 6 vertices with feasible colors and
Fig.1. examples of both representation methods 4 vertices with color conflicts. Replacing the vertices with
color conflicts in par1 by vertices with color conflicts in
For example, if value i is a member of subset j in parti- other parent, we obtain the following two chromosomes:
tion representation, it means that color Cj is assigned to ver- child1=<3,2,3,3,1,4,1,3,1,2> and
tex Vi in the graph [3]. child2=<1,1,4,4,2,4,1,2,4,2>. It is observed that obtained
chromosomes represent now two different 4-coloring of the
In our algorithm assignment representation is used. Fig.1
given graph and the number of color conflicts is now re-
shows examples of both representation methods for given
duced to 3 in child1 and reduced to 0 in child2 chromo-
graph.
somes (No conflicts in child2). (See Fig.1)
2.2. Find Conflict Crossover
2.3. Conflict Elimination Crossover
The proposed algorithm works in two phase. In first
In conflictbased crossovers for GCP, an assignment re-
phase when two selected chromosomes have unequal con-
presentation of coloring is used and offspring try to copy
flicts, CEX algorithm is applied [2]. In second phase when
conflictfree colors from their parents.
two selected chromosome have equal conflicts, our algo-
rithm is applied. Conflict Elimination Crossover (CEX) reveals some simi-
larity to the classical crossover. Each parental chromosome
However, as our experiments show just in 40% of cros- is partitioned into two blocks. The first block consists of
sover operations CEX is called and rest of operations use conflictfree nodes while the second block is built of the
FCX. (See Fig.2 and Fig.3) remaining nodes that break the coloring rules. The last
block in both chromosomes is then replaced by correspond-
Procedure coloring-crossover: ing colors taken from the other parent. This recombination
Begin scheme provides inheritance of all good properties of one
Create first population randomly; parent and gives the second parent a chance to reduce the
Evaluate fitness of chromosomes; number of existing conflicts. However, if a chromosome
Repeat represents a feasible coloring the recombination mechanism
Select two parents; is not working. Therefore, the recombination must be com-
If num.Ofconflict [par.1] = bined with an efficient mutation mechanism. The operator
num.Ofconflict [par.2] CEX is almost as simple and easy to implement as the clas-
Call FCX; sical crossover (see Fig.4) [2].
Crossover Else
Call CEX; Procedure: CEX (p,r,s,t)
End if; Begin
If (threshold) s = r;
Call FMM; t = p;
If (convergence is not acceptable)
Copy conflict-free vertices Vcfp from p to s;
Call FMM;
Until condition is satisfied; Copy conflict-free vertices Vcfr from r to t;
End.
End
Fig.2. the main body of algorithm Fig.4. The recombination operator CEX.
247 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security,
Fig 5. An illustration of CEX crossover (see Example 2) We have used function (1) for evaluating chromosomes
quality:
Example 2 Pen(c) conflict(u, v) 1 ,
(u, v)E
(1)
248 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security,
249 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security,
250 http://sites.google.com/site/ijcsis/
ISSN 1947-5500