Mathematical Problems in Engineering

Volume 2015, Article ID 238529, 10 pages

http://dx.doi.org/10.1155/2015/238529

## Moving Clusters within a Memetic Algorithm for Graph Partitioning

^{1}Technical Laboratory, Atto Research, 225-18 Pangyoyeok-ro, Bundang-gu, Seongnam-si, Gyeonggi-do 463-400, Republic of Korea^{2}Department of Computer Science & Engineering, Kwangwoon University, 20 Kwangwoon-ro, Nowon-gu, Seoul 139-701, Republic of Korea^{3}Department of Computer Engineering, College of Information Technology, Gachon University, 1342 Seongnamdaero, Sujeong-gu, Seongnam-si, Gyeonggi-do 461-701, Republic of Korea

Received 23 September 2014; Accepted 7 January 2015

Academic Editor: John Gunnar Carlsson

Copyright © 2015 Inwook Hwang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Most memetic algorithms (MAs) for graph partitioning reduce the cut size of partitions using iterative improvement. But this local process considers one vertex at a time and fails to move clusters between subsets when the movement of any single vertex increases cut size, even though moving the whole cluster would reduce it. A new heuristic identifies clusters from the population of locally optimized random partitions that must anyway be created to seed the MA, and as the MA runs it makes beneficial cluster moves. Results on standard benchmark graphs show significant reductions in cut size, in some cases improving on the best result in the literature.

#### 1. Introduction

Consider an unweighted undirected graph , where is a set of vertices, and is the set of edges that connect them. A *-way partition * of the graph is a partitioning of the vertex set into disjoint subsets. A partition is said to be* balanced* if the difference in size between the largest and the smallest subset is at most 1, that is, for all , . The* cut size* of a partition is defined to be the number of edges connecting vertices in different subsets of the partition. The *-way graph partitioning* problem is the problem of finding a balanced -way partition with the minimum cut size. If , it can be called bipartitioning and if , multiway partitioning. These problems arise in applications such as sparse matrix factorization, network partitioning, layout and floor planning, circuit placement, social network analysis, and software-defined networking [1, 2].

For general graphs, partitioning is known to be NP-hard [3]. Bui and Jones [4] have shown that even finding good approximate solutions is also NP-hard.

Therefore, many heuristic methods have been proposed: some of them work well, but they cannot of course guarantee optimality. The simplest heuristic is iterative improvement partitioning (IIP) [5, 6], exemplified by the Kernighan-Lin (KL) [7] and the Fiduccia-Mattheyses (FM) algorithms [8], but these algorithms only produce solutions which are approximations to* local* optima; however, this limitation can be overcome by hybridizing them with metaheuristics, such as simulated annealing [9], genetic algorithms (GAs) [10], tabu search [11, 12], or ant colony optimization [13]. Recently, a number of techniques based on GAs have achieved notable results for [14–19] and [20–26]. Kim et al. [27] have surveyed this work.

The use of IIP for local optimization of partitioning produced by a GA becomes less effective as the graph becomes larger. We will show that this is because IIP often fails to move densely interconnected subgraphs, called* clusters*, between partitions, and hence fails to find partitions with small cut sizes.

The goal of the work reported in this paper is to overcome the barriers to effective search which are presented by clusters, by modifying the GA so that it contributes to move clusters appropriately. We present a memetic algorithm (MA), which is a GA combined with local optimization, in which a heuristic finds clusters in some of the positions in each generation, by examining population of individuals, each of which represents a position, rather than trying to identify them directly from a single graph. It moves some of these clusters. This heuristic supplements the well-known ability of MAs to provide attractive initial points for local optimization. Experimental results show that this approach can substantially improve the performance of an MA. The contributions of this work are summarized as follows.(i)We provide a detailed explanation of the difficulty of moving clusters in graph partitioning and provide experimental results quantifying the impact of clusters on the search for partitions with a small cut size.(ii)We present a heuristic for detecting and moving clusters, which is based on a new, population-based, measure of the distance between vertices called* genic distance*.(iii)We show that this heuristic substantially improves the ability of an MA to find good partitions.

The remainder of this paper is organized as follows. In Section 2 we briefly introduce IIP algorithms and the test graphs used in our experiments. In Section 3 we investigate the difficulty of moving clusters in graph partitioning. In Section 4 we describe our new cluster-handling heuristic, and an MA that uses this heuristic is described in Section 5. In Section 6 we present experimental results, and draw conclusions in Section 7.

