{'fraction_non_alphanumeric': 0.0330415558808592, 'fraction_numerical': 0.006990708929585038, 'mean_word_length': 4.546644573322286, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Simple and Elegant Mathematical Formulation for the Acyclic DAG Partitioning Problem

This work addresses the NP-Hard problem of acyclic directed acyclic graph (DAG) partitioning problem. The acyclic partitioning problem is defined as partitioning the vertex set of a given directed acyclic graph into disjoint and collectively exhaustive subsets (parts). Parts are to be assigned such that the total sum of the vertex weights within each part satisfies a common upper bound and the total sum of the edge costs that connect nodes across different parts is minimized. Additionally, the quotient graph, i.e., the induced graph where all nodes that are assigned to the same part are contracted to a single node and edges of those are replaced with cumulative edges towards other nodes, is also a directed acyclic graph. That is, the quotient graph itself is also a graph that contains no cycles. Many computational and real-life applications such as in computational task scheduling, RTL simulations, scheduling of rail-rail transshipment tasks and Very Large Scale Integration (VLSI) design make use of acyclic DAG partitioning. We address the need for a simple and elegant mathematical formulation for the acyclic DAG partitioning problem that enables easier understanding, communication, implementation, and experimentation on the problem.


Introduction
Graph partitioning has been an active area of research for several decades, and is an essential technique for data and computation distribution for efficient computation [4,10,13]. A graph partitioning problem is, in general, defined as the task of dividing the vertex set of a directed or undirected graph into roughly balanced disjoint subsets (also called as parts, partitions, and clusters) while minimizing the total weight of edges that connect nodes from different parts [13,18,22]. Research community has developed various types of graphs for the many specific real-world scenario or applications. One type of graphs that is perhaps the de-facto for task scheduling and task/workflow management is directed acyclic graphs (DAGs). A directed acyclic graph can be defined as a graph in which there are no cycles, i.e., if there is a directed path between from a node A to a node B, there is no path from node B to node A. Hence, many efforts have focused on partitioning this specific subclass of graphs.
In this work, we focus on one special constraint variant of DAG partitioning: The acyclic DAG partitioning problem. The acyclic DAG partitioning problem introduces an additional constraint to a regular graph partitioning problem: The quotient graph of the partitioning, i.e., the resulting graph when all nodes that are assigned to the same part are contracted together to a single vertex and in which the edges represent the cumulative edges between those nodes, is also a directed acyclic graph [1,12,16,18].
The acyclic DAG partitioning problem is defined and attempted to be tackled in many domains for many years such as partitioning and computation of boolean networks [7], VLSI design [14], rail-rail transshipment [1,17], RTL simulations [2], task scheduling problems [19,20], quantum circuit simulation [8], etc. Similar to graph partitioning, acyclic DAG partitioning is an NP-Hard problem [12]. Thus, many solutions are heuristic algorithms [12,16]. Most of the recent work on acyclic partitioning has either used very restrictive approaches to avoid cycles, or expensive algorithms to detect and eliminate possible emergence of cycles [12,16]. Although many researchers tend towards fast heuristics for computations on larger data, there are efforts from many domains to formulate and solve this problem to optimality using mixed integer linear programming (ILP) models [1,17,18].
Previous work on the mathematical formulation of acyclic partitioning problem uses subtour elimination constraints derived from Traveling Salesman Problem (TSP) [15] or complex formulations with possibly expensive pre-processing phases, which may be hard to follow and discouraging for the less-informed on the topic. Furthermore, simpler model formulations tend to be easier to approach and implement and thus, help bridge the gap between theory, the understanding and communication of it, and the practice in different domains. In this work, we present a simple and elegant formulation for optimally solving the acyclic graph partitioning problem. Our main focus is elegantly modelling the acyclicity constraint since it is the major source of the complexity in the formulation. Even so, we present a concise but complete formulation for the problem.
In section 2, we define the preliminaries and formally introduce the graph partitioning and acyclic DAG partitioning problems. In section 3, we describe the previous mathematical formulations for the acyclic DAG partitioning problem and in section 4, we present our concise and straightforward model. In section 5, we give two example application areas where the proposed ILP formulation can be useful. And, in section 6 we summarize and conclude the article.

Preliminaries
A simple directed graph G s = (V, E) contains a set of vertices V and a set of directed edges That is, every edge e = (u, v) connects a distinct pair of vertices. The set of edges is defined as a subset of the cartesian of the vertex set by itself, E ⊂ V × V . In a directed graph G, in addition to the above, every vertex u has a weight associated with it and denoted by w u and every edge (u, v) ∈ E has a cost denoted by c uv , G = (V, E, w, c).
A path is a sequence of edges ( Let u ; v denote a simple path that starts from u and ends at v. A path ((u 1 , v 1 ) · (u 2 , v 2 ) · · · (u , v )) forms a (simple) cycle if all v i for 1 ≤ i ≤ are distinct and u 1 = v . A directed acyclic graph (DAG), is a directed graph with no cycles. Pred[u] = {v | (v, u) ∈ E} represent the immediate predecessors of a vertex u, and Succ[u] = {v | (u, v) ∈ E} represents the immediate successors of v. The union of the immediate predecessors and successors of a vertex u is called the neighbor set of u: . For a vertex u, the set of vertices v such that there exist a path u ; v is called the descendants of u. Similarly, the set of vertices v such that v ; u exists is called the ancestors of the vertex u. We define N v u as the set of all distinct vertices that lie on any simple path between u and v, which is equivalent to the intersection of the descendant set of u and the ancestor set of v. Definition 1. A k-way partitioning. A k-way partitioning of a graph G is a partition of its vertex set into k parts (subsets) P = {V 1 , V 2 , . . . , V k } such that all subsets V i are disjoint and collectively exhaustive, An edge e = (u, v) where u ∈ V i , v ∈ V j , and i = j is called a cut edge. The sum of the cost of all cut edges is called edge cut, which is a typical objective function to minimize in the graph partitioning problems.

Definition 2.
A balanced k-way partitioning. A k-way partitioning of a graph G in which the total weight of vertices for a given subset V i , w(V i ) = u∈V w(u), is bounded by a small imbalance parameter by the inequality: The balanced acyclic k-way partitioning problem is to find a valid balanced acyclic k-way partitioning of G where the objective function (i.e., edge cut) is minimized.
A k-way partition induces a contracted graph G = (V , E ), i.e., part graph, where the nodes represent the k parts of G, w(u ) = C(V u ), u ∈ G , and the edges (u , v ) ∈    fig. 1b, the edge from a to d creates an edge from blue to red, and the edge between b and c creates and edge from red to blue, creating a cycle in the quotient graph.

Related work
The recent work of Henzinger et al. [11] presents a formulation for the undirected balanced graph partitioning problem. This model includes the essential definition and constraints, and can be used as a basis for our problem variant. The recent notable efforts on mathematical formulation of acyclic partitioning problem are due to Nossack et al. [17,18] and Albareda-Sambola et al. [1].
Nossack et al. [17] introduce a model with a high memory complexity. Their follow-up work [18] improves this model, and introduces another novel model from a different perspective, augmented set partitioning formulation. Both formulations by Nossack et al. [17,18] rely on the Miller-Tucker-Zemlin (TMZ) subtour elimination constraints from the Traveling Salesperson Problem [15] for the acyclicity constraint. As the problem is dividing the set of vertices into subsets, the resulting assignment may present equivalent (e.g., symmetric) optimal solutions from the possible solutions space. Thus, they introduce additional constraints to reduce the symmetry. We further discuss one of the models they presented in section 3.2.
Albareda-Sambola et al. [1] reformulates the model presented by Nossack et al. [18], and introduces a rather comprehensive preprocessing of ancestor and descendant sets of each node to forbid beforehand some node pairs that cannot lead to a valid partitioning and introduces additional valid inequalities as constraints in order to limit the search space and speed up the execution time of ILP solvers for their formulation.
Their formulation starts with the same base constraints and then moves towards a topological-order-based formulation approach, which is a huge step towards a simpler formulation. On the other hand, the inequalities presented as constraints include many complex components and the preprocessing-related variables, which makes the final set of constraints hard to understand (e.g., pairwise connectivity of all nodes, O(|V |·|E|) pre-computed values, many constraints, etc.). We discuss their formulation further in section 3.3.
Before delving into acyclic partitioning formulations, we first briefly introduce the mathematical formulation of the undirected balanced graph partitioning from Henzinger et al. [11] in section 3.1, since it introduces the common components of all formulations. Then, in section 3.2, we present the improved formulation model by Nossack et al. [18], and in section 3.3, we briefly describe the reformulation by Albareda-Sambola et al. [1].

Formulation for Undirected Graph Partitioning
The first step is to introduce a variable for the computation of the objective function, i.e., edge cut. z ij is defined for each edge as a binary variable which is set to one if the edge (i, j) is cut, and zero otherwise. Then, the objective funtion is defined as the minimization of the sum of the cost of cut edges (eq. 1). An equivalent definition sets z ij as zero for cut edges and one for internal (uncut) edges and defines the objective function as maximizing the sum of the cost of internal edges (alternatively phrased as z ij is set to 1 if i and j belong to the same part, and zero otherwise), which is the preferred presentation by both Nossack et al. [18] and Albareda-Sambola et al. [1].
The constraints (2) enforce that each node is assigned to exactly one part, and (3) enforce the total weight balance constraint for each part. The constraints (4) make sure that the z ij variables are set to 1 if the vertices i and j are not assigned to the same part. B denotes the balance weight limit including the imbalance ratio factored in as defined in section 2. The w i denotes the weight of vertex i, c ij denotes the cost of edge {i, j} and defined only over the set of existing edges. The decision variable x is is a binary variable set to 1 if the vertex i is assigned to the part s.
Then, the formulation is as follows. Objective: Minimize the edge cut.
Subject to: Constraint that all nodes belong to exactly one part: Constraint for part weight balance: Constraint for marking (i.e., setting the z ij variable to one) the cut edges if they are in the different parts: Domains of decision variables: In all following formulations with the same objective (i.e., minimizing the edge cut/maximizing the weight of internal edges), the z ij variables can be relaxed to continuous variables.

Nossack et al.'s Model
Nossack et al. [17]'s initial formulation deviates from the formulation defined in section 3.1 by defining the z variable three dimensional in which the first two dimensions are for the pairs of nodes, and the third is for a specific part number. Their next work improves this initial formulation and uses a two dimensional z variable. Hence, we ignore their earlier formulation and focus on the improved formulation presented in [18].
The main components of the formulation does not deviate drastically from the undirected partitioning to acyclic DAG partitioning. Only, the acyclic DAG partitioning includes additional constraints to address the acyclicity. And several constraints to further decrease the search space and improve runtime performance in ILP solvers. The mathematical formulation of Nossack et al.'s approach assumes the number of parts can be as high as the number of nodes. To unify and simplify the presentation, we present the limit of number of parts as k, as opposed to N = |V |. As noted, the definition of z ij is the reverse of Henzinger et al. [11]'s, i.e., the cut edges are marked as zero and internal (uncut) edges are marked as one.
Their formulation is as follows: Objective: Maximize the total cost of internal edges, i.e., edges whose end points i and j belong to the same part s. max Subject to: Constraint for all nodes belonging to exactly one part: Constraint for part weight balance: Constraint for marking the internal (uncut) edges if they are in the same part: Constraints for applying triangular inequality for all nodes j that lie in any path between i and h. If i and h are in the same part, j must be in the same part as well. If i and j are not in the same part (i.e., z ij is cut), i and h cannot be in the same part (i.e., z ih must also be cut), and if j and h are not in the same part, i and h cannot be in the same part: Constraints for variables in y matrix, i.e., induced edges represented as an adjacency matrix of parts, i.e., every cell of y matrix, y st has value 1 if there exists an edge between any node in V s to any node in V t : Constraints for π values from TMZ subtour (cycle) elimination constraints (See [15]): Constraint to decrease symmetry by assigning the part indices sorted by total vertex weight within the part: Domains of decision variables: Although an essential part of the formulation, the constraints that address the acyclicity are adapted from Miller-Tucker-Zemlin subtour elimination formulation for Traveling Salesperson Problem [15].
The essence of the approach is to define an integer π variable for each part within the range [0,k) where each part is to be assigned a unique value. For a valid acyclic partitioning there exists a one-to-one mapping between the integers in the range [0,k) and the π values. The y matrix is essentially the adjacency matrix for the induced, quotient graph. The π and y variables together with the constraints in (11), the formulation enforces the parts to have unique topological order indices and all nodes that lie in between two nodes from the same part in any path to be assigned in the same part.
Since the part assignments can lead to many symmetrical solutions (e.g., just the possible reorderings of part indices lead to k! identical partitions), the constraint (15) is added to enforce part indices to start from the largest part to smallest in total vertex weight size. Although this does not prevent all symmetrical solutions, it reduces the optimal solution count significantly.

Albareda-Sambola et al.'s Model
Albareda-Sambola et al. [1]'s main idea is to improve upon the previous formulations by filtering out some of the impossible cases with the help of a pre-processing phase and introducing additional valid inequalities. They experiment with many valid inequalities as the set of constraint combinations. The new formulations they present have closer ties to the topological orderability of DAGs. The formulation enforces that the part assignment follows a topological order, i.e., there exists an edge (i, j) ∈ E, i ∈ V s , j ∈ V t if and only if s < t. That is, the indices of the parts should be sorted in a topological order. This is a huge step towards a simpler formulation of the model. However, combined with the complexity of the variables introduced in pre-processing and constraints defined as a sum function on the part assignment vectors for each pair of connected nodes makes the formulation more complex and hard to follow.
Their pre-processing step defines the new variables α ij = 1 if i ; j and A ij for each (i, j) pair where i < j, i ; j as Last, A ijl is defined as the weight sum of all distinct nodes on all paths i ; j, j ; l, and i ; l, i.e., Here, the α ij variable is equal to one if j is a descendant of i, i.e., there exists a path from i to j. And, the A ij variables store the weight sum of all nodes that lie on any path between the nodes i and j, including i and j. The intuition behind the A ij variables is that for any acyclic partitioning in which nodes i and j are assigned to the same part, all nodes that are on any path between the two nodes must be in the same part as well. Thus, if A ij > B, there is no feasible solution that assigns i and j to the same part. Computation of total node weight A ij for each pair of ancestor-descendant nodes helps eliminate part assignments where the total part weight constraint is violated. The downside, on the other hand, is the computation of all distinct vertices on any path between all (i, j) connected pairs of nodes and the introduction of O(k · |V | 2 ) constraints as in (23) and (24) can be computationally expensive and challenging. For small graphs, this can be a trivial computation but as the scale and density of graphs increase, the amount of data to store and compute increases drastically, leading to the need for more complex algorithms that can do those computations efficiently.
The formulation of Albareda-Sambola et al. is as follows. Objective: Maximize the sum of the cost of internal edges.
Subject to: Constraint for all nodes belonging to exactly one part: Constraint for part weight balance: The following constraints are to preserve the acyclicity of partitioning and the topological order of part indices. These constraints for part assignment prevent creation of edges (V s , V t ) where s > t in the quotient graph adjacency matrix: Domains of decision variables: The acyclicity constraints in (23 -25) above restrict the part assignments of i and j to x and y, x ≤ y if A ij ≤ B and x < y if A ij > B respectively. The constraint (25) ensures the correct assignment of z ij variables when i and j are assigned different parts. Note that although the set of decision variables is smaller, the preprocessed A ij values may be as many as O(|V | 2 ).
The above formulation is complete by itself, however, to improve the formulation, the authors add further filtering constraints using the computed A ij and A ijl values from preprocessing and add the following constraint to make their final best performing formulation: In addition, modify the triangular inequality constraints to utilize the A ij and B values as follows: Finally, as the final extension and simplification to their formulation, they replace the constraints (23-25) with the following:

A simple and elegant formulation
Our formulation builds on top of the simple idea of topological orderability of DAGs. It is known that for any given DAG there exists at least one topological ordering of the nodes in which all edges are from lower order nodes towards higher order nodes, and, a graph is topologically orderable if and only if it is a directed acyclic graph. This has been used in many different domains that makes use of DAGs such as dynamic topological order maintenance algorithms for streaming and evolving DAGs [21], and indeed, Albareda-Sambola et al. [1] makes use of this property in their formulation as well.
In our formulation, we return to the roots of the problem, and build our solution with the minimal and simple constraint inequalities: Given a DAG G, we want to partition the vertex set into disjoint subsets where the quotient graph is also a directed acyclic graph. Therefore, the resulting quotient graph should also have at least one topological ordering. Then, we can ignore the many symmetrical solutions by focusing on one specific solution where the part indices are assigned in one arbitrary valid topological ordering for the quotient graph, and enforce this information at the adjacency matrix of the quotient graph. Mathematically, the formulation becomes enforcing the adjacency matrix to be an upper triangular matrix.
Our proposed formulation is as follows. Objective: Minimize the edge cut where z ij is one for a cut edge and zero otherwise.
Subject to: Constraint for all nodes belonging to exactly one part: Constraint for part weight balance: Constraint for marking the cut edges as 1 if they are in different parts: x js − x is ≤ z ij ∀(i, j) ∈ E, 0 ≤ s < k (42) Constraints for the decision variables in y matrix, i.e., induced edges represented as an adjacency matrix of parts: Constraint for topologically ordering the part indices and decrease symmetry by restricting the strictly lower triangle of the y matrix: Domains of decision variables: Here, the value assignments of x is and z ij variables shape the nonzero values of y matrix. The acyclicity constraint is enforced by the restriction on the strictly lower triangle of the y matrix. This restriction indirectly prevents any assigment of parts where (i, j) ∈ E, i ∈ V s , j ∈ V t and t < s since y st ≥ 1 contradicts with y st = 0 in this case. It is important to note that the y variable in this formulation need not store the exact adjacency matrix since there is no tight-bound constraint nor an objective function defined on it. Formally, we can define the Adj, adjacency matrix for the part graph where: Then, y st ≥ Adj st . Thus, there is no restriction to set the values to zero for the upper triangle of y when there is no edge to indicate so in the quotient graph. However, the constraints enforce that all nonzero cells of the actual adjacency matrix of the quotient graph are correctly assigned nonzeros in the y matrix as well. And, the critical section, i.e., the strictly lower triangle is always set to zero. This formulation saves us from the need for additional variables around TMZ formulation (e.g., π) and constraints to eliminate symmetrical solutions as was used in Nossack et al. [18]'s formulations as well as complex formulations with significant pre-processing steps as was used in Albareda-Sambola et al. [1]'s formulations.

Real-World Impact
Since ILP formulations of the acyclic k-way partitioning problem are not feasible algorithms for large inputs (e.g., number of nodes > 1000), we focus on the scenarios where this deficiency can be mitigated. Here, we give two examples of where this new formulation is useful. First, we design heuristic algorithms that utilize ILP formulation within the popular multilevel acyclic partitioning paradigm. Then, we present a real-world example use case, i.e., partitioning for hierarchical state-vector based quantum circuit simulations, where the ILP is used as the lower bound/optimal result as the baseline for heuristic algorithms.

Application within Multilevel Partitioning Paradigm
Multilevel partitioning is first introduced in 1990s [3], and is the de facto approach for many graph partitioning problems [5,6,12,13,16,22]. In high level, a multilevel partitioning algorithm consists of 3 phases: coarsening, initial partitioning, and uncoarsening/refinement. Coarsening is the application of a series of contractions of the nodes of an input graph to create smaller but similar instances of the input. The goal is to reduce the size of the problem to a more manageable size while preserving the main features of the input. The initial partitioning phase is where the coarsest graph is partitioned into the desired number of parts. The initial partitioning can afford expensive algorithms that would not be feasible for the original input since the coarsening phase ideally reduces the problem size significantly. The uncoarsening phase is essentially the reverse of the coarsening phase: The small, coarse graph is uncontracted back to the original layer by layer. And, at each step of the uncoarsening, a refinement algorithm is applied in order to improve the objective function.
There are multiple ways to apply the presented simplified perspective to the acyclic partitioning problem to the multilevel paradigm. We briefly mention three opportunities: We can 1. design coarsening and refinement algorithms that maintain acyclicity and the node indexing which conforms to the topological ordering. This idea is closely related with the application of dynamic topological order maintenance algorithms [21] to the partitioning result, however, it is not implemented in the recent acyclic graph partitioning algorithms [12,16]. Maintaining a topological order of partitions/contracted nodes, or, maintaining an upper-triangular matrix of adjacency relation, during coarsening and refinement allows us to reduce the calls to cycle detection procedures. We would need to run it only for the cases where the change in the graph creates an edge from a higher indexed node (or part) to a lower indexed node (or part). Thus, effectively reduces the potential necessary cycle detection calls by half since creation of any edge from a lower indexed entity to a higher indexed entity as well as removal of any edge cannot create a cycle.
2. define an ILP-based initial partitioning (either as an optimal partitioning or a timerestricted heuristic approach), which may be feasible only because coarsening can bring the size of the graph to a manageable size. Normally, ILP solutions are not feasible for larger instances because ILP defines exponentially more variables and constraints which make it much harder to store and process. Since typically, coarsening phase is used to produce small representatives of input (e.g., less than 500 nodes), it may bring the execution time within a tolerable range.
3. use ILP formulation as a refinement algorithm, using the result of initial partitioning as a hot start. Many recent ILP solvers allow starting with a user-defined valid or partial solution. And, users have the option to either search for the optimal solution or search for an improvement given a time limit. As with any other refinement algorithm, one can project back the partitioning of coarser graph to the current, finer graph and use this partition projection as initial solution for the ILP solver. Although the ILP solvers do not make any promises about the use of or improvement upon a given initial solution, the result would be at least as good as the given initial solution.
Exploring the best ways to design coarsening and refinement phases with ILP solvers for acyclic partitioning is an interesting, ongoing research effort. Algorithms toward similar goals are developed for the general undirected graph partitioning problem in [11].

Application in Quantum Circuit Simulation Problem
Using ILP for partitioning is generally not efficient since the problem sizes can get quite large and ILP solvers are not favorable in terms of the runtime in this case. Quantum circuit simulation is a recent problem area where a quantum computation is represented as a directed acyclic graph and simulated using classical computers. Currently, the largest quantum computers can compute circuits with up to 127 qubits (quantum bits), however, many simulators can not handle even the half of this number [8]. As the number of qubits are still low, the simulated circuits are also quite small compared to inputs of other use cases (e.g., simulations and scheduling for classical computation [19,20]). This makes ILP solver based partitioning a feasible approach for the partitioning of quantum circuit simulation algorithms.
We develop an ILP formulation for the specific partitioning problem defined in HiSVSIM [8]. Here, the problem is partitioning a quantum circuit DAG acyclically into minimum possible number of parts, where the resulting parts contain no more than a given number of unique qubits. The added constraints are for counting and limiting the unique qubits per part given a maximum allowed number of qubits limit (L m ). Finally, the problem objective is not only the minimization of edge cut, but also the number of parts.
The input datasets for HiSVSIM [8] consists of 13 quantum circuits (9 unique quantum circuits) where the number of qubits are between 30 and 37. Out of 13 circuits, 10 of them contain less than 500 quantum gates, and 6 of them contain less than 200 gates. Thus, the problem sizes are small enough to try ILP solver based approaches.
The input graphs for this problem has the following structure. All quantum gates are represented as nodes and all qubits (operands of quantum computation gates) are represented as edges. The graph contains entry and exit gates for each qubit. Each qubit is an in-edge to and out-edge from a single node at any time. And, qubits can be traced as a line subgraph from their respective entry nodes to respective exit nodes. Thus, given a quantum circuit DAG, the involved qubits of each node is known. And given a subset of nodes, it is trivial to identify the unique qubits involved in this subset.
We define Q as a set of qubits, binary N Q matrix to store node(quantum gate)-qubit dependence and the values of N Q are pre-computed in linear time with respect to the number of edges in the DAG. The cell N Q iq stores 1 if the qubit q is required for the computation of node i. Then, we define a binary decision variable P Q that stores the qubit dependence of parts, i.e., the cell P Q sq stores 1 if the qubit q is required for part s. Then, the ILP formulation for this problem variant becomes: Objective: Minimize the edge cut where z ij is one for a cut edge and zero otherwise.
Subject to: Constraint for all nodes belonging to exactly one part: Constraint for part weight balance: Constraint for marking the cut edges as 1 if they are in different parts: x js − x is ≤ z ij ∀(i, j) ∈ E, 0 ≤ s < k (52) Constraints for the decision variables in y matrix, i.e., induced edges represented as an adjacency matrix of parts: Constraint for topologically ordering the part indices and decrease symmetry by restricting the strictly lower triangle of the y matrix: Constraints for limiting the number of qubits per part by L m : Domains of decision variables: It is important to note that the objective in this problem is to minimize the number of parts, and then the edge cut. There are two ways to achieve this. First, we can try, starting from a small k value and increase one by one while trying to find a feasible solution and stop as soon as a feasible solution is found (or binary search for the smallest k value with a feasible solution). Second, we can define an additional binary variable for each part that stores true if a part contains at least one node. Then, multiply this variable with a sufficiently large number and use it as an additive component in the objective function. The proposed ILP formulation was successfully used to find the optimal partitioning solution for the acyclic quantum circuit partitioning problem.

Discussion and Conclusion
Nossack et al. [17] presents one of the few analyses of the mathematical formulations for the acyclic partitioning problem. Albareda-Sambola et al. [1] introduce a pre-processing phase and many carefully deduced valid inequality constraints to speed up the computation of an optimal solution when using linear solvers. In this work, we present a formulation that can be used together with/in addition to the previous formulations. We would like to note that, although the main goal of this work is on presenting a simple and elegant formulation, our experiments on a set of DAGs using the latest version of Gurobi Optimizer available today (v9.5.0) [9] showed similar runtime performance for our acyclicity constraints compared to Albareda et al. [1]'s formulations for the ILP solver phase. And, that Gurobi Optimizer eliminates many variables and constraints (rows and columns) as redundant during the its presolve phase for all three formulations. This indicates that the recent advances in the ILP solver software can make up for the need for introducing additional valid inequalities as constraints to limit the search space. This has been a significant tradeoff decision for many for years as to whether and how many new decision variables and constraints to include (which increases the model formulation complexity, but may reduce the solution search space) for the perfect balance for the ILP runtime performance.
To conclude, we present a simple and elegant formulation for the acyclic DAG partitioning problem that eliminates many additional variables, redundant constraints and symmetrical solutions, and, finally we show two example real-world scenarios where an elegant ILP-based formulation can be utilized. Our formulation performs similarly compared to more complex formulations. Finally, the simplicity of the formulation may help enable many others to easily define, model, implement, and experiment with balanced acyclic DAG partitioning problem and formulations.