15-853Page1 Separatosr in the Real World Practice Slides combined from www.cs.berkeley.edu/~demmel/cs267_Spr07 www.cs.cmu.edu/~guyb/realworld/slidesF03/src/separators1.ppt.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science
Advertisements

Multilevel Hypergraph Partitioning Daniel Salce Matthew Zobel.
NP-Hard Nattee Niparnan.
C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Great Theoretical Ideas in Computer Science for Some.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Information Networks Graph Clustering Lecture 14.
Online Social Networks and Media. Graph partitioning The general problem – Input: a graph G=(V,E) edge (u,v) denotes similarity between u and v weighted.
Approximation Algorithms for Unique Games Luca Trevisan Slides by Avi Eyal.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
CS267 L17 Graph Partitioning III.1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 17: Graph Partitioning - III James Demmel
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
CS 584. Review n Systems of equations and finite element methods are related.
1cs542g-term Sparse matrix data structure  Typically either Compressed Sparse Row (CSR) or Compressed Sparse Column (CSC) Informally “ia-ja” format.
Chapter 2 – Netlist and System Partitioning
Avoiding Communication in Sparse Iterative Solvers Erin Carson Nick Knight CS294, Fall 2011.
CS267 L14 Graph Partitioning I.1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 14: Graph Partitioning - I James Demmel
EDA (CS286.5b) Day 5 Partitioning: Intro + KLFM. Today Partitioning –why important –practical attack –variations and issues.
A scalable multilevel algorithm for community structure detection
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
CS267 L15 Graph Partitioning II.1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 15: Graph Partitioning - II James Demmel
CS267 L15 Graph Partitioning II.1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 15: Graph Partitioning - II James Demmel
02/23/2005CS267 Lecture 101 CS 267: Applications of Parallel Computers Graph Partitioning James Demmel
15-853Page :Algorithms in the Real World Separators – Introduction – Applications.
Multilevel Graph Partitioning and Fiduccia-Mattheyses
Domain decomposition in parallel computing Ashok Srinivasan Florida State University COT 5410 – Spring 2004.
Graph partition in PCB and VLSI physical synthesis Lin Zhong ELEC424, Fall 2010.
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
296.3:Algorithms in the Real World
Graph Coalition Structure Generation Maria Polukarov University of Southampton Joint work with Tom Voice and Nick Jennings HUJI, 25 th September 2011.
CSE 242A Integrated Circuit Layout Automation Lecture: Partitioning Winter 2009 Chung-Kuan Cheng.
MST Many of the slides are from Prof. Plaisted’s resources at University of North Carolina at Chapel Hill.
SPANNING TREES Lecture 21 CS2110 – Spring
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Crossing Minimisation (1) Ronald Kieft. Global contents Specific 2-layer Crossing Minimisation techniques After the break, by Johan Crossing Minimisation.
Graph Partitioning Problem Kernighan and Lin Algorithm
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
UNC Chapel Hill Lin/Foskey/Manocha Minimum Spanning Trees Problem: Connect a set of nodes by a network of minimal total length Some applications: –Communication.
CS 290H Lecture 5 Elimination trees Read GLN section 6.6 (next time I’ll assign 6.5 and 6.7) Homework 1 due Thursday 14 Oct by 3pm turnin file1.
Lecture 5: Mathematics of Networks (Cont) CS 790g: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic.
CS 584. Load Balancing Goal: All processors working all the time Efficiency of 1 Distribute the load (work) to meet the goal Two types of load balancing.
Mathematics of Networks (Cont)
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
Domain decomposition in parallel computing Ashok Srinivasan Florida State University.
Data Structures and Algorithms in Parallel Computing Lecture 7.
CS 290H Administrivia: May 14, 2008 Course project progress reports due next Wed 21 May. Reading in Saad (second edition): Sections
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
Graph Partitioning using Single Commodity Flows
Graph. Graph Usage I want to visit all the known famous places starting from Seoul ending in Seoul Knowledge: distances, costs Find the optimal(distance.
Graphs, Vectors, and Matrices Daniel A. Spielman Yale University AMS Josiah Willard Gibbs Lecture January 6, 2016.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Network Partition –Finding modules of the network. Graph Clustering –Partition graphs according to the connectivity. –Nodes within a cluster is highly.
Graphs David Kauchak cs302 Spring Admin HW 12 and 13 (and likely 14) You can submit revised solutions to any problem you missed Also submit your.
Lecture 20. Graphs and network models 1. Recap Binary search tree is a special binary tree which is designed to make the search of elements or keys in.
CS 140: Sparse Matrix-Vector Multiplication and Graph Partitioning
High Performance Computing Seminar
Algorithms and Networks
CS 201: Design and Analysis of Algorithms
Solving Linear Systems Ax=b
A Continuous Optimization Approach to the Minimum Bisection Problem
CS 290H Administrivia: April 16, 2008
Spanning Trees Lecture 21 CS2110 – Fall 2016.
Haim Kaplan and Uri Zwick
James Demmel 11/30/2018 Graph Partitioning James Demmel 04/30/2010 CS267,
Read GLN sections 6.1 through 6.4.
James Demmel CS 267 Applications of Parallel Computers Lecture 14: Graph Partitioning - I James Demmel.
Concepts of Computation
Presentation transcript:

15-853Page1 Separatosr in the Real World Practice Slides combined from

15-853Page2 Edge Separators An edge separator : a set of edges E’ ½ E which partitions V into V 1 and V 2 Criteria: |V 1 |, |V 2 | balanced |E’| is small V1V1 V2V2 E’

15-853Page3 Vertex Separators An vertex separator : a set of vertices V’ ½ V which partitions V into V 1 and V 2 Criteria: |V 1 |, |V 2 | balanced |V’| is small V1V1 V2V2

15-853Page4 Other names Sometimes referred to as –graph partitioning (probably more common than “graph separators”) –graph bisectors –graph bifurcators –balanced graph cuts

Application Page5 Telephone network design –Original application, algorithm due to Kernighan Load Balancing while Minimizing Communication Sparse Matrix times Vector Multiplication –Solving PDEs –N = {1,…,n}, (j,k) in E if A(j,k) nonzero, –W N (j) = #nonzeros in row j, W E (j,k) = 1 VLSI Layout –N = {units on chip}, E = {wires}, W E (j,k) = wire length Sparse Gaussian Elimination –Used to reorder rows and columns to increase parallelism, and to decrease “fill-in” Data mining and clustering Physical Mapping of DNA

15-853Page6 Recursive Separation

15-853Page7 What graphs have small separators Planar graphs: O(n 1/2 ) vertex separators 2d meshes, constant genus, excluded minors Almost planar graphs: the internet, power networks, road networks Circuits need to be laid out without too many crossings Social network graphs: phone-call graphs, link structure of the web, citation graphs, “friends graphs” 3d-grids and meshes: O(n 1/2 )

15-853Page8 What graphs don’t have small separatos Expanders: Can someone give a quick proof that they don’t have small separators Hypercubes: O(n) edge separators O(n/(log n) 1/2 ) vertex separators Butterfly networks: O(n/log n) separators ? It is exactly the fact that they don’t have small separators that make them useful.

15-853Page9 Applications of Separators Circuit Layout (dates back to the 60s) VLSI layout Solving linear systems (nested dissection) n 3/2 time for planar graphs Partitioning for parallel algorithms Approximations to certain NP hard problems TSP, maximum-independent-set Clustering and machine learning Machine vision

15-853Page10 More Applications of Separators Out of core algorithms Register allocation Shortest Paths Graph compression Graph embeddings

15-853Page11 Available Software METIS: U. Minnessota PARTY: University of Paderborn CHACO: Sandia national labs JOSTLE: U. Geenwich SCOTCH: U. Bordeaux GNU: Popinet Benchmarks: Graph Partitioning Archive

15-853Page12 Different Balance Criteria Bisectors: 50/50 Constant fraction cuts: e.g. 1/3, 2/3 Trading off cut size for balance: min cut criteria: min quotient separator: All versions are NP-hard

15-853Page13 Other Variants of Separators k-Partitioning: Might be done with recursive partitioning, but direct solution can give better answers. Weighted: Weights on edges (cut size), vertices (balance) Hypergraphs: Each edge can have more than 2 end points common in VLSI circuits Multiconstraint: Trying to balance different values at the same time.

15-853Page14 Edge vs. Vertex separators If a class of graphs satisfies an f(n) edge-separator theorem then it satisfies an f(n) vertex-separator. The other way is not true (unless degree is bounded) |C| = n/2

15-853Page15 Separator Trees

15-853Page16 Asymptotics If S is a class of graphs closed under the subgraph relation, then Definition: S satisfies a f(n) vertex- separator theorem if there are constants  0 so that for every G  S there exists a cut set C  V, with 1.|C| <  f(|G|) cut size 2.|A| <  |G|, |B| <  |G|balance Similar definition for edge separators.

15-853Page17 Separator Trees Theorem: For S satisfying an ( ,  ) n 1-  edge separator theorem, we can generate a perfectly balanced separator tree with separator size |C| < k  f(|G|). Proof: by picture |C| =  n 1-  (1 +  +  2 + …) =  n 1-  (1/1-  )

15-853Page18 Algorithms All are either heuristics or approximations –Kernighan-Lin (heuristic) –Planar graph separators (finds O(n 1/2 ) separators) –Geometric separators (finds O(n (d-1)/d ) separators) –Spectral (finds O(n (d-1)/d ) separators) –Flow techniques (give log(n) approximations) –Multilevel recursive bisection (heuristic, currently most practical)

04/13/2007CS267 Guest Lecture19 Partitioning via Breadth First Search BFS identifies 3 kinds of edges –Tree Edges - part of T –Horizontal Edges - connect nodes at same level –Interlevel Edges - connect nodes at adjacent levels No edges connect nodes in levels differing by more than 1 (why?) BFS partioning heuristic –N = N 1 U N 2, where N 1 = {nodes at level <= L}, N 2 = {nodes at level > L} –Choose L so |N 1 | close to |N 2 | BFS partition of a 2D Mesh using center as root: N1 = levels 0, 1, 2, 3 N2 = levels 4, 5, 6 root

15-853Page20 Kernighan-Lin Heuristic Local heuristic for edge-separators based on “hill climbing”. Will most likely end in a local-minima. Two versions: Original: takes n 2 times per step Fiduccia-Mattheyses: takes n times per step

15-853Page21 High-level description for both Start with an initial cut that partitions the vertices into two equal size sets V 1 and V 2 Want to swap two equal sized sets X  A and Y  B to reduce the cut size. Note that finding the optimal subsets X and Y solves the optimal separator problem, so it is NP hard. We want some heuristic that might help. AB YX C

15-853Page22 Some Terminology C(A,B) : the weighted cut between A and B I(v) : the number of edges incident on v that stay within the partition E(v) : the number of edges incident on v that go to the other partition D(v) : E(v) - I(v) D(u,v) : D(u) + D(v) - 2 w(u,v) the gain for swapping u and v A B C v u

15-853Page23 Kernighan-Lin improvement step KL(G,A 0,B 0 )  (u  A 0, v  B 0 ) put (u,v) in a PQ based on D(u,v) for k = 1 to |V|/2 (u,v) = max(PQ) (A k,B k ) = (A k-1,B k-1 ) swap (u,v) delete u and v entries from PQ update D on neighbors (and PQ) select A k,B k with best C k Note that can take backward steps (D(u,v) can be negative). A B C v u

15-853Page24 Fiduccia-Mattheyses improvement step FM(G,A 0,B 0 )  u  A 0 put u in PQ A based on D(u)  v  B 0 put v in PQ B based on D(v) for k = 1 to |V|/2 u = max(PQ A ) put u on B side and update D v = max(PQ b ) put v on A side and update D select A k,B k with best C k A B C v u

15-853Page25 A Bad Example for KL or FM Consider following graph with initial cut given in red. KL (or FM) will start on one side of grid and flip pairs over moving across the grid until the whole thing is flipped. The cut will never be better than the original bad cut

15-853Page26 Performance in Practice In general the algorithms do very well at smoothing a cut that is approximately correct. Used by most separator packages either 1.to smooth final results 2.to smooth partial results during the algorithm 3.K/L tested on very small graphs (|N|<=360) and got convergence after 2-4 sweeps 4.For random graphs (of theoretical interest) the probability of convergence in one step appears to drop like 2 -|N|/30

27 Introduction to Multilevel Partitioning If we want to partition G(N,E), but it is too big to do efficiently, what can we do? –1) Replace G(N,E) by a coarse approximation G c (N c,E c ), and partition G c instead –2) Use partition of G c to get a rough partitioning of G, and then iteratively improve it What if G c still too big? –Apply same idea recursively