#### 2. Preliminaries

##### 2.1. Iterative Improvement Algorithms in Bipartitioning

Iterative improvement partitioning starts with a random partition. This is refined in a series of passes. At the start of each pass, all the vertices are free to move between subsets. IIP selects vertices and moves them, but each vertex is only moved once during a pass. At the end of the pass, the best partition found during the pass is identified and used as the input to the next pass. Passes continue until there is no further improvement.

There are a number of IIP algorithms, of which KL [7] is often considered to be the first reasonable heuristic for bipartitioning. In KL, the movement of vertices during a pass is restricted to the swapping of a pair of vertices between subsets.

Let be a partition of into two subsets and . We define the gain associated with a vertex to be the reduction in cut size obtained by moving to the other subset. By extension, the gain obtained by swapping vertices and can be expressed as follows:where KL selects the pair with the highest value of and effects the exchange. The vertices and are not considered again during the current pass. A sequence of pairs are selected in this way. The algorithm chooses that maximizes and exchanges and . KL performs further passes until no improvement is possible.

FM is another widely used IIP algorithm, which is similar to KL, except that it only moves one vertex at a time. This makes FM faster than KL, with little loss in partition quality. Several variants of KL and FM exist [15, 28, 29].

##### 2.2. Local Optimization Algorithms for Multiway Partitioning

There are three main schemes for multiway partitioning, which are developments of the recursive, pair-wise, and direct approaches [21] to bipartitioning. The recursive KL algorithm bisects the graph recursively until there are subsets. The pair-wise KL [7] starts with an arbitrary -way partition. It picks two subsets at a time from the subsets and performs bipartitioning to reduce the cut size between those pairs. Sanchis [30] extended the FM algorithm to multiway partitioning and showed that the direct method performed better than recursion. The extended algorithm considers moving each vertex from its current subset to every other subset. To perform local optimization in the proposed MA for multiway partitioning, we use a variant of this algorithm, called EFM (extended FM) [21]. The time complexity of EFM is .

##### 2.3. Local Search in Memetic Algorithms

It is already clear that combining a GA with local optimization algorithms is an effective approach to the graph partitioning problem [15]. Some authors have explored fast but weak local optimization algorithms. For example [31, 32], 2-opt was used to relocate border vertices, which are those with edges that connect to vertices in other subsets. Bui and Moon [10] obtained better results with KL by allowing only a single pass, while restricting the number of vertices to be swapped. Conversely, other authors have reported notable improvements by enhancing local optimization algorithms. For bipartitioning, Kim and Moon [15] suggested a new KL-based local optimization algorithm, formulated using a new type of gain, called* lock gain*, which only takes into account the edges that connect a vertex to the vertices that have already been moved. Combined with a GA, this algorithm obtained impressive results on most benchmark graphs. For multiway partitioning, the combination of MAs with specialized local optimization algorithms showed good results [20, 21]. Steenbeek et al. [18] proposed what they called a cluster enhancement heuristic, which they combined with an MA, and reported successful results. Their MA uses a vertex swap heuristic to identify clusters. The MA only handles the moving of clusters between subsets.

##### 2.4. Test Graphs

We tested our MA on Johnson’s benchmark graphs [9], which have been widely used in other studies [10, 11, 14–17, 20, 21, 23, 33–36]. They are composed of 8 random graphs G and 8 random geometric graphs U. The two different classes of graphs are briefly described below.(i)G: a random graph on vertices, with an independent probability that any two vertices are connected by an edge. The probability is biased so that the expected vertex degree, , is .(ii)U: a random geometric graph on vertices that lie in the unit square and whose coordinates are chosen uniformly from the unit interval. Every pair of vertices separated by a distance of or less is connected by an edge. The expected degree of a vertex is .

#### 3. Difficulty of Moving Clusters

Suppose that the cluster shown in Figure 1(a) is involved in a bipartitioning problem. The four vertices in this cluster are fully interconnected, and they all belong to the same subset. Moving this cluster to the other subset, across the dotted line in Figure 1(b) will reduce the cut size of the partition by 4. However, there is no motivation to move any single vertex, because they all have negative gain: the gains of , , , and are −1, −4, −2, and −1, respectively. This example illustrates how IIP algorithms may miss a significant reduction in cut size that could be achieved by moving several vertices together.