Advanced Flow-Based Multilevel Hypergraph Partitioning
Lars Gottesbüren Michael Hamann Sebastian Schlag Dorothea Wagner
cs.DS


Interference as an information-theoretic game
    Borivoje Dakić
    17 February 2021
=============================================





The balanced hypergraph partitioning problem is to partition a hypergraph into k disjoint blocks of bounded size such that the sum of the number of blocks connected by each hyperedge is minimized.
We present an improvement to the flow-based refinement framework of KaHyPar-MF, the current state-of-the-art multilevel k-way hypergraph partitioning algorithm for high-quality solutions.
Our improvement is based on the recently proposed HyperFlowCutter algorithm for computing bipartitions of unweighted hypergraphs by solving a sequence of incremental maximum flow problems.
Since vertices and hyperedges are aggregated during the coarsening phase, refinement algorithms employed in the multilevel setting must be able to handle both weighted hyperedges and weighted vertices – even if the initial input hypergraph is unweighted.
We therefore enhance HyperFlowCutter to handle weighted instances and propose a technique for computing maximum flows directly on weighted hypergraphs.

We compare the performance of two configurations of our new algorithm with KaHyPar-MF and seven other partitioning algorithms on a comprehensive benchmark set with instances from application areas such as VLSI design, scientific computing, and SAT solving.
Our first configuration, KaHyPar-HFC, computes slightly better solutions than KaHyPar-MF using significantly less running time.
The second configuration, KaHyPar-HFC*, computes solutions of significantly better quality and is still slightly faster than KaHyPar-MF.
Furthermore, in terms of solution quality, both configurations also outperform all other competing partitioners.





§ INTRODUCTION


Graphs are a common way to model pairwise relationships (edges) between objects (vertices). 
However, many real-world problems involve more complex interactions <cit.>.
Hypergraphs are a generalization of graphs, where each hyperedge can connect an arbitrary number of vertices.
Thus, hypergraphs are well-suited to model such higher-order relationships.

The balanced k-way hypergraph partitioning problem (HGP) asks to compute a partition of the vertices
into k disjoint blocks of bounded weight (at most (1+ϵ) times the average block weight) such 
that few hyperedges are cut, i.e., connect vertices in different blocks <cit.>. Since 
hyperedges can connect more than two vertices, several notions of cuts exit in the literature <cit.>. 
In this work, we consider the connectivity objective, which aims to minimize ∑_e ∈ Eω(e) (λ(e) - 1), where
E is the set of hyperedges, ω(e) denotes the weight of hyperedge e, and λ(e) denotes the number of blocks connected by hyperedge e.
Well-known applications of hypergraph partitioning include VLSI design <cit.>, the parallelization of sparse matrix-vector multiplications <cit.>, and storage sharding in distributed databases <cit.>.
We refer to a survey chapter <cit.> and two survey articles <cit.> for an extensive overview.

Since HGP is NP-hard <cit.>, heuristic algorithms are used in practice. 
The most successful heuristic for computing high-quality solutions is the three-phase multilevel paradigm. 
In the coarsening phase, multilevel algorithms first successively contract the input hypergraph to obtain a hierarchy of smaller, structurally similar instances.
After applying an initial partitioning algorithm to the smallest hypergraph, the contractions are undone and, at each level, refinement algorithms are used to improve the partition induced by the coarser level.



    Related Work.

The most well-known and practically relevant multilevel hypergraph partitioners from different application areas are PaToH <cit.> (scientific computing), hMetis <cit.> (VLSI design), KaHyPar <cit.> (general purpose, n-level), Zoltan <cit.> (scientific computing, parallel), Mondriaan <cit.> (sparse matrices), and Parkway <cit.> (parallel).
Additionally there are MLPart <cit.> (restricted to bipartitioning), and HYPE <cit.>, a single-level algorithm that grows k blocks using a neighborhood expansion <cit.> heuristic.

With the exception of KaHyPar-MF <cit.>, all multilevel HGP algorithms solely employ variations of the well-known Kernighan-Lin <cit.> (KL) or Fiduccia-Mattheyses <cit.> (FM) heuristics in the refinement phase.
These algorithms repeatedly move vertices between blocks prioritized by the improvement in the objective function.
While they perform well for hypergraphs with small hyperedges, their performance deteriorates in the presence of many large hyperedges <cit.>.
In this case, many single-vertex moves have no immediate effect on the objective function because the vertices of large hyperedges are likely to be distributed over multiple blocks.
KaHyPar-MF <cit.> therefore additionally employs a refinement algorithm based on maximum-flow computations between pairs of blocks.
Since flow algorithms find minimum s-t cuts, this refinement technique does not suffer the drawbacks of move-based approaches.