28 Multilevel Partitioning - High Level Algorithm (N+,N- ) = Multilevel_Partition( N, E ) … recursive partitioning routine returns N+ and N- where N = N+ U N- if |N| is small (1) Partition G = (N,E) directly to get N = N+ U N- Return (N+, N- ) else (2) Coarsen G to get an approximation G c = (N c, E c ) (3) (N c +, N c - ) = Multilevel_Partition( N c, E c ) (4) Expand (N c +, N c - ) to a partition (N+, N- ) of N (5) Improve the partition ( N+, N- ) Return ( N+, N- ) endif (2,3) (1) (4) (5) How do we Coarsen? Expand? Improve? “V - cycle:”

29 Multilevel Kernighan-Lin Coarsen graph and expand partition using maximal matchings Improve partition using Kernighan-Lin

30 Maximal Matching: Example

31 Example of Coarsening

32 Coarsening using a maximal matching 1) Construct a maximal matching E m of G(N,E) for all edges e=(j,k) in E m 2) collapse matched nodes into a single one Put node n(e) in N c W(n(e)) = W(j) + W(k) … gray statements update node/edge weights for all nodes n in N not incident on an edge in E m 3) add unmatched nodes Put n in N c … do not change W(n) … Now each node r in N is “inside” a unique node n(r) in N c … 4) Connect two nodes in Nc if nodes inside them are connected in E for all edges e=(j,k) in E m for each other edge e’=(j,r) or (k,r) in E Put edge ee = (n(e),n(r)) in E c W(ee) = W(e’) If there are multiple edges connecting two nodes in N c, collapse them, adding edge weights

