75
Multi-Level Edge Separator Using a Hybrid Combinatorial-Quadratic Programming Approach Nuri Yeralan, Timothy A. Davis, and William Hager University of Florida

Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Multi-Level Edge Separator Using a Hybrid Combinatorial-Quadratic

Programming Approach

Nuri Yeralan, Timothy A. Davis, and William Hager

University of Florida

Page 2: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Graph Partitioning Problem

• Partition an undirected graph into 2 subgraphs

• Minimize the sum of edge weights in cut set

• Maintain target partition balance

• NP Hard

Page 3: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Multi-Level Partitioning

• Coarsen the input to reduce problem size

• Cut the coarsest graph

• Refine back to the original input

Page 4: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Multi-Level Partitioning

coarsen

coarsen

cut

refine

refine

Page 5: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Multi-Level Partitioning

• Variations

– “V” cycle

• Single sweep, down and up

– “W” cycle

• Refine & alternate between deepest levels

– Randomization

• Bifurcate on way down

• Select best of alternatives on way up

• Parallelism!

Page 6: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Coarsening

coarsen

• Goals

– Reduce problem size

– Remove heavy edges

Page 7: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching

• Glue two or more vertices together

– Update connectivity as set union of adjacency lists summing edge weights

– Sum the node weights

Page 8: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• Random Matching (RM)

– Match vertices across the graph at random

• Heavy Edge Matching (HEM)

– Traverse adjacency lists of unmatched vertices and match to the heaviest unmatched neighbor.

• Heaviest Edge Matching (SHEM)

– Sort edges in decreasing order by edge weight

– Perform valid matches in order

Page 9: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• Heavy Triangle Matching (HTM) – Do a local 2-step BFS on unmatched vertices

– Match the heaviest valid triangle

– (Treat absence of edge as 0-weight edge)

• Heaviest Clique Matching (HCM) – Find and sort 3-cliques in descending order of sum

of edge weights

– Perform valid matches in order

• Many More!

Page 10: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• Pitfalls

– Some matching strategies are expensive

• SHEM, HCM, HTM

– No compression guarantees

• High degree vertices, “stars” are notorious

• Villain:

Page 11: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Brotherly” Matching

– Match topologically close vertices through a common neighbor

– Ex:

Page 12: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Brotherly” Matching

– Match topologically close vertices through a common neighbor

– Ex:

Page 13: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Brotherly” Matching

– Match topologically close vertices through a common neighbor

– Ex:

HEM

Page 14: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Brotherly” Matching

– Match topologically close vertices through a common neighbor

– Ex:

HEM

“Brotherly”

Page 15: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Adoption” Matching

– Toss another vertex into an existing 2-way match

– Ex:

HEM

“Brotherly”

Page 16: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Adoption” Matching

– Toss another vertex into an existing 2-way match

– Ex:

HEM

“Brotherly”

“Adoption”

Page 17: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Adoption” Matching

– Toss another vertex into an existing 2-way match

– Ex:

n=9 n=4

Page 18: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• To ensure productive coarsening, we want a bound on the number of coarsening phases.

• Can we guarantee O(log n) coarsening phases?

Page 19: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 20: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 21: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 22: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 23: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 24: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 25: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

Page 26: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

n=8 n=4

Page 27: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Matching Strategies

• “Community” Matching

– After an adoption, if a second adoption is required at the same match site, match the old adoptee with the new adoptee.

– Ex:

– Equivalent to a brotherly match at the next level.

n=8 n=4

Page 28: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Initial Cut

• Random

• Clustering

• BFS-based

• Brute Force

cut

Page 29: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Refinement

• Pass the partition choices up

• Swap vertex partitions

– Kernighan-Lin (‘70)

– Fiduccia-Mattheyses (‘82)

• Maintain balance refine

Page 30: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose - Overview

• Nuri Yeralan, Tim Davis, William Hager

• Hybrid graph partitioner

– combinatorial & quadratic programming

• Single-threaded

• No randomization

• Handles floating point weights

• Interoperability with MATLAB, GraphViz, SuiteSparse, QPDelta

Page 31: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose - Coarsening

• Matching

– “Jumpstart” HEM while building coarse graphs

– Pass over unmatched vertices

• Note: All neighbors of unmatched vertices are matched.

– Select heaviest matched neighbor

– Perform brotherly matching

– Adopt/Community match orphaned vertices

– Guarantees O(log n) coarsening levels

Page 32: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose - Coarsening

• Matching

– In practice, we initiate brotherly matching if the vertex’s degree exceeds twice the average.

– Still productive (empirically) but no guarantee

Page 33: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose – Initial Cut

• Single Pseudoperipheral

– Find a Pseudoperipheral Node (George ‘79)

– Collect vertices into one partition using a BFS from a pseudoperipheral node until the partition exceeds the desired size.

