Ignore edges (but can use them in later refinement)
Recursive coordinate bisection
Idea: Cut with hyperplane parallel to a coordinate axis.
Pro: Fast and simple
Con: Not always great quality
Inertial bisection
Idea: Optimize cutting hyperplane via vertex density ˉx=1nn∑i=1xi,¯ri=xi−ˉxI=n∑i=1[‖ri‖2I−rirTi] Let (λn,n) be the minimal eigenpair for the inertia tensor I, and choose the hyperplane through ˉx with normal n.
Inertial bisection
Pro: Simple, more flexible than coord planes
Con: Still restricted to hyperplanes
Random circles (Gilbert, Miller, Teng)
Stereographic projection
Find centerpoint (any plane is an even partition)
In practice, use an approximation.
Conformally map sphere, centerpoint to origin
Choose great circle (at random)
Undo stereographic projection
Convert circle to separator
May choose best of several random great circles.
Coordinate-free methods
Don’t always have natural coordinates
Example: the web graph
Can add coordinates? (metric embedding)
Use edge information for geometry!
Breadth-first search
Pick a start vertex v0
Might start from several different vertices
Use BFS to label nodes by distance from v0
We’ve seen this before – remember RCM?
Or minimize cuts locally (Karypis, Kumar)
Partition by distance from v0
Spectral partitioning
Label vertex i with xi=±1. We want to minimize edges cut=14∑(i,j)∈E(xi−xj)2 subject to the even partition requirement ∑ixi=0. But this is NP hard, so we need a trick.
Now consider the relaxed problem with x∈Rn: minimize xTLx s.t. xTe=0 and xTx=1. Equivalent to finding the second-smallest eigenvalue λ2 and corresponding eigenvector x, also called the Fiedler vector. Partition according to sign of xi.
How to approximate x? Use a Krylov subspace method (Lanczos)! Expensive, but gives high-quality partitions.
Spectral partitioning
Spectral coordinates
Alternate view: define a coordinate system with the first d non-trivial Laplacian eigenvectors.
Spectral partitioning = bisection in spectral coords
Can cluster in other ways as well (e.g. k-means)
Spectral coordinates
Refinement by swapping
Gain from swapping (a,b) is D(a)+D(b)−2w(a,b), where D is external - internal edge costs: D(a)=∑b′∈Bw(a,b′)−∑a′∈A,a′≠aw(a,a′)D(b)=∑a′∈Aw(b,a′)−∑b′∈B,b′≠bw(b,b′)
Greedy refinement
Start with a partition V=A∪B and refine.
gain(a,b)=D(a)+D(b)−2w(a,b)
Purely greedy strategy: until no positive gain
Choose swap with most gain
Update D in neighborhood of swap; update gains
Local minima are a problem.
Kernighan-Lin
In one sweep, while no vertices marked
Choose (a,b) with greatest gain
Update D(v) for all unmarked v as if (a,b) were swapped
Mark a and b (but don’t swap)
Find j such that swaps 1,…,j yield maximal gain
Apply swaps 1,…,j
Kernighan-Lin
Usually converges in a few (2-6) sweeps. Each sweep is O(|V|3). Can be improved to O(|E|) (Fiduccia, Mattheyses).
Further improvements (Karypis, Kumar): only consider vertices on boundary, don’t complete full sweep.
Multilevel ideas
Basic idea (same will work in other contexts):
Coarsen
Solve coarse problem
Interpolate (and possibly refine)
May apply recursively.
Maximal matching
One idea for coarsening: maximal matchings
Matching of G=(V,E) is Em⊂E with no common vertices.
Maximal: cannot add edges and remain matching.
Constructed by an obvious greedy algorithm.
Maximal matchings are non-unique; some may be preferable to others (e.g. choose heavy edges first).
Coarsening via maximal matching
Collapse matched nodes into coarse nodes
Add all edge weights between coarse nodes
Software
All these use some flavor(s) of multilevel:
METIS/ParMETIS (Kapyris)
PARTY (U. Paderborn)
Chaco (Sandia)
Scotch (INRIA)
Jostle (now commercialized)
Zoltan (Sandia)
Graph partitioning: Is this it?
Consider partitioning just for sparse matvec:
Edge cuts ≠ communication volume
Should we minimize max communication volume?
Communication volume – what about latencies?
Some go beyond graph partitioning (e.g. hypergraph in Zoltan).
Graph partitioning: Is this it?
Additional work on:
Partitioning power law graphs
Covering sets with small overlaps
Also: Classes of graphs with no small cuts (expanders)
Graph partitioning: Is this it?
Recall: partitioning for matvec and preconditioner
Block Jacobi (or Schwarz) – relax on each partition
Want to consider edge cuts and physics
E.g. consider edges = beams
Cutting a stiff beam worse than a flexible beam?
Doesn’t show up from just the topology
Multiple ways to deal with this
Encode physics via edge weights?
Partition geometrically?
Tradeoffs are why we need to be informed users
Graph partitioning: Is this it?
So far, considered problems with static interactions
What about particle simulations?
Or what about tree searches?
Or what about...?
Next time: more general load balancing issues
CS 5220 Applications of Parallel Computers Graph partitioning Prof David Bindel Please click the play button below.