
Abusing a hypergraph partitioner for unweighted graph partitioning B. O. Fagginger Auer and R. H. Bisseling Mathematics Institute, Utrecht University, Budapestlaan 6, 3584 CD, Utrecht, the Netherlands [email protected] [email protected] Abstract. We investigate using the Mondriaan matrix partitioner for unweighted graph partitioning in the communication volume and edge- cut metrics. By converting the unweighted graphs to appropriate matri- ces, we measure Mondriaan’s performance as a graph partitioner for the 10th DIMACS challenge on graph partitioning and clustering. We find that Mondriaan can effectively be used as a graph partitioner: w.r.t. the edge-cut metric, Mondriaan’s average results are within 21% of the best known results as listed in Chris Walshaw’s partitioning archive. 1 Introduction In this paper, we use the Mondriaan matrix partitioner [21] to partition the graphs from the 10th DIMACS challenge on graph partitioning and clustering [1]. In this way, we can compare Mondriaan’s performance as a graph partitioner with the performance of the state-of-the-art partitioners participating in the challenge. An undirected graph G is a pair (V, E), with vertices V , and edges E that are of the form {u, v} for u, v ∈ V with possibly u = v. For vertices v ∈ V , we denote the set of all of v’s neighbours by Vv := {u ∈ V | {u, v} ∈ E}. Note that vertex v is a neighbour of itself precisely when the self-edge {v, v} ∈ E. Hypergraphs are a generalisation of undirected graphs, where edges can con- tain an arbitrary number of vertices. A hypergraph G is a pair (V, N ), with vertices V, and nets (or hyperedges) N ; nets are subsets of V that can contain any number of vertices. Let > 0, k ∈ N, and G = (V, E) be an undirected graph. Then a valid solution to the graph partitioning problem for partitioning G into k parts with imbalance , is a partitioning Π : V → {1, . , k} of the graph’s vertices into k parts, each part Π−1({i}) containing at most |V | |Π−1({i})| ≤ (1 + ) , (1 ≤ i ≤ k) (1) k vertices. To measure the quality of a valid partitioning we use two different metrics. The communication volume metric1 [1] is defined by X CV(Π) := max |Π(Vv) \{Π(v)}|. (2) 1≤i≤k v∈V Π(v)=i For each vertex v, we determine the number of different parts π(v) in which v has neighbours, except Π(v). Then, the communication volume is given by the maximum over i, of the sum of all π(v) for vertices v belonging to part i. The edge-cut metric [1], defined as EC(Π) := |{{u, v} ∈ E | Π(u) 6= Π(v)}|, (3) measures the number of edges that exist between different parts of the partition- ing Π. Name Ref. Graph/ Sequential/ hypergraph parallel Chaco [13] graph sequential Metis [14] graph sequential Scotch [18] graph sequential Jostle [22] graph parallel ParMetis [16] graph parallel PT-Scotch [10] graph parallel hMETIS [15] hypergraph sequential ML-Part [6] hypergraph sequential Mondriaan [21] hypergraph sequential PaToH [8] hypergraph sequential Parkway [20] hypergraph parallel Zoltan [12] hypergraph parallel Table 1. Overview of available software for partitioning (hyper)graphs from [2]. There exist a lot of different (hyper)graph partitioners, which are summarised in Table 1 from [2]. All partitioners follow a multi-level strategy [5], where the (hyper)graph is coarsened by generating a matching of the (hyper)graph’s ver- tices and contracting matched vertices to a single vertex. Doing this recursively creates a hierarchy of increasingly coarser approximations of the original (hy- per)graph. After this has been done, an initial partitioning is generated on the coarsest (hyper)graph in the hierarchy, i.e. the one possessing the smallest num- ber of vertices. This partitioning is subsequently propagated to the finer (hy- per)graphs in the hierarchy and refined at each level (e.g. using the Kernighan– Lin algorithm [17]), until we reach the original (hyper)graph and obtain the final partitioning. 1 We forgo custom edge and vertex weights and assume they are all equal to one, because Mondriaan’s hypergraph partitioner does not support net weights. 2 2 Mondriaan Mondriaan has been designed to partition the matrix and the vectors for a par- allel sparse matrix–vector multiplication, where a sparse matrix A is multiplied by a dense input vector v to give a dense output vector u = A v as the re- sult. First, the matrix partitioning algorithm is executed to minimise the total communication volume LV(Π) of the partitioning, defined below, and then the vector partitioning algorithm is executed with the aim of balancing the commu- nication among the processors. The matrix partitioning itself does not aim to achieve such balance, but it is not biased in favour of any processor part either. Name Ref. V N Column-net [7] {r1, . , rm} {{ri | 1 ≤ i ≤ m, ai j 6= 0} | 1 ≤ j ≤ n} Row-net [7] {c1, . , cn} {{cj | 1 ≤ j ≤ n, ai j 6= 0} | 1 ≤ i ≤ m} Fine-grain [9] {vi j | ai j 6= 0} {{vi j |1 ≤ i ≤ m, ai j 6= 0} | 1 ≤ j ≤ n} | {z } column nets ∪ {{vi j |1 ≤ j ≤ n, ai j 6= 0} | 1 ≤ i ≤ m} | {z } row nets Table 2. Available representations of an m × n matrix A = (ai j ) by a hypergraph G = (V, N ) in Mondriaan. Mondriaan uses recursive bipartitioning to split the matrix or its submatrices repeatedly into two parts, choosing the best of the row or column direction in the matrix. The current submatrix is translated into a hypergraph by the column- net or row-net model, respectively (see Table 2). Another possibility is to split the submatrix based on the fine-grain model, and if desired the best split of the three methods can be chosen. The outcome of running Mondriaan is a two- dimensional partitioning of the sparse matrix (i.e., a partitioning where both the matrix rows and columns are split). The number of parts is not restricted to a power of two, as Mondriaan can split parts according to a given ratio such as 2:1. After each split, Mondriaan adjusts the weight balancing goals of the new parts obtained, as the new part that receives the largest fraction of the weight will need to be stricter in allowing an imbalance during further splits than the part with the smaller fraction. If the input vector and output vector can be partitioned independently, the vector partitioning algorithm usually has enough freedom to achieve a reason- able communication balancing. If the matrix is square, and both vectors must be partitioned in the same way, then there is usually little freedom. Sometimes, the total communication volume must even be increased because of the identical vector partitioning. If the matrix diagonal has only nonzero elements, however, the vector partitioning can be achieved without incurring additional communi- cation by assigning vector components vi and ui to the same processor as the diagonal matrix element aii. More details on the matrix and vector partitioning 3 can be found in [21]; improved methods for vector partitioning are given in [4], see also [3]. (a) k = 1 (b) k = 2 (c) k = 4 (d) k = 1024 Fig. 1. Mondriaan 1D column partitioning of the graph fe tooth, modelled as a sparse matrix cf. Thm. 1, into k = 1, 2, 4, 1024 parts with imbalance = 0.03. The rows and columns of the matrices have been permuted for k > 1 to Separated Block Diagonal form, see [23]. Here, we will use Mondriaan as a hypergraph partitioner, which can be done by choosing the column direction in all splits, so that columns are vertices and rows are nets. This means that we use Mondriaan in one-dimensional mode, as only rows will be split. Fig. 1 illustrates this splitting procedure. Mondriaan has 4 the option to use its own, native hypergraph bipartitioner, or link to the external partitioner PaToH [8]. In the present work, we use the native partitioner. For the graph partitioning challenge posed by DIMACS, we try to fit the existing software to the aims of the challenge. One could say that this entails abusing the software, as it was designed for a different purpose, namely ma- trix and hypergraph partitioning. Using a hypergraph partitioner to partition graphs will be at the cost of some additional, unnecessary overhead. Still, it will be interesting to see how the Mondriaan software performs in this unforeseen mode, and to compare the quality of the generated partitionings to the quality of partitionings generated by other software, in particular by graph partitioning packages. In the situation of the challenge, we can only use the matrix partitioning of Mondriaan and not the vector partitioning, as the vertex partitioning of the graph is already completely determined by the column partitioning of the ma- trix. The balance of the communication will then solely depend on the balance achieved by the matrix partitioning. Internally, Mondriaan’s hypergraph partitioner solves the following problem. For a hypergraph G = (V, N ) with vertex weights ζ : V → N, an imbalance factor > 0, and a number of parts k ∈ N, Mondriaan’s partitioner produces a partitioning Π : V → {1, . , k} such that ζ(V) ζ(Π−1({i})) ≤ (1 + ) , (1 ≤ i ≤ k), (4) k where the partitioner tries to minimise the (λ − 1)-volume X LV(Π) := (|Π(n)| − 1). (5) n∈N We will now translate the DIMACS partitioning problems from Sec. 1 to the hypergraph partitioning problem that Mondriaan is designed to solve, by creating a suitable hypergraph G, encoded as a sparse matrix A in the row-net model.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages15 Page
-
File Size-