– Vertices sitting on the cut are considered “boundary” vertices and placed into a heap corresponding to their partition.

Page 34: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose - Refinement

• Boundary Fiduccia-Mattheyes – One heap per partition stores boundary vertices.

– An entry’s value is the result of an objective function combining FM gains with a linear balance penalty • Incorporates user-defined balance ratio and tolerance

• Allows otherwise infeasible moves

– Inspect the top 3 elements of each heap and swap the vertex with the highest heuristic value.

– Karypis and Kumar introduced boundary KL in ‘97.

Page 35: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose - Refinement

• Use optimization to solidify balance constraints and make moves that combinatorial methods miss.

• Quadratic Programming Formulation of the Graph Partitioning Problem (Hager ‘99)

– minimize: 1 − 𝑥 𝑇 𝐴 + 𝐷 𝑥

• D is a diagonal matrix such that 𝑑𝑖𝑖 + 𝑑𝑗𝑗 ≥ 𝑎𝑖𝑗

• Mongoose sets 𝑑𝑖𝑖 to the sum of 𝑖’s edge weights.

– subject to: 0 ≤ 𝑥 ≤ 1, 1𝑇𝑥 = 𝑚

• m: desired node weight for one partition

Page 36: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose - Refinement

• QP Formulation: Gradient Projection

– Compute a gradient vector at each vertex

• 𝐺𝑟𝑎𝑑 = 0.5 – 𝑥𝑇 𝐷 + 0.5 − 𝑥𝑇 𝐴

– 𝑥𝑖 ∈ 0,1 represents vertex 𝑖’s partition choice

– Move along the gradient

– Project back onto feasible set

Page 37: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Mongoose In Action

• Mongoose cut of 1138_bus from the UF Sparse Matrix Library (Davis ‘10)

– n = 1138

– nz = 4054

– Power network problem (bus power system) submitted by D. Tylavsky (‘87)

• GraphViz is used to render using a force-directed layout (AT&T Research, ‘88)

Page 38: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 39: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 40: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 41: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 42: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 43: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 44: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 45: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 46: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 47: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 48: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 49: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 50: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Boundary FM never finds this

Page 51: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 52: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 53: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 54: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 55: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 56: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

QP makes a subtle adjustment

Page 57: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 58: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 59: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows
Page 60: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

QP makes a subtle adjustment

Page 61: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Results: Set 1, Hodgepodge

• 1550 square matrices

• Between 15 and 2mil edges

• Come from a variety of contexts

– Optimization, fluid dynamics, quantum mechanics, PDE, circuit simulation, power line networks, 2d & 3d mesh, etc

Page 62: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Timing 1550 General Problems: FM, QP, Hybrid

FM-Only

Hybrid

QP-Only

Page 63: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Cut Quality 1550 General Problems: FM, QP, Hybrid

FM-Only

Hybrid

QP-Only

Page 64: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Remarks

• The quadratic programming formulation seems to work well in a multi-level setting.

• Combining the combinatorial method with the quadratic programming formulation is superior to either by itself.

• How well does Mongoose perform against contemporary partitioners?

– METIS 5.0.2

Page 65: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Timing 1550 General Problems: METIS 5, Mongoose

Mongoose

METIS 5.0.2

Page 66: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Cut Quality 1550 General Problems: METIS 5, Mongoose

Mongoose

METIS 5.0.2

Page 67: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Remarks

• In the general case, Mongoose seems to perform on par with METIS 5.0.2 in both performance and cut quality.

Page 68: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Results: Set 2, Power Law Graphs

• 25 square matrices

• Between 1mil and 10 mil edges

• Come from social networking, web networks

Page 69: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Timing 25 Power Law Problems: FM, QP, Hybrid

FM-Only

Hybrid

QP-Only

Page 70: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Cut Quality 25 Power Law Problems: FM, QP, Hybrid

FM-Only

Hybrid

QP-Only

Page 71: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Remarks

• Providing gradient projection with an good guess via boundary-FM reduces the overall cost of the hybrid approach

– Synergy – FM and QP mutually help each other

• Hybrid approach tends to find better cuts

• How well does Mongoose perform against contemporary partitioners?

– METIS 5.0.2

Page 72: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Timing 25 Power Law Problems: METIS 5, Mongoose

Mongoose

METIS 5.0.2

Page 73: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Profile: Cut Quality 25 Power Law Problems: METIS 5, Mongoose

Mongoose

METIS 5.0.2

Page 74: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Remarks

• Mongoose tends to find better cuts than METIS 5.0.2 for large graphs.

• Mongoose ties METIS 5.0.2 for time.

– Future Work

• Optimize quadratic programming formulation

• Use randomization and parallelization

Page 75: Multi-Level Edge Separator Using a Hybrid Combinatorial ... · function combining FM gains with a linear balance penalty •Incorporates user-defined balance ratio and tolerance •Allows

Questions?

openclipart.org