33 Expanding a partition of G c to a partition of G

34 Multilevel Spectral Bisection Coarsen graph and expand partition using maximal independent sets Improve partition using Rayleigh Quotient Iteration

35 Example of Coarsening - encloses domain D k = node of N c

36 Coarsening using Maximal Independent Sets … Build “domains” D(k) around each node k in N i to get nodes in N c … Add an edge to E c whenever it would connect two such domains E c = empty set for all nodes k in N i D(k) = ( {k}, empty set ) … first set contains nodes in D(k), second set contains edges in D(k) unmark all edges in E repeat choose an unmarked edge e = (k,j) from E if exactly one of k and j (say k) is in some D(m) mark e add j and e to D(m) else if k and j are in two different D(m)’s (say D(mi) and D(mj)) mark e add edge (mi, mj) to E c else if both k and j are in the same D(m) mark e add e to D(m) else leave e unmarked endif until no unmarked edges

37 Expanding a partition of G c to a partition of G Need to convert an eigenvector v c of L(G c ) to an approximate eigenvector v of L(G) Use interpolation: For each node j in N if j is also a node in N c, then v(j) = v c (j) … use same eigenvector component else v(j) = average of v c (k) for all neighbors k of j in N c end if

38 Example: 1D mesh of 9 nodes

39 Improve eigenvector: Rayleigh Quotient Iteration j = 0 pick starting vector v(0) … from expanding v c repeat j=j+1 r(j) = v T (j-1) * L(G) * v(j-1) … r(j) = Rayleigh Quotient of v(j-1) … = good approximate eigenvalue v(j) = (L(G) - r(j)*I) -1 * v(j-1) … expensive to do exactly, so solve approximately … using an iteration called SYMMLQ, … which uses matrix-vector multiply (no surprise) v(j) = v(j) / || v(j) || … normalize v(j) until v(j) converges … Convergence is very fast: cubic

