260 likes | 507 Views
A modification of the Fiduccia-Mattheyses hypergraph bipartitioning algorithm. Rusakov A. S. (IPPM RAS), Sheblaev M. Motivation. Let H(V, E) - hypergraph with V — nodes, Е – hyperedges,
E N D
A modification of the Fiduccia-Mattheyseshypergraphbipartitioning algorithm Rusakov A. S. (IPPM RAS), Sheblaev M.
Motivation • Let H(V, E) - hypergraph with V — nodes, Е– hyperedges, • are edge and node weights. The problem of the balanced hypergraph bipartitioning is to find sets of nodes A and B to minimize sum of edges weights belong to cut : • Balance constrain must be satisfied:
Motivation • Graph and hypergraph partitioning — wide application area. • Spectral method, simulated annealing, genetic algorithms • Iterative improvement. KL method. FM algorithm. • State of the art: multilevel iterative improvement algorithms. • Metis, Hmetis, Scotch, MLPART, PaToH… • FM algorithm does not perform well on graphs with largely varied node weights w(vi) or multiple node weight for node. • We address FM algorithm weakness as part of multilevel bipartition algorithm.
Multilevel Partitioning Clustering Refinement
Fiduccia-Mattheyses pass. • FM algorithm: • One FM pass: given inital bipartition of the hypergraph G(v,e) Initialize node gains, bucket. while ( !bucket.empty() ) { take best gain node satisfying balance constrain vi Move vi Lock vi, remove vi from bucket update gains in the vi neighbourhood • } • Choose best solution seen in the pass. • «Gain bucket» data structure is used. It allows to update bucket and take best node at O(1) if max gain move is balanced. • One FM pass takes O(n)
Moves are made based on object gain. Object Gain: The amount of change in cut crossings that will occur if an object is moved from its current partition into the other partition • FM Partitioning: -1 2 0 - each object is assigned a gain - objects are put into a sorted gain list - the object with the highest gain from the larger of the two sides is selected and moved. - the moved object is "locked" - gains of "touched" objects are recomputed - gain lists are resorted 0 -1 0 -2 0 0 -2 -1 1 -1 1
FM Partitioning: -1 2 0 0 -1 0 -2 0 0 -2 -1 1 -1 1
-1 -2 -2 0 -1 -2 -2 0 0 -2 -1 1 -1 1
-1 -2 -2 0 -1 -2 -2 0 0 -2 -1 1 1 -1
-1 -2 -2 0 -1 -2 -2 0 -2 -2 1 -1 -1 -1
-1 -2 -2 1 -2 -2 0 -2 -2 -2 1 -1 -1 -1
-1 -2 -2 1 -2 -2 0 -2 -2 -2 1 -1 -1 -1
-1 -2 -2 1 -2 -2 0 -1 -2 -2 -2 -3 -1 -1
-1 -2 -2 -1 -2 -2 -2 -1 -2 -2 -2 -3 -1 -1
Cut During One Pass (Bipartitioning) Cut Moves
Gain Bucket Data Structure +pmax Max Gain Cell # Cell # -pmax 2 n 1
FM with largely varied weights • Classic bucket *cell = max_gain_cell while( cell != NULL) { if ( IsBalancedMove(cell) return cell; Remove cell from bucket(cell) cell = cell->next } return NULL Fast. O(1) • Bucket with restart *cell = max_gain_cell while( cell != NULL) { if ( IsBalancedMove(cell) return cell; cell = cell->next } return cell; Gives much better cut size
Gain Bucket Data Structure +pmax Max Gain Cell # Cell # -pmax 2 n 1
FM with largely varied weights • Our modification of bucket. Introduce a new pointer to first balanced cell: GetBestMove() { *cell = max_gain_cell If (first_balanced) cell = first_balanced; while( cell != NULL) { if ( IsBalancedMove(cell) { first_balanced = cell->next; return cell; } cell = cell->next } return NULL } Starts search from the “good” cell. Good tradeoff of runtime and cut size • Update of the gain cell. Reset • UpdateGainCell(new gain) { • ... If(new_gain > first_balanced_gain) first_balance = NULL … • }
Application to Multilevel Bipartitioning • runs with 5 clusterization scheme (FC, MHEC, HEM, HEC, PinHEM). Choose best • V cycle
Multilevel Results Achieve almost the same cut size with 30% speeding up
Applying LIFO* [*] • Implemented LIFO*. • Evaluated [*] on our benchmarks set. Pure LIFO* did not show improvement. • Combination of LIFO and LIFO* passes improved cut and runtime. Each 3th pass uses LIFO*. [*] - Yourim Yoon, Yong-Hyuk Kim, New Bucket Managements in Iterative Improvement Partitioning Algorithms
Combination of LIFO and LIFO* Results on ISPD98 hypergraph benchmarks. Multilevel bipartition. LIFO* on each 3th pass
Conclusion • Classic FM performs suboptimal on graps/hypergraphs with varied node weights. • Bucket with restarts provides best cut value. No crucial runtime penalty in multilevel FM. • Propose new algorithm modification. Good quality/runtime tradeoff