The flow-based refinement framework is a generalization of the approach used in the graph partitioner KaFFPa <cit.>.
To refine a pair of blocks of a k-way partition, KaHyPar first extracts a subhypergraph induced by a set of vertices around the cut of these blocks.
This subhypergraph is then transformed into a graph-based flow network, using techniques due to Lawler <cit.>, and Liu and Wong <cit.>, on which a maximum flow is computed.
The vertices of the subhypergraph are reassigned according to the corresponding minimum cut.
The size of the subhypergraph (and thus the size of the flow network) is chosen adaptively, depending on the outcome of the previous refinement. 
While larger flow networks may produce better but potentially imbalanced solutions, the smallest flow network guarantees a balanced partition.
We further discuss KaHyPar and its flow-based refinement framework in Section <ref>.

HyperFlowCutter (HFC) <cit.> computes bipartitions of unweighted hypergraphs by solving a sequence of incremental maximum flow problems.
Its advantage over computing a single maximum flow is that it does not reject almost balanced solutions, but systematically trades cut-size for increased balance.
ReBaHFC <cit.> uses HFC as postprocessing to improve an initial bipartition computed with PaToH.
HFC computes unit-capacity flows directly on the hypergraph (i.e., without using a graph-based flow network) using a technique of Pistorius and Minoux <cit.> extended to Dinic's flow algorithm <cit.>.



    Contribution and Outline


Multilevel refinement algorithms must be able to handle both weighted hyperedges and weighted vertices because vertices and hyperedges are aggregated during the coarsening phase.
In this work, we improve KaHyPar's flow-based refinement framework – with regard to both running time and solution quality – by using a weighted version of HFC instead of the maximum flow computations on differently-sized graph-based flow networks.
After introducing notation and briefly presenting additional details about KaHyPar and HFC refinement in Section <ref>, we discuss how HFC can simulate an approach of KaHyPar and KaFFPa for balancing partitions, extend HFC's existing balancing approach to weighted instances, and propose a heuristic for guiding its incremental maximum flow problems in Section <ref>.
In Section <ref>, we present our approach for computing maximum flows on weighted hypergraphs, generalizing the technique of Pistorius and Minoux <cit.> to weighted hypergraphs and arbitrary flow algorithms.

In our experiments (Section <ref>), we compare two configurations of our new approach with KaHyPar-MF,
and seven other partitioning algorithms on a large benchmark set containing hypergraphs from the VLSI, SAT solving, and
scientific computing community <cit.>.
While our first configuration, KaHyPar-HFC, computes slightly better solutions than KaHyPar-MF using significantly less running
time, the second configuration, KaHyPar-HFC*, computes solutions of significantly better quality and is still slightly faster than KaHyPar-MF.
Furthermore, in terms of solution quality, both configurations outperform all other competing partitioners.
We conclude the paper in Section <ref> and suggest future work.



§ PRELIMINARIES




    Hypergraphs.

