0% found this document useful (0 votes)
41 views5 pages

Finding Near Optimal Solution For Graph Coloring Problem Using Parallel Genetic Algorithm PDF

Uploaded by

Anca Vochescu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Finding Near Optimal Solution For Graph Coloring Problem Using Parallel Genetic Algorithm PDF

Uploaded by

Anca Vochescu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

(IJCSIS) International Journal of Computer Science and Information Security,

Finding near optimal solution for Graph Coloring


Problem using Parallel Genetic Algorithm
Fardin Esmaeeli Sangari Seyed Mostafa Mansourfar Ali Hosseinalipour
Sama organization (affiliated Sama organization (affiliated Sama organization (affiliated
with Islamic Azad Universi- with Islamic Azad Universi- with Islamic Azad Universi-
ty)-Mamaghan Branch ty)-Mamaghan Branch ty)-Mamaghan Branch
[email protected] [email protected] [email protected]

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,

Procedure: FCX (par1, par2, child1, child2)


Begin
Chromosomes_length=V;
For (i=1; i<=chromosomes_length; i++)
Exchange the conflict places in par1 and par2
And replaces in child1 and child2;
End for;
End.
Fig.3. the recombination operator FCX

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,

Procedure: Fmm (chromosomes)


Begin
Select parent randomly;
X=Find index with biggest conflict in parent;
Change the parents Xth index color with- ran-
dom color;
Child=parent;
Return child;
End
Fig 6. The recombination operator Fmm

2.5. Evaluation And Selection Function

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)

Two parents represent different 5-colorings of a graph


with 10 vertices i.e. sequences p=<5,2,3,4,1,4,2,5,1,3>, and C is a solution,
r=<1,4,5,2,3,3,5,4,2,5>. Vertices with color conflicts are
marked by bold fonts. Thus, the chromosome p has 6 vertic- Pen(c) is evaluation function for a solution (Note: big-
es with feasible colors and 4 vertices with color conflicts ger value for Pen(c) means less quality solution)
while the chromosome r has 7 vertices with feasible colors
and 3 vertices with color conflicts. Replacing the vertices Conflict is a penalty function for pairs of vertices con-
with color conflicts by vertices taken from the other parent nected by an edge (u,v)E: Conflict(u,v) = 2 when c(u)
we obtain the following two chromosomes: = c(v), and Conflict(u,v) = 0, otherwise.
s=<5,2,5,2,1,3,2,5,1,5> and t=<1,4,3,2,3,3,2,4,2,3>. It is
For selection function, the tournament selection has been
observed that obtained chromosomes represent now two
applied. This method has been used widely in PGA. How-
different 4-colorings of the given and the number of color
ever in our selection method each chromosome allowed to
conflicts is now reduced to 2 in each chromosome [4]. (See
attend in competition just once, so that all chromosomes in
Fig.5)
population have equal chance of being selected. Equation
2.4. Mutation Operators (2) is our fitness function.

Transposition is a classical type of mutation that ex- 1


Fitness (2)
change colors of two randomly selected vertices in the as- Pen (c)
signment representation. The second mutation operator
called First Fit is designed for colorings in partition repre- 3. Migration Model Of Parallel Genetic Algorithm
sentation and is well suited for GCP. In the First Fit muta-
tion one block of the partition is selected at random and There are several ways to parallelize GA, and the parallel
propagate this block vertices to others using heuristic First GA (PGA) has been developed and successfully applied to
Fit such that assignment of vertices to other blocks remain optimize practical problems. According to the nature of the
them conflictfree. Thus, as a result of the First Fit mutation population structure and recombination mechanisms used,
the color assignment is partially rearranged and the number PGA can be classified into four categories: single-
of partition blocks is often reduced by one [4]. population masterslave PGA, coarse-grained PGA, fine-
grained PGA and hierarchical hybrids [5].
But we proposed a new algorithm for mutation operator
that is called Fmm (Find maximum mutation) in which al- The coarse-grained parallel GA is very popular and
gorithm selects a chromosome randomly then finds node widely used. In a coarse-grained PGA the entire population
with biggest conflict on chromosome and tries to change is divided into several sub-populations. Each sub-population
that with random color. (See Fig. 5) runs a conventional GA independently and concurrently on
their island. After several epochs, some individuals mi-
grate from one sub- population to another according to a
migration topology (see Fig.6).

