Graph Partitioning
Total Page:16
File Type:pdf, Size:1020Kb
Technische Universitt Chemnitz Ulrich Elsner Graph Partitioning A survey MASSIV PARALLEL M SIMULATION S SFB 393 Sonderforschungsbereich Numerische Simulation auf massiv parallelen Rechnern Preprint SFB Dec Contents Contents i Notation iii The problem Introduction Graph Partitioning Examples Partial Dierential Equations Sparse MatrixVector Multiplication Other Applications Time vs Quality Miscellaneous Algorithms Introduction Recursive Bisection Partitioning with geometric information Co ordinate Bisection Inertial Bisection Geometric Partitioning Partitioning without geometric information Introduction Graph Growing and Greedy Algorithms KerniganLin Algorithm Sp ectral Bisection Sp ectral Bisection for weighted graphs Sp ectral Quadri and Octasection Multilevel Sp ectral Bisection Algebraic Multilevel Multilevel Partitioning Coarsening the graph i Contents Partitioning the smallest graph Pro jecting up and rening the partition Other metho ds Bibliography ii Notation Below we list most of the symbols used in the text together with a brief explanation of their meaning V E A undirected graph with vertices V and edges E E fe j there is an edge b etween v and v g the set ij i j of edges V fv j i ng the set of vertices i W fw e N j e E g weights of the edges in E E e ij ij W fw v N j v V g weights of the vertices in V V v i i the degree of vertex v fv V je E g deg v i j ij i The number of adjacent vertices LG The Laplacian matrix of the graph G V E if i j and e E ij l if i j and e E ij ij dv if i j i AG The adjacency matrix of the graph G V E if i j and e E ij a ij otherwise the empty set j j for X a set jX j is the number of elements in X iii Notation n k k for x C a vector jxj is the pnorm of x p P n p 1p jx j kxk i p i=1 k k k k the Euklidian norm 2 T e O f n f g n j there exists a C with jg nj C f n for all n n g 0 the Landau symbol AB A B with A B disjoint union The dot just emphasizes that the two sets are disjoint I I The identity matrix of size n If the size is obvious from the n context I is used A sp ectrum of A diag w a diagonal matrix with the comp onents of the vector w on the diagonal iv The problem Intro duction While the p erformance of classical von Neumann computers has grown tremen dously there is always demand for more than the current technology can deliver At any given moment it is only p ossible to put so many transistors on a chip and while that number increases every year certain physical barriers lo om on the horizon sim ply put an electron has to t through each data path the information has to travel a certain distance in each cycle that cannot b e b e surpassed by the technology known to day But while it is certainly imp ortant to pursue new metho ds and technologies that can push these barriers a bit further or even break them what can b e done to get bigger p erformance now Mankind has for eons used teamwork to achieve things that a single human b eing is incapable of from hunting as a group to building the pyramids The same idea can b e used with computers parallel computing Invented or rather revived ab out years ago parallel computers achieve p erformances that are imp ossible or much to exp ensive to achieve with single pro cessor machines Therefore parallel computers of one architecture or another have b ecome increasingly p opular with the scientic and technical community But just as working together as a team do es not always work eciently p eople cannot dig a p osthole times as fast as one and creates new problems that do not o ccur when one is working alone how to co ordinate the p easants working on the pyramid obstacles unknown to single pro cessor programmers o ccur when working on a parallel machine First not all parts of a problem can b e parallelized but some have to b e executed serially This limits the total p ossible sp eedup Ahmdals law for a given problem of constant size Quite often though the sequential part of the work tends to b e indep endent from the size of the input and so for a bigger problem adequate for sharing the work among more pro cessors a higher sp eedup is p ossible Problems of this kind are called scalable Second the amount of work done has to b e distributed evenly amongst the pro The problem cessors This is even more necessary if during the course of the computation some data has to b e exchanged or some pro cess synchronized In this case some of the pro cessors have to wait for others to nish This loadbalancing might b e easy for some problems but quite complicated for others The amount of work p er pro cessor might vary during the course of the computation for example when some critical p oint needs to b e examined closer So p erfect balance in one step do es not have to mean balance in the next This could easily b e avoided by moving some of the work to another underutilized pro cessor But this always means communication b etween dierent pro cessors And communication is alas timeconsuming This brings us to the third obstacle In almost all reallife problems the pro ces sors regularly need information from each other to continue their work This has two eects As mentioned ab ove these exchanges entail synchronization p oints making it necessary for some of the pro cessors to wait for others And of course communica tion itself takes some time Dep ending on the architecture exchanging even one bit of information b etween two pro cessors might b e many times slower than accessing a bit in the pro cessor itself There might b e a high startup time such that exchanging hundreds of bytes takes almost the same amount of time as exchanging one byte It might or might not b e p ossible that exchanges b etween two disjoint pairs of pro cessors takes place at the same time While all this is highly machinedependent it is evident that it is desirable to partition the problem or the data in such a way that not only the work is distributed evenly but also that at the same time communication is minimized As we will see for certain problems this will lead to the problem of partitioning a graph In its simplest form this means that we divide the vertices of a graph into equal sized parts such that the number of edges connecting these parts is minimal Graph Partitioning First some notations cf A graph V E consists of a number of vertices V fv j i ng some i of which are connected by edges in E fe i j j there is an edge b etween ij v and v g Other names for vertices include no des grid p oints or mesh p oints i j In order to avoid excessive subscripts we will sometimes equate i with v and i j i with e if there is no danger of confusion ij Given a subset V V of vertices the induced subgraph V E contains all those edges E E that join two vertices in V Both vertices and edges can have weights asso ciated with them Graph Partitioning W fw e N j e E g are the weights of the edges and W fw v E e ij ij V v i N j v V g are the weights of the vertices i The weights are nonnegative integers This often allows for a more ecient analy sis or implementation of algorithms For example sorting a list of integers of restricted size can b e done using the bucketsort algorithm with its O n p erformance But this restriction is not as big as it seems For example p ositive rational weights can easily b e mapp ed to N by scaling them with the smallest common multiple of the denom + inators If no weights are given all weights should b e considered to b e The simplest form of graph partitioning unweighted graph bisection is this given a graph consisting of vertices and edges divide the vertices in two sets of equal size such that the number of edges b etween these two parts is minimized Or more formally Let G V E b e a graph with jV j the number of of elements in V even Find a partition V V of V ie V V V and V V This disjoint 1 2 1 2 1 2 union ist sometimes expressed by V V V with 1 2 jV j jV j 1 2 such that jfe E j v V and v V gj ij i 1 j 2 is minimized among all p ossible partitions of V with equal size A more general formulation involves weighted edges weighted vertices and p dis joint subsets Then the sum of weights of vertices in each of the subsets should b e equal while the sum of the edges b etween these subsets is minimized Again more formally P Let G V E b e a graph with weights W and W with w v divisible V E v i v V i by p Find a ppartition V V V of V ie 1 2 p p V V and V V for all i j i i j i=1 with X w v equal for all j f pg v i v (i)V j such that X w e e ij e E with ij v V v V and p=q p q i j is minimized among all p ossible partitions of V The problem and are also referred to as cutsize implying the picture that one takes the whole graph cuts these edges and is left with the subgraphs induced by the subsets of the vertices