A hypergraph H=(V,E) consists of a set of vertices V and a set of hyperedges E, where a hyperedge e is a subset of the vertices V.
Additionally, we associate weights ω E →ℕ^+, φ V →ℕ^+ with the hyperedges and vertices.
A vertex v ∈ V is incident to hyperedge e ∈ E if v ∈ e.
The vertices incident to a hyperedge e are called the pins of e.
We denote the pin u in hyperedge e as (u,e). 
By H[V'] = (V', { e ∩ V' | e ∈ E }), we denote the hypergraph induced by the vertex set V'.
The star expansion of H represents the hypergraph as a bipartite graph G=(V ∪̇E, { (v,e) ∈ V × E | v ∈ e}) with bipartite node set V ∪̇E and an edge for every pin. 
To avoid confusion, we use the terms vertices, hyperedges, and pins for hypergraphs, and the terms nodes and edges for graphs.
We extend functions to sets using f(X) = ∑_x ∈ X f(x) for some function f.



    Hypergraph Partitioning.

A k-way partition π(H) of a hypergraph H=(V,E) is a partition of its vertices into non-empty disjoint blocks V_1, …, V_k ⊂ V, , ⋃_i=1^k V_i = V, V_i ≠∅ for i = 1,…,k and V_i ∩ V_j = ∅ for i ≠ j.
For some parameter ϵ∈ [0, 1) we call π(H) ϵ-balanced, if each block V_i satisfies the balance constraint φ(V_i) ≤ (1+ϵ) φ(V)/k.
Let Λ(e) = { V_i ∈π(H) | V_i ∩ e ≠∅} denote the blocks that are connected by hyperedge e ∈ E. 
The connectivity of a hyperedge e is defined as λ(e) := |Λ(e)|.
Given parameters ϵ and k, and an input hypergraph H, the balanced k-way hypergraph partitioning problem asks for an ϵ-balanced k-way partition of H that minimizes the connectivity-metric ∑_e ∈ Eω(e) (λ(e) - 1).



    Maximum Flows.

A flow network is a symmetric, directed graph 𝒩 = (𝒱,ℰ) with two disjoint non-empty terminal node sets S,T⊊𝒱, the source and target node set, as well as a capacity function c ℰ→ℕ_0.
A flow is a function f ℰ→ℤ subject to the capacity constraint f(e) ≤ c(e) for all edges e, flow conservation ∑_(u,v)∈ℰ f(u,v) = 0 for all non-terminal nodes v, and skew symmetry f(u,v)=-f(v,u) for all edges (u,v). 
The value of a flow |f| := ∑_s ∈ S, (s,u)∈ℰ f(s,u) is the amount of flow leaving S.
The residual capacity r_f(e) := c(e) - f(e) is the additional amount of flow that can pass through e without violating the capacity constraint.
The residual network with respect to f is the directed graph 𝒩_f = (𝒱,ℰ_f), where ℰ_f := {e ∈ℰ | r_f(e) > 0}.
A node v is source-reachable if there is a path from S to v in 𝒩_f, it is target-reachable if there is a path from v to T in 𝒩_f.
We denote the source-reachable and target-reachable nodes by S_r and T_r, respectively.
An augmenting path is an S-T path in 𝒩_f.
The flow f is a maximum flow if |f| is maximal of all possible flows in 𝒩. 
This is the case if and only if there is no augmenting path in 𝒩_f.
An S-T edge cut is a set of edges whose removal disconnects S and T.
The value of a maximum flow equals the weight of a minimum-weight S-T edge cut <cit.>.
The source-side cut consists of the edges from S_r to 𝒱∖ S_r and the target-side cut consists of the edges from T_r to 𝒱∖ T_r.
The bipartition (S_r, 𝒱∖ S_r) is induced by the source-side cut and (𝒱∖ T_r, T_r) is induced by the target-side cut.
Note that 𝒱∖ S_r ∖ T_r is not necessarily empty.
We also call S_r and T_r the cutsides of a maximum flow.



    Maximum Flows on Hypergraphs.

Lawler <cit.> uses maximum flows to compute minimum S-T hyperedge cuts.
On the star expansion, the construction to model node capacities as edge capacities <cit.> is applied to the hyperedge-nodes.
A hyperedge e is expanded into an in-node e_i and an out-node e_o joined by a directed bridge edge (e_i, e_o) with capacity c(e_i, e_o) = ω(e).
For every pin u ∈ e there are two directed external edges (u, e_i), (e_o, u) with infinite capacity.
The transformed graph is called the Lawler network.
A minimum S-T edge cut in the Lawler network consists only of bridge edges, which directly correspond to S-T cut hyperedges in H.
Via the Lawler network, the above notions translate naturally from graphs to hypergraphs, and we use the same terminology and notation for hypergraphs.



    The KaHyPar Framework.

Since our algorithm is integrated into the KaHyPar framework, we briefly review its core components and outline its k-way flow-based refinement.
In contrast to traditional multilevel HGP algorithms that contract matchings or clusterings and therefore work with a coarsening hierarchy of O(log n) levels, KaHyPar removes only a single vertex between two levels, resulting in almost n levels.
Coarsening is restricted to clusters found with a community detection algorithm <cit.>.
Initial partitions of the coarsest hypergraph are computed using a portfolio of simple algorithms <cit.>.
During uncoarsening, it employs a combination of localized FM local search <cit.> and flow-based refinement <cit.>.

Given a k-way partition π(k) = {V_1,...,V_k} of a hypergraph H = (V, E, φ, ω), the flow-based refinement works on pairs (V_i,V_j) of blocks that share cut hyperedges.
The blocks are scheduled for refinement as long as this improves the solution (better connectivity, or equal connectivity and less imbalance).
To construct a flow problem for a pair of blocks, the algorithm performs two randomized weight-constrained breadth-first searches (BFS) restricted to H[V_i] and H[V_j], respectively.
The BFSs are initialized with the vertices of V_i (resp. V_j) that are incident to hyperedges in the cut between V_i and V_j.
The first BFS stops if the weight of the visited vertices would exceed (1+ α·ϵ) ⌈φ(V)/k⌉ - φ(V_j), where the scaling parameter α is used to control size of the flow problem.
The second BFS visits the vertices of V_j analogously.
The hypergraph induced by the visited vertices is then used to build the Lawler network, with size optimizations due to Liu and Wong <cit.> and Heuer <cit.>.
A minimum S-T cut in the Lawler network induces a bipartition of H[V_i ∪ V_j].
If the flow computation resulted in an ϵ-balanced partition, the improved solution is accepted and α is increased to min(2 α, α') for a predefined upper bound of α' = 16. 
Otherwise, α is decreased to max( α/2 , 1). 
This scaling scheme continues until a maximal number of rounds is reached or a feasible partition that did not improve the cut is found.
KaHyPar runs flow-based refinement on exponentially spaced levels, , after 2^i uncontractions for increasing i, since flow-based refinement is too expensive to be run after every uncontraction.



    ReBaHFC.

ReBaHFC avoids the need for Lawler networks and the corresponding size optimizations <cit.> by directly constructing a flow hypergraph by contracting vertices not visited by a BFS to S or T.
Furthermore, it does not require adaptive rescaling because HFC guarantees balanced partitions.



§ WEIGHTED HYPERFLOWCUTTER

To keep this paper self-contained, we briefly explain the core HFC algorithm in Section <ref>.
Subsequently, we discuss further details of multilevel refinement with HFC in Section <ref> and our approach for adapting two balancing strategies in Section <ref>.



 §.§ The Core Algorithm




The core HFC algorithm computes bipartitions with monotonically increasing cut size and balance by solving a sequence of incremental maximum flow problems, until both blocks satisfy the balance constraint.
Given some initial terminal vertex sets S and T, HFC first computes a maximum flow and derives the cutsides S_r and T_r.
If either the source-side cut or the target-side cut induces blocks that fulfill the balance constraint, the algorithm terminates.
Otherwise, it adds all vertices on the smaller cutside to its corresponding terminal side, , S := S_r if |S_r| ≤ |T_r| and T := T_r otherwise.
Then, one additional vertex – the piercing vertex – is added to the terminal side and the previous flow is augmented to respect the new terminals.
This ensures that HFC finds a different cut with each new maximum flow.
By growing the smaller side, the algorithm ensures that it finds a balanced partition after at most |V| iterations.
Figure <ref> illustrates the HFC phases.
HFC selects piercing vertices for S from the boundary vertices of the source-side cut, , the vertices incident to hyperedges in the source-side cut that are not already contained in S.
Analogously, the candidates for T are the boundary vertices of the target-side cut.
Note that the previous flow still satisfies the flow constraints, and only the piercing vertex can break the maximality of the flow.
HFC prefers piercing vertices that maintain the maximality of the current flow, , do not create an augmenting path.
This strategy is called the avoid-augmenting-paths piercing heuristic.
Adding a vertex u to S creates an augmenting path if and only if u ∈ T_r.



 §.§ Multilevel Refinement Using HyperFlowCutter


For multilevel k-way refinement with HyperFlowCutter we use the block-pair scheduling of KaHyPar-MF and the flow model construction of KaHyPar-MF and ReBaHFC.


Unlike ReBaHFC, we do not explicitly contract unvisited vertices to S (resp. T).
Instead, we build the flow hypergraph during the BFS and mark pins that will not be in the flow hypergraph as terminals.
Hyperedges containing both terminals are removed as they cannot be eliminated from the cut.
Subsequently, our weighted HFC algorithm is run on the weighted flow hypergraph.
We stop once the flow exceeds the weight of the remaining hyperedges from the original cut.
The difference between the weight of the original cut hyperedges and the flow value equals the decrease in connectivity.



    Distance-Based Piercing.

We can use the original cut to guide HFC.
To avoid that bad piercing decisions make it impossible for HFC to recover parts of the original cut, we use BFS-distances from the original cut as an additional piercing heuristic.
We prefer larger distances, secondary to avoiding augmenting paths.
Vertices from the other side of the original cut are rated with distance -1, , chosen only after one side has been entirely added to the corresponding terminal vertices.
This is similar to the flow network rescaling of KaHyPar, as we first use vertices as terminals that could only be contained in larger flow networks.
We maintain the boundary vertices in a bucket priority queue and select candidates uniformly at random from the highest-rated non-empty bucket.
New terminal vertices are removed lazily.



 §.§ Improved Balance


KaHyPar uses both flows and FM local search to refine a partition.
Because FM only considers moves that maintain the balance constraint, partitions with small imbalance tend to give FM more leeway for improving the current solution.
In this section, we discuss two approaches to improve the balance during HFC refinement.
These can also improve the solution quality, since HFC would otherwise trade better balance for a larger cut.



    Keep Piercing.


Given a maximum flow and minimum cut, finding a most balanced cut of the same weight is NP-hard <cit.>.
All vertices of a strongly connected component (SCC) of the residual network belong to the same side in a minimum cut.
Hence, finding a most balanced minimum cut corresponds to a knapsack problem with partial order constraints induced by the directed acyclic graph (DAG) obtained from contracting all SCCs <cit.>.
Each topological ordering of the DAG corresponds to a series of minimum cuts. 
KaHyPar computes several random topological orderings to find a cut with the same weight and less imbalance, which considerably improved solution quality <cit.>.

Using the avoid-augmenting-paths piercing heuristic, we can perform such a sweep without the need to explicitly construct the DAG and to compute a topological ordering.
Instead of stopping at the first balanced partition, we continue to pierce as long as no augmenting path is created.
Since this process is fast and piercing decisions are randomized, we repeat it several times and select the partition with the smallest imbalance.



    Reassigning Isolated Vertices.

A vertex v ∉ S ∪ T is called isolated if all of its incident hyperedges have pins in both S and T.
An isolated vertex v can be moved without affecting the cut, because v ∉ S_r ∪ T_r and its incident hyperedges remain in both the source- and target-side cut over the course of the algorithm.
Using the terminology above, v is not affected by partial order constraints.
This reduces the optimal assignment problem for isolated vertices to a subset sum problem.
With unweighted vertices, we can easily distribute the total weight |L| of a set L of isolated vertices among the two sides to achieve optimum balance.
Introducing vertex weights makes the subset sum problem non-trivial, because arbitrary divisions of the total weight φ(L) are not necessarily possible.
Since isolated vertices remain isolated, the problem instances are incremental.
To solve the problem, we use the pseudo-polynomial dynamic program (DP) for subset sum <cit.>.
It maintains a lookup table of partition weights that are summable with isolated vertices.
After obtaining a new cut, we update the DP table to incorporate potential new isolated vertices.
For each new isolated vertex v, we iterate over the subset sums x in the table and insert φ(v) + x if it was not yet a subset sum.
As an optimization, we maintain a list of ranges that are summable (consecutive entries).
The balance check takes constant time per range.
To merge ranges efficiently, we store a pointer from each DP table entry to its range in the list.
When a new subset sum x is obtained, we check whether x-1 and x+1 are also subset sums, and extend or merge ranges as appropriate.
Since entries in the DP table cannot be reverted easily, we do not add isolated vertices to the DP after the first balanced partition is found.

As the DP is only pseudo-polynomial, its running time may become prohibitive on instances with very large vertex weights.
In our experiments, non-unit vertex weights are only the result of contractions during coarsening.
Hence, the DP is polynomial in the size of the unit-weight input hypergraph.
We plan to implement a simple classifier to decide whether the running time can be harmful, and deactivate the DP accordingly.



§ MAXIMUM FLOWS ON WEIGHTED HYPERGRAPHS






In this section, we present our technique for computing maximum flows on weighted hypergraphs.
It generalizes the approach of Pistorious and Minoux <cit.> (which computes maximum flows directly on unweighted hypergraphs using the Edmonds-Karp algorithm <cit.>) to weighted hypergraphs and to arbitrary flow algorithms.

Let P denote the set of pins, and let (u,e)  P →ℤ denote the amount of flow that vertex u sends into hyperedge e.
Negative values indicate that u receives flow from e.
Let (u, e)^+ := max((u, e), 0) denote the net flow u sends into e and (u, e)^- := max(-(u, e), 0) the net flow u receives from e.
Then, f(e) can also be written as ∑_u ∈ e(u,e)^+ = ∑_u ∈ e(u,e)^-.
We can push up to c(e) - f(e) + (u,e)^- + (v,e)^+ flow from u via e to another pin v ∈ e.
The advantage of implementing flow algorithms directly on the hypergraph is the ability to identify and skip cases in which we cannot push any flow.
If c(e) - f(e) = 0 and (u,e) ≥ 0, we only need to iterate over the pins v∈ e with (v,e) > 0.
A graph-based flow algorithm on the residual Lawler network would scan the edge (e_i, v) for every pin v ∈ e.
For unweighted hypergraphs, each e ∈ E has at most one pin v ∈ e with (v,e) > 0, which can be stored in a separate array of size |E|.
Since HFC needs to compute flows in forward and backward direction, an additional array is needed for pins v' ∈ e with (v',e) < 0.
A weighted hyperedge can have many such pins, which would require arrays of size |P|.
Instead, we divide the pins of e into subranges (v,e) { < 0, = 0, > 0}.
When the sign of (v,e) changes, we insert pin v into the correct subrange by performing swaps with the range boundaries.

In addition to scanning hyperedges like vertices, pushing flow over a hyperedge is the elementary operation necessary to implement any flow algorithm on hypergraphs.
Let Δ be the amount of flow to push.
We update the values (u,e), (v,e), and f(e) in four steps (see Figure <ref> for an example).
These steps correspond to paths p_1 = (u, e_o, e_i, v), p_2 = (u, e_o, v), p_3 = (u, e_i, v), p_4 = (u, e_i, e_o, v) in the residual Lawler network.
The order of these steps is important to correctly update f(e).
First, we push Δ' := min(Δ, (u,e)^-, (v,e)^+) along p_1 by setting f(e) := f(e) - Δ', (u,e) := (u,e) + Δ', (v,e) := (v,e) - Δ', and Δ := Δ - Δ'.
Then, we push Δ' := min(Δ, (u,e)^-) along p_2, by updating (u,e), (v,e), and Δ as before.
Note that we do not update f(e) since the bridge edge (e_i, e_o) is not in p_2.
Analogously to p_2, we push Δ' := min(Δ, (v,e)^+) along p_3.
Finally, we push the remaining Δ along p_4 and update f(e), (u,e), (v,e), and Δ as for p_1.

Note that the Lawler network is just used as a means of illustration.
In our implementation, we only update the (u,e), (v,e), and f(e) values as shown at the bottom of Figure <ref>.



    Flow Algorithm.

We chose to implement Dinic's flow algorithm <cit.> with capacity scaling, because the flow problems for HFC refinement on our benchmark set predominantly have a small diameter (due to the BFS-based construction).
Dinic's algorithm consists of two alternating phases: assigning hop-distance labels to vertices by performing a BFS on the residual network, and using DFS to find edge-disjoint augmenting paths with distance labels increasing by one along the path.
In addition to vertex distance labels, we maintain hyperedge distance labels.
For a vertex u, we only traverse those incident hyperedges e whose distance label matches that of u.
The pins v ∈ e are only traversed if the distance of v is 1 plus the distance of e.
To distinguish the case that we can only push flow to pins v with (v,e) > 0, we actually maintain two different distance labels per hyperedge.



    Optimizations.

It suffices to initialize the BFS and DFS with the last piercing vertex p of a side, since only p can lead to newly reachable vertices.
When Dinic's algorithm terminates, we already know S_r or T_r (depending on which side was pierced) and thus only compute the reachable vertices of the other side.
While computing this set, we also compute the corresponding distance labels, so that the next flow computation can directly start with the DFS phase.
Additionally, we infer the sets S_r, T_r, S, and T from the distance labels.



§ EXPERIMENTAL EVALUATION


The C++17 source code for Weighted HyperFlowCutter[<https://github.com/larsgottesbueren/WHFC>] and KaHyPar-HFC[<https://github.com/SebastianSchlag/kahypar>] are available as open-source software.
Experiments are performed sequentially on a cluster of Intel Xeon E5-2670 Sandy Bridge nodes with two Octa-Core processors clocked at 2.6 GHz with 64 GB RAM, 20 MB L3- and 8×256 KB L2-Cache, using only one core of a node.

We consider two configurations which differ in the constraint for vertices from V_i in the flow hypergraph.
KaHyPar-HFC uses 1/5·φ(V_i) (as used for RebaHFC <cit.>), while KaHyPar-HFC* uses (1+ 16 ·ϵ) ⌈φ(V)/k⌉ - φ(V_j) (as used for KaHyPar-MF <cit.>).
In Appendix <ref>, we assess the impact of the algorithmic components on the solution quality of KaHyPar-HFC.
Both configurations use all components.



    Benchmark Set.

We use a comprehensive benchmark set of real-world hypergraphs compiled by Schlag <cit.>.[<https://algo2.iti.kit.edu/schlag/sea2017/>]
It consists of 488 unit-weight hypergraphs from four sources: the ISPD98 VLSI Circuit Benchmark Suite <cit.> (ISPD98, 18 hypergraphs), the DAC 2012 Routability-Driven Placement Benchmark Suite <cit.> (DAC, 10), the SuiteSparse Matrix Collection <cit.> (SPM, 184) and the international SAT Competition 2014 <cit.> (Literal, Primal, Dual, 92 hypergraphs each).
Refer to Table <ref> in Appendix <ref> for hypergraph sizes and refer to <cit.> for information on how the hypergraphs were derived.
We compute partitions for ϵ = 3% and k ∈{2,4,8,16,32,64,128}.
Each combination of a hypergraph and a value of k constitutes one instance, resulting in a total of 3416 instances.



    Methodology.

In addition to the KaHyPar configurations, we consider the state-of-the-art partitioners hMetis <cit.> in both recursive bisection (-R) and direct k-way (-K) mode, PaToH <cit.> with default (-D) and quality preset (-Q), Zoltan-AlgD <cit.>, Mondriaan <cit.>, as well as HYPE <cit.>.
We excluded MLPart <cit.> and ReBaHFC <cit.> because they are restricted to bipartitioning, and Parkway <cit.> because we were not able work with the current version [<https://github.com/parkway-partitioner/parkway>].
The code hangs on many instances, e.g. it did not finish within 8 hours on a small instance that took the other partitioners around 20 seconds.

For each instance and partitioner, we perform ten runs with different random seeds.
The only exception is HYPE <cit.> which produced worse solutions when randomized <cit.>.
Hence, we report only one non-randomized run of HYPE.
Running times and connectivity values per instance are aggregated using the arithmetic mean, while running times across instances are aggregated using the geometric mean to give instances of different sizes a comparable influence.
To compare running times we use a combination of a scatter plot, which shows the arithmetic mean time per instance, and a box-and-whiskers plot <cit.>.
Because small running times are more frequent, we use a fifth-root scale <cit.> on the y-axis.
Runs that exceeded the 8 hour time limit count as 8 hours in the reported aggregates and plots.

For comparing solution quality we use performance profiles <cit.>.
Let 𝒜 denote a set of algorithms, ℐ a set of instances and (a,i) denote the objective value computed by a ∈𝒜 on i ∈ℐ – in our case the arithmetic mean connectivity of 10 runs.
The performance ratio

    r(a,i) = (a,i)/min{(a',i)  |  a' ∈𝒜}

indicates by what factor a deviates from the best solution on instance i.
In particular, algorithm a found the best solution on instance i if r(a,i) = 1.
The performance profile

    ρ_a  [1,∞) → [0,1], τ↦| {i ∈ℐ| r(a,i) ≤τ} | /|ℐ|

of a is the fraction of instances for which it is within a factor of τ from the best solution.
Runs that did not finish within the time limit or resulted in an error (balance violation or crash) are excluded.
If this concerns all runs of an algorithm on an instance, we report the corresponding fractions as the steps at special symbols (99, 56 respectively).






 §.§ Comparison with KaHyPar-MF




KaHyPar-HFC computes solutions with better, equal, or worse quality than KaHyPar-MF on 1933, 367, 1056 instances, respectively.
On the remaining 60 instances neither finished within the time limit.
As Figure <ref> (left) shows, the performance ratios are consistently better, though not by a large margin.
The median fraction of flow-based refinement time of KaHyPar-HFC vs KaHyPar-MF is 0.18, the 75th percentile is 0.26, and the 90th percentile is 0.51.
Hence, the flow-based refinement of KaHyPar-HFC is significantly faster than that of KaHyPar-MF.
Flow-based refinement constitutes about 40% of KaHyPar-MF's overall running time <cit.>.
With a mean overall running time of 44.84s, KaHyPar-HFC is about 33% faster than KaHyPar-MF at 67.07s.
The improved running time is partially due to faster flow computation and partially due to smaller flow hypergraphs.
Since KaHyPar-HFC uses smaller flow hypergraphs, the improved solution quality can be attributed to the HyperFlowCutter approach.
With 62.49s, KaHyPar-HFC* is moderately faster than KaHyPar-MF and computes solutions of better, equal, or worse quality on 2776, 381, 198 instances, respectively (with 61 instances on which neither the -HFC* nor the -MF variant finished within the time limit).
Hence, the faster flow computation more than compensates the additional work incurred by HFC.
Figure <ref> shows box plots for the different phases of KaHyPar.
The running times of preprocessing, coarsening, and initial partitioning remain unchanged, as they are not influenced by the refinement phase.
During the refinement phase, local search and flow-based improvement both modify the solution and thus influence one another.
The plots show that the running time of local search remains largely unchanged, while our variants reduce the running time of flow-based refinement.





 §.§ Comparison with other Partitioners






We now compare the three KaHyPar variants with the other state-of-the-art algorithms.
Figure <ref> shows that KaHyPar-HFC* outperforms all competing algorithms, and that hMetis-R emerges as the best competitor outside the KaHyPar variants.
KaHyPar-HFC* computes the best solutions on 63% of all instances, KaHyPar-HFC on 14%, and hMetis-R on 18%, as shown by their ρ_a(1) values.
Note that these values alone do not permit a ranking between the algorithms.
Both KaHyPar-MF and KaHyPar-HFC compete with KaHyPar-HFC* for the best solutions on similar instances, and thus end up with a lower ρ_a(1) value.
Compared individually, KaHyPar-HFC is better than hMetis-R on 69.9% of the instances.
Additionally, KaHyPar-HFC and KaHyPar-MF approach the profile of KaHyPar-HFC* much faster.
The KaHyPar variants are all within a factor of 1.1 of the best solution on over 90% of the instances, and within 1.4 on over 97%, whereas hMetis-R achieves 76% and 90%.
PaToH-Q and PaToH-D solve more instances than hMetis-R within factors of roughly 1.2 and 1.4, and more instances than hMetis-K within 1.1 and 1.2.
Mondriaan is similar to PaToH-D and Zoltan-AlgD settles between PaToH-D and PaToH-Q.
The only non-multilevel algorithm HYPE is considerably worse, with only 5.7% of solutions within a factor 2 of the best.

Figure <ref> shows running times for each instance.
We categorize the algorithms into two groups.
Algorithms in the first group, consisting of KaHyPar, hMetis and Zoltan-AlgD, invest substantial running time to aim for high-quality solutions.
On the other hand, PaToH, Mondriaan and HYPE aim for fast running time and reasonable solution quality.
The results show that while PaToH gives the best time-quality trade-off, KaHyPar-HFC* is the best algorithm for high-quality solutions, whereas KaHyPar-HFC offers a better time-quality trade-off than other algorithms from the first group.

In Table <ref> in Appendix <ref>, we report aggregate running times, timeouts and imbalanced solutions.
Figure <ref> in Appendix <ref> presents separate performance profiles for the different values of k.
These show that the performance difference between KaHyPar and the other algorithms increases with k.
This can be explained by the fact that all other partitioners except hMetis-K use recursive bisection.
Furthermore, Figure <ref> in Appendix <ref> shows performance profiles for each instance class of the benchmark set.
Especially on dual SAT instances that have many large hyperedges KaHyPar-HFC* improves upon KaHyPar-MF.
Finally, Figure <ref> in Appendix <ref> presents performance profiles comparing KaHyPar-HFC* and KaHyPar-HFC with the best algorithm from each family of partitioning algorithms.



§ CONCLUSION AND FUTURE WORK


We leverage the powerful HyperFlowCutter refinement algorithm in the multilevel setting for k-way partitioning by integrating it into KaHyPar.
For this, we extend unweighted HyperFlowCutter to weighted hypergraphs by adapting its balancing heuristics and presenting an approach to compute flows directly on weighted hypergraphs.
Furthermore, we propose a distance-based piercing heuristic and use the existing avoid-augmenting-paths piercing heuristic to find partitions with small imbalance.

The most pressing area of research is to reduce the running time when using large flow hypergraphs, , by further pruning of scheduled block pairs or more advanced flow algorithms like (E)IBFS <cit.>.
Furthermore, the impact of HFC refinement with small flow hypergraphs on fast and medium-quality partitioners such as PaToH could be a promising direction, since previous work on bipartitioning <cit.> already gave promising results.







§ COMPONENT EVALUATION




We assess the impact of the additional algorithmic components (DP for isolated vertices, distance-based piercing, keep piercing/most balanced cuts) by comparing KaHyPar-HFC with a KaHyPar-HFC version where one component is disabled (No-Iso-DP, No-Distance, No-MBC).
The evaluation is performed on the parameter configuration benchmark set (set D) of KaHyPar-MF <cit.> containing 25 smaller hypergraphs.
Each hypergraph is again partitioned into k ∈{2,4,8,16,32,64,128} blocks. Thus, in total the experiments include 175 instances.
The results in Figure <ref> are quite surprising.
The distance-based piercing heuristic is quite important for the solution quality of KaHyPar-HFC and the most balanced cuts/keep piercing heuristic helps a little bit.
Surprisingly, the DP for isolated vertices had little impact on solution quality.
We use it nonetheless, because it was vital for ReBaHFC, it did not impair solution quality, and because it might work better on larger instances.





§ THE BENCHMARK SET








§ AGGREGATE RUNNING TIMES AND FAILED RUNS


On one instance, HYPE output an infeasible objective value.
Mondriaan reported an error on 4 instances.
Regarding infeasible solutions, hMetis-K computes imbalanced partitions on 484 instances.
To the best of our understanding, the hMetis-K paper <cit.> does not mention a constraint or penalty on maximum vertex weights during coarsening.
Heavy vertices make it difficult for initial partitioning to find balanced partitions, which could be a possible explanation for these effects.



In a rerun of one seed of the experiments, where we disabled some expensive timing measurements, KaHyPar-HFC* only times out on 60 instances and KaHyPar-HFC on 57.
These numbers are more consistent with the reported running times than the timeouts reported in Table <ref>.
On the instances that still time out, initial partitioning often dominates the running time.
This can be solved by implementing techniques to sparsify the coarsest hypergraph.



§ COMPARING ALL PARTITIONERS FOR DIFFERENT VALUES OF K









§ COMPARING ALL PARTITIONERS FOR DIFFERENT INSTANCE CLASSES













§ COMPARING THE BEST PARTITIONERS FROM EACH FAMILY





