Parallel Hybrid Genetic Algorithm for Maximum Clique Problem on
OpenCL
Li Li
1
,Zhang Kai
1,2
∗
, Yang siman
1
, He Juanjuan
1,2
1
School of Computer Science, Wuhan University of Science and Technology
Wuhan 430081, Hubei, China
2
Hubei Province Key Laboratory of Intelligent Information Processing and Real-time Industrial System
zhangkai@wust.edu.cn
Abstract
The maximum clique problem is to find the maximum sized clique of pairwise adjacent vertices in a given graph, which is a
NP-Complete problem. In this paper, an effective parallel hybrid genetic algorithm is proposed, which consists of genetic algorithm
and a local optimization strategy for solving maximum clique problem. In this algorithm, selection, crossover, mutation, fitness
evaluation and replacement operators are implemented parallel on OpenCL. In addition, we have tested our algorithm by using a set
of benchmark instances from the DIMACS graphs. The comparison results shows that the implementation on GPU provide better
performance that CPU, even when the benchmark graphs become more large and complicate.
Keywords: Maximum Clique Problem, Genetic Algorithm, OpenCL
1 Introduction
The maximum clique problem (MCP) is an NP-Complete
problem [1], there is no effective polynomial algorithm to
solve it. Many practical problems can be formulated to it, such
as cluster analysis, information retrieval, mobile networks,
coding theory, fault diagnosis, printed circuit board testing
and computer vision [2, 3]. Therefore, to design an effec-
tive algorithm for solving MCP is full of significance both in
theory and in practice.
In recent years, many algorithms have been proposed to
solve MCP, and the benchmark graph instances are chose from
the DIMACS challenge [4], which has great difficulty to find
the maximum clique effectively. Exact algorithm [5] is ef-
fective for solving small instances, but when the scale of the
graph becomes larger, it would cost much time to find MC,
moreover it cannot find MC in reasonable time. Some approx-
imation algorithms [6-8] are also proposed for MCP, such as
simulated annealing, artificial neural network and genetic al-
gorithm [9-10].
However, these algorithms usually cannot find maximum
clique quickly. In the past few years, compute unified device
architecture (CUDA) and open computing language (Open-
CL) [11] are developed in full use of the graphics processing
unit (GPU) [12]. The OpenCL architecture has the character-
istics of heterogeneous computing platform with CPU/GPU.
It has better platform independence and portability, which
simplifies the programming for parallel computing under
CPU/GPU heterogeneous platform.
In this paper, an efficient parallel hybrid genetic algorith-
m for MCP is proposed. The algorithm provides massively
parallel selection, crossover, mutation, fitness evaluation and
replacement operators on OpenCL. Moreover we have evalu-
ated our implementation using a set of benchmark instances
from the DIMACS library. The GPU performance is com-
pared with the corresponding CPU implementation, and the
results shows that the performance of our GPU algorithm is
very encouraging.
2 Parallel hybrid Genetic Algorithm
for MCP
2.1 Maximum Clique Problem
Given an undirected graph G = (V, E) with n verities and
m edges, let G
′
= (V
′
, E
′
) is the subgraph of G. In our
algorithm, let vector X be a 0-1 vector of size n representing
G
′
. Assuming all the vertices in G are labeled with indices
1, 2, . . . , |V |. If vertex i is in subgraph G
′
, let X[i] be 1,
otherwise let X[i] be 0. This encoding method is really simple
and straightforward.
For example, graph G = (V, E) have 8 vertices and 13
edges, as shown in Fig.1. According to the definition, sub-
graph {v
1
, v
2
, v
7
} and {v
4
, v
5
, v
6
, v
7
} are complete subgraph-
s, but they are not the maximum clique. There is a larger com-
plete subgraph G
′
{v
1
, v
2
, v
4
, v
6
, v
7
}, which is a maximum
clique of G, corresponding vector X is (1, 1, 0, 1, 0, 1, 1,
0).
1