40 Example of convergence for 1D mesh

41 Available Implementations Multilevel Kernighan/Lin –METIS ( –ParMETIS - parallel version Multilevel Spectral Bisection –S. Barnard and H. Simon, “A fast multilevel implementation of recursive spectral bisection …”, Proc. 6th SIAM Conf. On Parallel Processing, 1993 –Chaco ( Hybrids possible –Ex: Using Kernighan/Lin to improve a partition from spectral bisection

42 Comparison of methods Compare only methods that use edges, not nodal coordinates –CS267 webpage and KK95a (see below) have other comparisons Metrics –Speed of partitioning –Number of edge cuts –Other application dependent metrics Summary –No one method best –Multi-level Kernighan/Lin fastest by far, comparable to Spectral in the number of edge cuts –Spectral give much better cuts for some applications Ex: image segmentation See “Normalized Cuts and Image Segmentation” by J. Malik, J. Shi

43 Number of edges cut for a 64-way partition Graph 144 4ELT ADD32 AUTO BBMAT FINAN512 LHR10 MAP1 MEMPLUS SHYY161 TORSO # of Nodes # of Edges Description 3D FE Mesh 2D FE Mesh 32 bit adder 3D FE Mesh 2D Stiffness M. Lin. Prog. Chem. Eng. Highway Net. Memory circuit Navier-Stokes 3D FE Mesh # Edges cut Expected # cuts D mesh Expected # cuts for 64-way partition of 2D mesh of n nodes n 1/2 + 2*(n/2) 1/2 + 4*(n/4) 1/2 + … + 32*(n/32) 1/2 ~ 17 * n 1/2 Expected # cuts for 64-way partition of 3D mesh of n nodes = n 2/3 + 2*(n/2) 2/3 + 4*(n/4) 2/3 + … + 32*(n/32) 2/3 ~ 11.5 * n 2/3 For Multilevel Kernighan/Lin, as implemented in METIS (see KK95a)

Thank you! 44