248 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security,

Fig.6. Migration topology

The individuals that emigrate from an island may be se-


lected at random, or they may be selected among the best
individuals in an island. Similarly, migrants may replace
random individuals at the receiving island, or they may re-
place the worst individuals [6].
4. Experimental Results
We have used four DIMACS graph coloring benchmarks
from [7] to apply our experiments. In our PGA coarse-
grained model is implemented. In our program, the time of
computation, the number of correct answers in each genera-
tion, and different migration strategies are applied. Prepared
results are computed using Intel Pentium 2.2GHz with
512MB memory. The following parameters were applied in
our algorithm:
Population size=90, number of generations=2000, num-
ber of Island=3, number of migrants=5, migration inter-
val=15, crossover probability=0.6, mutation probability for
First Fit and Transposition=0.1. Experiments include com-
paring performance of both FCX and CEX crossover opera-
tors; it also examines efficiency of First Fit, Transposition
and Fmm mutation operators. However, Fmms mutation
probability is dynamically changes based on algorithm con-
vergence. All experiments were repeated 10 times. As you
see in Fig.7, proposed crossover operator (FCX) and Fmm
mutation, considerably converges to more correct answers
in less computation time compared to CEX (Note in Fig.7,
X-axis shows generation iteration and Y-axis shows Num-
ber of correct answers in each generation).
CONCLUSION
In this paper, a new PGA algorithm is proposed to find
near optimal solution for k-Graph Coloring Problem (k-
GCP). A new crossover and mutation algorithm called FCX
and Fmm designed in a way that successfully could find
more correct answers in reasonable time for problem. As
described before, applying FCX in case of equal conflicts
makes convergence more rapid, in addition, using coarse-
grained model for implementation along with a proper mi-
gration fraction and interval influences our results.
REFERENCES
[1] Erick Cantu-Paz David E. Goldberg, Efficient parallel genetic algo- Fig.7. Number of correct answers for 4 datasets
rithms: theory and practice, J. Computer Methods in Applied Me-
chanic and Engineering. 186, 2000, pp.221-238
[2] Zbigniew Kokosinski, Marcin Kolodziej, Krzysztof Kwarciany, Pa-
rallel Genetic Algorithm for Graph Coloring Problem, ICCS 2004,
LNCS 3036, pp. 215222

249 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security,

[3] Saeed Amizadeh, Farzad Rastegar, Caro Lucas, Incorporating Heu-


ristics In Evolutionary Optimization, J. Intelligent Information
Technology Computing, Vol.1, No.2, 2006, pp. 259-270
[4] Zbigniew Kokosinski, Krzysztof Kwarciany, Marcin Kolodziej, Ef-
ficient Graph Coloring With Parallel Genetic Algorithms, J. Compu-
ting and Informatics, Vol. 24, 2005, pp. 1001-1025
[5] Z.G. Wang, Y.S. Wong, M. Rahman, "Development of a parallel
optimization method based on genetic simulated annealing algo-
rithm", J. Parallel Computing, Vol. 31 ,2005, pp. 839857
[6] Erick Cantu-Paz, "Migration Policies, takeover Times in parallel
genetic algorithms", Department of computer science and Illinois
Genetic Algorithm Laboratory, 1999
[7] http://mat.gsia.cmu.edu/COLOR/instances.html
[8] ftp://dimacs.rutgers.edu/pub/challenge/graph/benchmarks/
[9] http://mat.gsia.cmu.edu/COLORING03/

250 http://sites.google.com/site/ijcsis/
ISSN 1947-5500

You might also like