Typical Sequences Revisited --- Computing Width Parameters of Graphs

In this work, we give a structural lemma on merges of typical sequences, a notion that was introduced in 1991 [Lagergren and Arnborg, Bodlaender and Kloks, both ICALP 1991] to obtain constructive linear time parameterized algorithms for treewidth and pathwidth. The lemma addresses a runtime bottleneck in those algorithms but so far it does not lead to asymptotically faster algorithms. However, we apply the lemma to show that the cutwidth and the modified cutwidth of series parallel digraphs can be computed in $\mathcal{O}(n^2)$ time.


Introduction
In this paper we revisit an old key technique from what currently are the theoretically fastest parameterized algorithms for treewidth and pathwidth, namely the use of typical sequences, and give additional structural insights for this technique. In particular, we show a structural lemma, which we call the Merge Dominator Lemma. The technique of typical sequences brings with it a partial ordering on sequences of integers, and a notion of possible merges of two integer sequences; surprisingly, the Merge Dominator Lemma states that for any pair of integer sequences there exists a single merge that dominates all merges of these integer sequences, and this dominating merge can be found in linear time. On its own, this lemma does not lead to asymptotically faster parameterized algorithms for treewidth and pathwidth, but, as we discuss below, it is a concrete step towards such algorithms.
The notion of typical sequences was introduced independently in 1991 by Lagergren and Arnborg [15] and Bodlaender and Kloks [8]. In both papers, it is a key element in an explicit dynamic programming algorithm that given a tree decomposition of bounded width , decides if the pathwidth or treewidth of the input graph G is at most a constant k. Lagergren and Arnborg build upon this result and show that the set of forbidden minors of graphs of treewidth (or pathwidth) at most k is computable; Bodlaender and Kloks show that the algorithm can also construct a tree or path decomposition of width at most k, if existing, in the same asymptotic time bounds. The latter result is a main subroutine in Bodlaender's linear time algorithm [3] for treewidth-k. If one analyses the running time of Bodlaender's algorithm for treewidth or pathwidth ≤ k, then one can observe that the bottleneck is in the subroutine that calls the Bodlaender-Kloks dynamic programming subroutine, with both the subroutine and the main algorithm having time O(2 O(k 3 ) n) for treewidth, and O(2 O(k 2 ) n) for pathwidth. See also the recent work by Fürer for pathwidth [13], and the simplified versions of the algorithms of [3,8] by Althaus and Ziegler [1]. Now, over a quarter of a century after the discovery of these results, even though much work has been done on treewidth recognition algorithms (see e.g. [2,5,11,12,13,14,16,17]), these bounds on the function of k are still the best known, i.e. no O(2 o(k 3 ) n O(1) ) algorithm for treewidth, and no O(2 o(k 2 ) n O(1) ) algorithm for pathwidth is known. An interesting question, and a long-standing open problem in the field [4,Problem 2.7.1], is whether such algorithms can be obtained. Possible approaches to answer such a question is to design (e.g. ETH or SETH based) lower bounds, find an entirely new approach to compute treewidth or pathwidth in a parameterized setting, or improve upon the dynamic programming algorithms of [15] and [8]. Using our Merge Dominator Lemma we can go one step towards the latter, as follows.
The algorithms of Lagergren and Arnborg [15] and Bodlaender and Kloks [8] are based upon tabulating characteristics of tree or path decompositions of subgraphs of the input graph; a characteristic consists of an intersection model, that tells how the vertices in the current top bag interact, and for each part of the intersection model, a typical sequence of bag sizes. 1 The set of characteristics for a join node is computed from the sets of characteristics of its (two) children. In particular, each pair of characteristics with one from each child can give rise to exponentially (in k) many characteristics for the join node. This is because exponentially many typical sequences may arise as the merges of the typical sequences that are part of the characteristics. In the light of our Merge Dominator Lemma, only one of these merges has to be stored, reducing the number of characteristics arising from each pair of characteristics of the children from 2 O(k) to just 1. Moreover, this dominating merge can be found in O(k) time, with no large constants hidden in the 'O'.
Merging typical sequences at a join node is however not the only way the number of characteristics can increase throughout the algorithm, e.g. at introduce nodes, the number of characteristics increases in a different way. Nevertheless, the number of intersection models is O(k O(k) ) for pathwidth and O(k O(k 2 ) ) for treewidth; perhaps, with additional techniques, the number of typical sequences per part can be better bounded -in the case that a single dominating typical sequence per part suffices, this would reduce the number of table entries per node to O(k O(k) ) for pathwidthk, and to O(k O(k 2 ) ) for treewidth-k, and yield O(k O(k) n) and O(k O(k 2 ) n) time algorithms for the respective problems.
We give direct algorithmic consequences of the Merge Dominator Lemma in the realm of computing width parameters of directed acyclic graphs (DAGs). Specifically, we show that the (Weighted) Cutwidth and Modified Cutwidth problems on DAGs, which given a directed acyclic graph on n vertices, ask for the topological order that minimizes the cutwidth and modified cutwidth, respectively, can be solved in O(n 2 ) time on series parallel digraphs. Note that the restriction of the solution to be a topological order has been made as well in other works, e.g. [6].
Our algorithm for Cutwidth of series parallel digraphs has the same structure as the dynamic programming algorithm for undirected Cutwidth [6], but, in addition to obeying directions of edges, we have a step that only keeps characteristics that are not dominated by another character-istic in a table of characteristics. Now, with help of our Merge Dominator Lemma, we can show that in the case of series parallel digraphs, there is a unique dominating characteristic; the dynamic programming algorithm reverts to computing for each intermediate graph a single 'optimal partial solution'. This strategy also works in the presence of edge weights, which gives the algorithm for the corresponding Weighted Cutwidth problem on series parallel digraphs. Note that the cutwidth of a directed acyclic graph is at least the maximum indegree or outdegree of a vertex; e.g., a series parallel digraph formed by the parallel composition of n − 2 paths with three vertices has n vertices and cutwidth n − 2. To compute the modified cutwidth of a series parallel digraph, we give a linear-time reduction to the Weighted Cutwidth problem on series parallel digraphs.
This paper is organized as follows. In Section 2, we give a number of preliminary definitions, and review existing results, including several results on typical sequences from [8]. In Section 3, we state and prove the main technical result of this work, the Merge Dominator Lemma. Section 4 gives our algorithmic applications of this lemma, and shows that the directed cutwidth and directed modified cutwidth of a series parallel digraph can be computed in polynomial time. Some final remarks are made in the conclusions Section 5.

Preliminaries
We use the following notation. For two integers a, b ∈ N with a ≤ b, we let [a..b] . . = {a, a + 1, . . . , b} and for a > 0, we let [a] . . = [1..a]. If X is a set of size n, then a linear order is a bijection π : X → [n]. Given a subset X ⊆ X of size n ≤ n, we define the restriction of π to X as the bijection π| X : X → [n ] which is such that for all x , y ∈ X , π| X (x ) < π| X (y ) if and only if π(x ) < π(y ).
For a sequence s of length n and a set X ⊆ [n], we denote by s[X] the subsequence of s induced by X, i.e. let X = {x 1 , . . . , x m } be such that for Let Ω be a set. A matrix M ∈ Ω m×n over Ω is said to have m rows and n columns. For sets X ⊆ [m] and Y ⊆ [n], we denote by M [X, Y ] the submatrix of M induced by X and Y , which consists of all the entries from M whose indices are in X × Y . For be the corresponding sequence of entries from M . For illustrative purposes we enumerate the columns of a matrix in a bottom-up fashion throughout this paper, i.e. we consider the index (1, 1) as the 'bottom left corner' and the index (m, n) as the 'top right corner'.
Integer Sequences. Let s be an integer sequence of length n. We use the shorthand 'min(s)' for 'min i∈[n] s(i)' and 'max(s)' for 'max i∈[n] s(i)'; we use the following definitions. We let argmin(s) . . = {i ∈ [n] | s(i) = min(s)} and argmax(s) . . = {i ∈ [n] | s(i) = max(s)} be the set of indices at whose positions there are the minimum and maximum element of s, respectively. Whenever we write i ∈ argmin(s) (j ∈ argmax(s)), then the choice of i (j) can be arbitrary. In some places we require a canonical choice of the position of a minimum or maximum element, in which case we will always choose the smallest index. Formally, we let argmin (s) . . = min argmin(s), and argmax (s) . . = min argmax(s).
The following definition contains two notions on pairs of integer sequences that are necessary for the definitions of domination and merges.
Definition 2.1. Let r and s be two integer sequences of the same length n.
(i) If for all i ∈ [n], r(i) ≤ s(i), then we write 'r ≤ s'.
Definition 2.2 (Extensions). Let s be a sequence of length n. We define the set E(s) of extensions of s as the set of sequences that are obtained from s by repeating each of its elements an arbitrary number of times, and at least once. Formally, we let

Definition 2.3 (Domination).
Let r and s be integer sequences. We say that r dominates s, in symbols 'r ≺ s', if there are extensions r * ∈ E(r) and s * ∈ E(s) of the same length such that r * ≤ s * . If r ≺ s and s ≺ r, then we say that r and s are equivalent, and we write r ≡ s.
If r is an integer sequence and S is a set of integer sequences, then we say that r dominates S, in symbols 'r ≺ S', if for all s ∈ S, r ≺ s. Remark 2.4 (Transitivity of '≺'). In [8,Lemma 3.7], it is shown that the relation '≺' is transitive. As this is fairly intuitive, we may use this fact without stating it explicitly throughout this text. Definition 2.5 (Merges). Let r and s be two integer sequences. We define the set of all merges of r and s, denoted by r ⊕ s, as r ⊕ s . . = {r * + s * | r * ∈ E(r), s * ∈ E(s), l(r * ) = l(s * )}.

Typical Sequences
We now define typical sequences, show how to construct them in linear time, and restate several lemmas due to Bodlaender and Kloks [8] that will be used throughout this text. Definition 2.6. Let s = s(1), . . . , s(n) be an integer sequence of length n. The typical sequence of s, denoted by τ (s), is obtained from s by an exhaustive application of the following two operations: Removal of Consecutive Repetitions. If there is an index i ∈ [n − 1] such that s(i) = s(i + 1), then we change the sequence s from s(1), . . . , s(i), s(i + 1), . . . , s(n) to s(1), . . . , s(i), s(i + 2), . . . , s(n).
Typical Operation. If there exist i, j ∈ [n] such that j − i ≥ 2 and for all i ≤ k ≤ j, s(i) ≤ s(k) ≤ s(j), or for all i ≤ k ≤ j, s(i) ≥ s(k) ≥ s(j), then we change the sequence s from s(1), . . . , s(i), s(i + 1), . . . , s(j), . . . , s(n) to s(1), . . . , s(i), s(j), . . . , s(n), i.e. we remove all elements (strictly) between index i and j. To support intuition, we illustrate the rough shape of a typical sequence in Figure 1. It is not difficult to see that the typical sequence can be computed in quadratic time, by an exhaustive application of the definition. Here we discuss how to do it in linear time. We may view a typical sequence τ (s) of an integer sequence s as a subsequence of s. While τ (s) is unique, the choice of indices that induce τ (s) may not be unique. We show that we can find a set of indices that induce the typical sequence in linear time, with help of the following structural proposition.
Proof. First, we observe that by the choice made in the definition of argmin and argmax , for each h ∈ [0..(t + 1)] there is no i < j h such that s(i) = s(j h ). ( We prove the following statement. Under the stated conditions, for a given h ∈ [0..t + 1], the typical sequence of s restricted to [j h ..i ] is equal to s(j h ), s(j h+1 ), . . ., s(j t+1 ). The proposition then follows from the case h = 0. The proof is by induction on d . . = (t+1)−h. For d = 0, it trivially holds since the minimum and the maximum element are always part of the typical sequence, and since [j t+1 ..i ] = {i }. Now suppose d > 0, and for the induction hypothesis, that the claim holds for d − 1. Suppose that s(j h ) > s(j h+1 ), meaning that j h = argmax (s[1..j h+1 ]), and j h+1 = argmin (s[1..j h+1 ]), the other case is symmetric. By the induction hypothesis, the typical sequence of s restricted to [j h+1 ..i ] is equal to s(j h+1 ), . . ., s(j t+1 ), in particular it implies that s(j h+1 ) is an element of the typical sequence. To prove the induction step, we have to show that the typical sequence restricted to [j h ..j h+1 ] is equal to s(j h ), s(j h+1 ). We first argue that if there is an element of the typical sequence in [j h ..(j h+1 − 1)], then it must be equal to s(j h ). By (2), we have that there is no i < j h+1 such that s(i) = s(j h+1 ), hence [j h ..(j h+1 − 1)] cannot contain any element of the typical sequence that is equal to s(j h+1 ). Next, since the typical operation removes all elements i ∈ [(j h + 1)..(j h+1 − 1)] with s(j h ) > s(i) > s(j h+1 ), and since j h = argmax (s[1..j h+1 ]), the only elements from [j h ..(j h+1 − 1)] that the typical sequence may contain have value s(j h ).
It remains to argue that s(j h ) is indeed an element of the typical sequence. Suppose not, then there are indices i, i with i < j h < i , such that either s(i) ≤ s(j h ) ≤ s(i ), or s(i) ≥ s(j h ) ≥ s(i ), and we may assume that at least one of the inequalities is strict in each case. For the latter case, since j h = argmax (s[1..j h+1 ]), we would have that s(i) = s(j h ), which is a contradiction to (2). Hence, we may assume that s(i) ≤ s(j h ) ≤ s(i ). There are two cases to consider: i ∈ [(j h +1)..j h+1 ], and i > j h+1 . If i ∈ [(j h + 1)..j h+1 ], then s(i ) = s(j h ), as s(j h ) = argmax(s[1..j h+1 ]). We can conclude that in this case, the typical sequence must contain an element equal to s(i ), and hence equal to s(j h ). If i > j h+1 , then the typical operation corresponding to i and i also removes s(j h+1 ), a contradiction with the induction hypothesis which asserts that s(j h+1 ) is part of the typical sequence induced by [j h+1 ..i ]. We can conclude that s(j h ) is part of the typical sequence, finishing the proof.
From the previous proposition, we have the following consequence about the structure of typical sequences ending in the minimum element, which will be useful in the proof of Lemma 3.10.
Equipped with Proposition 2.7, we can now proceed and give the linear-time algorithm that computes a typical sequence of an integer sequence. Proof. First, we check for each i ∈ [n − 1] whether s(i) = s(i + 1), and if we find such an index i, we remove s(i). We assume from now on that after these modifications, s has at least two elements, otherwise it is trivial. As observed above, the typical sequence of s contains min(s) and max(s). A closer look reveals the following observation.    .i ], we will describe a marking procedure that marks a set of indices satisfying the preconditions of Proposition 2.7. Next, we observe that n − k is the smallest index of any occurrence of min(s) or max(s) in the reverse sequence of s, therefore a symmetric procedure, again using Proposition 2.7, yields the indices that induce τ (s) on s[k ..n].
We execute Algorithm 1, which processes the integer sequence s[1.
.i ] from the first to the last element, storing two counters j min and j max that store the leftmost position of the smallest and of the greatest element seen so far, respectively. Whenever a new minimum is encountered, we mark the current value of the index j max , as this implies that s(j max ) has to be an element of the typical sequence. Similarly, when encountering a new maximum, we mark j min . These marked indices are stored in a set M , which at the end of the algorithm contains the indices that induce τ (s) on [1..i ]. This, i.e. the correctness of the procedure, will now be argued via Proposition 2.7.  Proof. Let M = {j 0 , j 1 , . . . , j t+1 } be such that for all h ∈ [0..t], j h < j h+1 . We prove that j 0 , . . . , j t+1 meet the preconditions of Proposition 2.7. First, we observe that the above algorithm marks both the index 1 and index i , in particular that j 0 = 1 and j t+1 = i .
We verify that the indices j 0 , . . . , j t+1 satisfy the property that for each [0..(t + 1)], the index j h is the leftmost (i.e. smallest) index whose value is equal to s(j h ): whenever an index is added to the marked set, it is because in some iteration, the element at its position was either strictly greater than the greatest previously seen element, or strictly smaller than the smallest previously seen element. (This also ensures that s(j 0 ), . . . , s(j t+1 ) are pairwise distinct. ) We additionally observe that if we have two indices 1 and 2 such that 2 is the index that the algorithm marked right after it marked 1 , then either 1 was j min and 2 was j max or vice versa: when updating j min , we mark j max , and when updating j max , we mark j min . This lets us conclude that when we have two indices j h , j h+1 such that s(j h ) < s(j h+1 ), then j h was equal to j min when it was marked, and j h+1 was j max when it was marked.
We are ready to prove that j 0 , . . . , j t+1 satisfy the precondition of Proposition 2.7. Suppose for a contradiction that for some h ∈ [0..t + 1], j h violates this property. Assume that s(j h ) < s(j h+1 ) and note that the other case is symmetric. The previous paragraph lets us conclude that j h was equal to j min when it was marked, and that j h+1 was j max when it was marked.
We may assume that either j h = argmin (s[1..j h+1 ]) or that j h+1 = argmax (s[1..j h+1 ]). Suppose the latter holds. This immediately implies that there is some j * ∈ [j h+1 − 1] such that s(j * ) > j h+1 , which implies that j max would never have been set to j h+1 and hence j h+1 would have never been marked. Suppose the former holds, i.e. j h = argmin (s[1..j h ]), for an illustration of the following argument see Figure 2. Let j * . . = argmin (s[1..j h+1 ]). If j * < j h , then at iteration j h , s(j min ) < s(j h ), so j min would never have been set to j h , and hence, j h would never have been marked. We may assume that j * > j h . Since j h was marked, there is some > j h that triggered j h being marked. This also means that at that iteration s( ) was greater than the previously observed maximum, so we may assume that s( ) > s(j h ). We also may assume that ≤ j h+1 . If j * ∈ [(j h + 1)..( − 1)], then the algorithm would have updated j min to j * in that iteration, before marking j h , and for the case j * ∈ [( + 1)..(j h+1 − 1)] we observe that = j h+1 , and that the algorithm would mark as the next index instead of j h+1 .
This establishes the correctness of the algorithm. For its runtime, we observe that each iteration takes O(1) time, and that there are O(n) iterations.
We summarize several lemmas from [8] regarding integer sequences and typical sequences that Figure 2: Illustration of the final argument in the proof of Claim 2.9.2. We assume that s(j h ) < s(j h+1 ), and mark the possible positions for we will use in this work.
(ii) (Lem. 3.13 in [8]). Suppose r and s are of the same length and let y = r + s. Let r 0 ≺ r and s 0 ≺ s. Then there is an integer sequence y 0 ∈ r 0 ⊕ s 0 such that y 0 ≺ y.
(v) (Lem. 3.19 in [8]). Let r and s be two more integer sequences. If r ≺ r and s ≺ s, then r • s ≺ r • s.

Directed Acyclic Graphs
A directed graph (or digraph) G is a pair of a set of vertices V (G) and a set of ordered pairs of vertices, called arcs, is a multiset, we call G multidigraph.) We say that an arc a = (u, v) ∈ A(G) is directed from u to v, and we call u the tail of a and v the head of a. We use the shorthand 'uv' for ' If G does not contain any cycles, then we call G acyclic or a directed acyclic graph, DAG for short. Let G be a DAG on n vertices. A topological order of G is a linear order π : V (G) → [n] such that for all arcs uv ∈ A(G), we have that π(u) < π(v). We denote the set of all topological orders of G by Π(G). We now define the width measures studied in this work. Note that we restrict the orderings of the vertices that we consider to topological orderings. Definition 2.11. Let G be a directed acyclic graph and let π ∈ Π(G) be a topological order of G. Figure 3: A series parallel digraph G on the left, and a decomposition tree that yields G on the right.
We define the cutwidth and modified cutwidth of a directed acyclic graph G as the minimum of the respective measure over all topological orders of G.
We now introduce series parallel digraphs. Note that the following definition coincides with the notion of 'edge series-parallel multidigraphs' in [20]. For an illustration see Figure 3.
(b) Parallel Composition. (G, (s, t)) is obtained by taking the disjoint union of G 1 and G 2 , identifying s 1 and s 2 , and identifying t 1 and t 2 , and letting s = s 1 = s 2 and t = t 1 = t 2 .
It is not difficult to see that each series parallel digraph is acyclic. One can naturally associate a notion of decomposition trees with series parallel digraphs as follows. A decomposition tree T is a rooted and ordered binary tree whose leaves are labeled with a single arc, and each internal node t ∈ V (T ) with left child and right child r is either a series node or a parallel node. We then associate an SPD G t with t that is G G r if t is a series node and G ⊥ G r if t is a parallel node. It is clear that for each SPD G, there is a decomposition tree T with root r such that G = G r . In that case we say that T yields G. Valdes et al. [20] have shown that one can decide in linear time whether a directed graph G is an SPD and if so, find a decomposition tree that yields G. Theorem 2.13 (Valdes et al. [20]). Let G be a directed graph on n vertices and m arcs. There is an algorithm that decides in time O(n + m) whether G is a series parallel digraph and if so, it outputs a decomposition tree that yields G.

The Merge Dominator Lemma
In this section we prove the main technical result of this work. It states that given two integer sequences, one can find in linear time a merge that dominates all merges of those two sequences. Lemma 3.1 (Merge Dominator Lemma). Let r and c be integer sequence of length m and n, respectively. There exists a dominating merge of r and c, i.e. an integer sequence t ∈ r ⊕ c such that t ≺ r ⊕ c, and this dominating merge can be computed in time O(m + n).
Outline of the proof of the Merge Dominator Lemma. First, we show that we can restrict our search to finding a dominating path in a matrix that, roughly speaking, contains all merges of r and c of length at most l(r)+l(c)−1. The goal of this step is mainly to increase the intuitive insight to the proofs in this section. Next, we prove the 'Split Lemma' (Lemma 3.7 in Subsection 3.2) which asserts that we can obtain a dominating path in our matrix M by splitting M into a submatrix M 1 that lies in the 'bottom left' of M and another submatrix M 2 in the 'top right' of M along a minimum row and a minimum column, and appending a dominating path in M 2 to a dominating path in M 1 . In M 1 , the last row and column are a minimum row and column, respectively, and in M 2 , the first row and column are a minimum row and column, respectively. This additional structure will be exploited in Subsection 3.3 where we prove the 'Chop Lemmas' that come in two versions. The 'bottom version' (Lemma 3.10) shows that in M 1 , we can find a dominating path by repeatedly chopping away the last two rows or columns and remembering a vertical or horizontal length-2 path. The 'top version' (Corollary 3.12) is the symmetric counterpart for M 2 . The proofs of the Chop Lemmas only hold when r and c are typical sequences, and in Subsection 3.4 we present the 'Split-and-Chop Algorithm' that computes a dominating path in a merge matrix of two typical sequences. Finally, in Subsection 3.5, we generalize this result to arbitrary integer sequences, using the Split-and-Chop Algorithm and one additional construction.

The Merge Matrix, Paths, and Non-Diagonality
Let us begin by defining the basic notions of a merge matrix and paths in matrices.
We denote by P(M ) the set of all paths in M . A sequence p(1), . . . , p( ) that satisfies the second condition but not necessarily the first is called a partial path in M . For two paths p, q ∈ P(M ), we may simply say that p dominates q, if M [p] dominates M [q]. 2 We also write p ≺ P(M ) to express that for each path q ∈ P(M ), p ≺ q.
A (partial) path is called non-diagonal if the second condition is replaced by the following.
An extension e of a path p in a matrix M is as well a sequence of indices of M , and we again denote the corresponding integer sequence by M [e]. A consequence of Lemma 2.10(i) and (iv) is that we can restrict ourselves to all paths in a merge matrix when trying to find a dominating merge of two integer sequences: it is clear from the definitions that in a merge matrix M of integer sequences r and c, P(M ) contains all merges of r and c of length at most l(r) + l(c) − 1. Furthermore, suppose that there is a merge q ∈ r ⊕ s such that q ≺ r ⊕ s and l(q) > l(r) + l(s) − 1. By Lemma 2.10(iv), there is a merge q ∈ r ⊕ s such that l(q ) ≤ l(r) + l(s) − 1, and τ (q ) = τ (q). The latter yields τ (q ) ≡ τ (q) and therefore, by Lemma 2.10(i), q ≡ q, in particular, q ≺ q ≺ r ⊕ s. Corollary 3.4. Let r and c be integer sequences and M be the merge matrix of r and c. There is a dominating merge in r ⊕ c, i.e. an integer sequence t ∈ r ⊕ c such that t ≺ r ⊕ c, if and only if there is a dominating path in M , i.e. a path p ∈ P(M ) such that p ≺ P(M ).
We now consider a type of merge that corresponds to non-diagonal paths in the merge matrix. These merges will be used in a construction presented in Subsection 3.5, and in the algorithmic applications of the Merge Dominator Lemma given in Section 4. For two integer sequences r and s, we denote by r s the set of all non-diagonal merges of r and s, which are not allowed to have 'diagonal' steps: we have that for all t ∈ r s and all As each non-diagonal merge directly corresponds to a non-diagonal path in the merge matrix (and vice versa), we can consider a non-diagonal path in a merge matrix to be a non-diagonal merge and vice versa. We now show that for each merge that uses diagonal steps, there is always a non-diagonal merge that dominates it.
Lemma 3.5. Let r and s be two integer sequences of length m and n, respectively. For any merge q ∈ r ⊕ s, there is a non-diagonal merge q ∈ r s such that q ≺ q. Furthermore, given q, q can be found in time O(m + n).
Proof. This can be shown by the following local observation. Let i ∈ [l(q) − 1] be such that q(i), q(i + 1) is a diagonal step, i.e. there are indices i r ∈ [l(r) − 1] and i s ∈ [l(s) − 1] such that q(i) = r(i r ) + s(i s ) and q(i + 1) = r(i r + 1) + s(i s + 1). Then, we insert the element x . . = min{r(i r ) + s(i s + 1), r(i r + 1) + s(i s )} between q(i) and q(i + 1). Since x ≤ max{r(i r ) + s(i s ), r(i r + 1), s(i s + 1)} = . . y, we can repeat y twice in an extension of q so that one of the occurrences aligns with x, and we have that in this position, the value of q is at most the value of the extension of q.
Let q be the sequence obtained from q by applying this operation to all diagonal steps, then by the observation just made, we have that q ≺ q. It is clear that this can be implemented to run in time O(m + n).
Next, we define two special paths in a matrix M that will reappear in several places throughout this section. These paths can be viewed as the 'corner paths', where the first one follows the first row until it hits the last column and then follows the last column (p (M )), and the second one follows the first column until it hits the last row and then follows the last row (p (M )). Formally, we define them as follows: For instance, these paths appear in the following special cases of the Merge Dominator Lemma, which will be useful for several proofs in this section.    Proof. (i) For an illustration of this proof see Figure 4. Let q be any path in M and let t * . . = argmax (q). Let furthermore q(t * ) = (t * r , t * c ). We divide p and q in three consecutive parts each to show that p dominates q.

The Split Lemma
In this section we prove the first main step towards the Merge Dominator Lemma. It is fairly intuitive that a dominating merge has to contain the minimum element of a merge matrix. (Otherwise, there is a path that cannot be dominated by that merge.) The Split Lemma states that in fact, we can split the matrix M into two smaller submatrices, one that has the minimum element in the top right corner, and one the has the minimum element in the bottom left corner, compute a dominating path for each of them, and paste them together to obtain a dominating path for M . Proof. Let q be any path in M . If q contains (i, j), then q has two consecutive parts, say q 1 and q 2 , such that q 1 ∈ P(M 1 ) and q 2 ∈ P(M 2 ). Hence, p 1 ≺ q 1 and p 2 ≺ q 2 , so by Lemma 2.10(v), Now let p . . = p 1 • p 2 and suppose q does not contain (i, j). Then, q either contains some (i, j ) with j < j, or some (i , j), for some i < i. We show how to construct extensions of p and q that witness that p dominates q in the first case, and remark that the second case can be shown symmetrically. We illustrate this situation in Figure 5.
Suppose that q contains (i, j ) with j < j. We show that p ≺ q. First, q also contains some (i , j), where i > i. Let h 1 be the index of (i, j ) in q, i.e. q(h 1 ) = (i, j ), and h 2 denote the index of (i , j) in q, i.e. q(h 2 ) = (i , j). We derive the following sequences from q.
(I) We let e 1 ∈ E(p 1 ) and f 1 ∈ E(q + 1 ) such that l(e 1 ) = l(f 1 ) and We construct extensions e ∈ E(p) and f ∈ E(q) as follows. Let z be the last index in q of any element that is matched up with (i, j) in the extensions of (II). (Following the proof of Lemma 3.6, this would mean z is the index of max(q 12 ) in q.) We first construct a pair of extensions e j ∈ E(p 1 ), With a symmetric procedure, we can obtain extensions of p 2 and of q[(z + 1)..l(q)], and use them to obtain extensions of p = p 1 • p 2 and q = q[1..z] • q[(z + 1)..l(q)] witnessing that p ≺ q.
We give the details of the first part of the construction. Let a be the index of the last repetition in f 1 of q(h 1 − 1), i.e. the index that appears just before q(h 1 ) = (i, j ) in f 1 . We let e j −1 [1.

The Chop Lemmas
Assume the notation of the Split Lemma. If we were to apply it recursively, it only yields a size reduction whenever (i, j) / ∈ {(1, 1), (m, n)}. Motivated by this issue, we prove two more lemmas to deal with the cases when (i, j) ∈ {(1, 1), (m, n)}, and we coin them the 'Chop Lemmas'. It will turn out that when applied to typical sequences, a repeated application of these lemmas yields a dominating path in M . This insight crucially helps in arguing that the dominating path in a merge matrix can be found in linear time. Before we present their statements and proofs, we need another auxiliary lemma.  (ii) If i = 1, j = 1, k = m, and = n, then p * ≺ P(M ).
Proof. (i). First, we may assume that r(1) > r(m) and that c(1) > c(n), otherwise we could have applied one of the cases of Lemma 3.6. We prove the lemma in two steps: 1. We show that for each path q in M , p or p (or both) dominate(s) q.
2. We show that p dominates p , or vice versa, or both (depending on which case we are in).
The following claim will be useful in both steps and can be seen as a slight generalization of Lemma 3.6. Proof. Suppose that p = p , the other case is symmetric. The claim can be shown using the same argument as in Lemma 3.6, paying slight attention to the situation in which the maximum value of q is in row m, which implies that the maximum of p is in the same column.
We prove Step 1. For the following argument, see Figure 7.
and let * ∈ argmax(M [p ]). We may assume that * < n: otherwise, (3) cannot be satisfied since n ∈ argmin(c). We furthermore have that q contains (m, * ), since p contains (1, * ), and m is the only position in which r is (potentially) smaller than r(1). Therefore, this is the only way in which (3) can be satisfied. Now let k * ∈ argmax(M [p ]). As above, we may assume that k * < m. Now, since q contains (m, * ), we have that q also contains (k * , n ) for some n < n. It follows that where the first inequality follows from the fact that r(1) ≤ r(n ) for all n < n. By Claim 3.8.1, p dominates q and we finished Step 1 of the proof. Step 2 follows from another application of Claim 3.8.1 and the lemma follows from transitivity of the domination relation. This proves (i), and (ii) follows from a symmetric argument. Remark 3.9. We would like to stress that up to this point, all results in this section were shown in terms of arbitrary integer sequences. For the next lemma, we require the sequences considered to be typical sequences. In Subsection 3.5 we will generalize the results that rely on the following lemmas to arbitrary integer sequences.
We are now ready to prove the Chop Lemmas. They come in two versions, one that is suited for the case of the bottom left submatrix after an application of the Split Lemma to M , and one for the top right submatrix. In the former case, we have that the last row is a minimum row and that the last column is a minimum column. We will prove this lemma in more detail and observe that the other case follows by symmetry with the arguments given in the following proof. For an illustration of the setting in the following lemma, see Figure 8b.  Informally speaking, this means that the last element of s is the minimum, the (l(s) − 1)-th element of s is the maximum, the (l(s) − 2)-th element is 'second-smallest' element, and so on. We will therefore refer to the element at position l(s) − 2k (2k ≤ l(s)) as 'min k+1 (s)' (note that the minimum is achieved when k = 0, hence the '+1'), and elements at position l(s) − 2k + 1 (2k + 1 ≤ l(s) − 1) as 'max k (s)'. For an illustration of the shape of s see Figure 8a and for an illustration of the basic setting of this proof see Figure 8b. We prove (i) and remark that the argument for (ii) is symmetric.
First, we show that each path in M is dominated by at least one of p + 1 and p + 2 .   Proof. We may assume that q does not contain (m − 1, n − 1): if so, we could easily obtain a path q from q by some local replacements such that q dominates q, since M [m − 1, n − 1] is the maximum element of the matrix M . We may assume that q either contains (m − 1, n) or (m, n − 1). Assume that the former holds, and note that an argument for the latter case can be given analogously.
Since q contains (m − 1, n), and since q does not contain (m − 1, n − 1), we may assume that q contains (m − 2, n): if not, we can simply add (m − 2, n) before (m − 1, n) to obtain a path that dominates q (recall that n is the column indexed by the minimum of c). Now, let q| M 1 be the restriction of q to M 1 , we then have that q = q| M 1 • (m − 1, n), (m, n). Since p 1 dominates all paths in M 1 , it dominates q| M 1 and so p + 1 ≺ q.
The remainder of the proof is devoted to showing that p + 1 dominates p + 2 which yields the lemma by Claim 3.10.1 and transitivity. To achieve that, we will show in a series of claims that we may assume that p 2 contains (m − 2, n − 2). In particular, we show that if p 2 does not contain (m − 2, n − 2), then there is another path in M 2 that does contain (m − 2, n − 2) and dominates p 2 . Claim 3.10.2. We may assume that there is a unique j ∈ [n − 2] such that p 2 contains (m − 1, j).
Proof. Clearly, p 2 has to pass through the row m − 1 at some point. We show that we may assume that there is a unique such point. Suppose not and let j 1 , . . . , j t be such that p 2 contains all (m − 1, j i ), where i ∈ [t]. By the definition of a path in a matrix, we have that j i+1 = j i + 1 for all i ∈ [t − 1]. Let p 2 be the path obtained from p 2 by replacing, for each i ∈ [t − 1], the element (m − 1, j i ) with the element (m − 2, j i ). Since r(m − 2) ≤ r(m − 1) (recall that m − 1 ∈ argmax(r)), it is not difficult to see that p 2 dominates p 2 , and clearly, p 2 satisfies the condition of the claim.  − 1, j). If j = n − 2k + 1 for some k ∈ N with 2k + 1 ≤ n − 1, then there is a path p 2 that dominates p 2 and contains (m − 1, j + 1).   Proof. For an illustration see Figure 9a. First, by Claim 3.10.2, we may assume that j is unique. Moreover, since j = n − 2k + 1 and j + 1 = n − 2k + 2 = n − 2(k − 1), we have that c(j) = max k (c) and c(j + 1) = min k (c), respectively, and therefore c(j + 1) ≤ c(j). Hence, we may assume that the element after (m − 1, j) in p 2 is (m, j + 1): if p 2 contained (m, j) we could simply remove (m, j) from p 2 without changing the fact that Putting the two together, we have that max k−1 (c) − min k (c) ≤ max(r) − min 2 (r), and so: max k−1 (c) + min 2 (r) ≤ max(r) + min k (c), which concludes the proof of the claim.
We are now ready to conclude the proof.
As the previous lemma always assumes that m ≥ 3 and n ≥ 3, we observe the corresponding base case which occurs when either m ≤ 2 or n ≤ 2. This base case is justified by the observation that in the bottom case, the last row and column of M are minimum. By symmetry, we have the following consequence of Lemma 3.10.

The Split-and-Chop Algorithm
Equipped with the Split Lemma and the Chop Lemmas, we are now ready to give the algorithm that computes a dominating merge of two typical sequences. Consequently, we call this algorithm the 'Split-and-Chop Algorithm'.
Lemma 3.14. Let r and c be typical sequences of length m and n, respectively. Then, there is an algorithm that finds in O(m + n) time a dominating path in the merge matrix of r and c.
Proof. The algorithm practically derives itself from the Split Lemma (Lemma 3.7) and the Chop Lemmas (Lemma 3.10 and Corollary 3.12). However, to make the algorithm run in the claimed time bound, we are not able to construct the merge matrix of r and c. This turns out to be not necessary, as we can simply read off the crucial values upon which the recursion of the algorithm depends from the sequences directly. The details are given in Algorithm 2.
The runtime of the Chop-subroutines can be computed as T (m + n) ≤ T (m + n − 2) + O(1), which resolves to O(m + n). Correctness follows from Lemmas 3.7 and 3.10 and Corollary 3.12 with the base cases given in Observations 3.11 and 3.13.

Generalization to Arbitrary Integer Sequences
In this section we show how to generalize Lemma 3.14 to arbitrary integer sequences. In particular, we will show how to construct from a merge of two typical sequences τ (r) and τ (s) that dominates all of their merges, a merge of r and s that dominates all merges of r and s. The claimed result then follows from an application of Lemma 3.14. We illustrate the following construction in Figure 10.
The Typical Lift. Let r and s be integer sequences and let t ∈ τ (r) ⊕ τ (s). Then, the typical lift of t, denoted by ρ(t), is an integer sequence ρ(t) ∈ r ⊕ s, obtained from t as follows. For convenience, we will consider ρ(t) as a path in the merge matrix M of r and s.
Step 1. We construct t ∈ τ (r) τ (s) such that t ≺ t using Lemma 3.5. Throughout the following, consider t to be a path in the merge matrix M τ of τ (r) and τ (s).
Step 2. First, we initialize ρ 1 t . . = t (1) = (1, 1). For i = {2, . . . , l(t )}, we proceed inductively as follows. Let (i r , i s ) = t(i) and let (i r , i s ) = t(i − 1). (Note that t(i − 1) and t(i) are indices in M τ .) Let furthermore (j r , j s ) be the index in M corresponding to (i r , i s ), and let (j r , j s ) be the index in M corresponding to (i r , i s ). Assume by induction that ρ i−1 t ∈ P(M [1..j r , 1..j s ]). We show how to extend ρ i−1 t to a path in ρ i t in M [1..j r , 1..j s ]. Since t is non-diagonal, we have that (i r , i s ) ∈ {(i r − 1, i s ), (i r , i s − 1)}, so one of the two following cases applies. • (j r , j s + 1), . . . , (j r , j s ).
Step 3. We return ρ(t) . . = ρ Furthermore, it is readily seen that the typical lift contains no diagonal steps: we obtain it from a non-diagonal path in the merge matrix of τ (r) and τ (s) by inserting vertical and horizontal paths from the merge matrix of r and s between consecutive elements. Moreover, it is computable in linear time, with Step 1 taking linear time by Lemma 3.5. We summarize in the following observation.
Observation 3.15. Let r and s be integer sequences of length m and n, respectively, and let t ∈ τ (r) ⊕ τ (s). Then, ρ(t) ∈ r s, and ρ(t) can be computed in time O(m + n).
We now show that if t ∈ τ (r) ⊕ τ (s) dominates all merges of τ (r) and τ (s), then the typical lift of t dominates all merges of r and s. Lemma 3.16. Let r and s be integer sequences and let q ∈ r ⊕ s. Let t ∈ τ (r) ⊕ τ (s) such that t ≺ τ (r) ⊕ τ (s). Then, ρ(t) ≺ q.
Proof. Let t ∈ τ (r) τ (s) be the non-diagonal merge such that t ≺ t used in the construction of ρ(t). We argue that ρ(t) ≺ t . To see this, let M be the merge matrix of r and s and consider any (j r , j s ) and (j r , j s ) as in Step 2, and suppose that j s = j s . (Note that either j s = j s or j r = j r .) As the only elements of the typical sequence of r in [j r ..j r ] are r(j r ) and r(j r ), we know that either for all h r ∈ [j r ..j r ], r(j r ) ≤ r(h r ) ≤ r(j r ), or for all h r ∈ [j r ..j r ], r(j r ) ≥ r(h r ) ≥ r(j r ). Therefore, in an extension of t , we can repeat the index that yields max{M [j r , j s ], M [j r , j s ]} sufficiently many (i.e. j r − j r ) times to ensure that the value of the extension of t is an upper bound for all values of ρ(t) in these positions.
To finish the proof, we have by Lemma 2.10(iii) that there exists a q ∈ τ (r) ⊕ τ (s) such that q ≺ q. Since t ≺ τ (r) ⊕ τ (s), we can conclude: We wrap up and prove the Merge Dominator Lemma (Lemma 3.1), stated here in the slightly stronger form that the dominating merge is non-diagonal (which is necessary for the applications in Section 4). Proof. The algorithm proceeds in the following steps.
Step 3. Return the typical lift ρ(t) of t.
Correctness of the above algorithm follows from Corollary 3.4 and Lemmas 3.14 and 3.16 which together guarantee that ρ(t) ≺ r ⊕ c, and by Observation 3.15, ρ(t) is a non-diagonal merge, i.e. ρ(t) ∈ r c. By Lemma 2.9, Step 1 can be done in time O(m + n), by Lemma 3.14, Step 2 takes time O(m + n) as well, and by Observation 3.15, the typical lift of t can also be computed in time O(m + n). Hence, the overall runtime of the algorithm is O(m + n).

Directed Width Measures of Series Parallel Digraphs
In this section, we give algorithmic consequences of the Merge Dominator Lemma. In Subsection 4.1, we provide an algorithm that computes the (weighted) cutwidth of (arc-weighted) series parallel digraphs on n vertices in time O(n 2 ). In Subsection 4.2 we provide a linear-time transformation that allows for computing the modified cutwidth of an SPD on n vertices in O(n 2 ) time, using the algorithm that computes the weighted cutwidth of an arc-weighted SPD.

Cutwidth
Recall that given a topological order v 1 , . . . , v n of a directed acyclic graph G, its cutwidth is the maximum over all i ∈ [n − 1] of the number of arcs that have their tail vertex in {v 1 , . . . , v i } and their head vertex in {v i+1 , . . . , v n }, and that the cutwidth of G is the minimum cutwidth over all its topological orders. We will now deal with the following computational problem.

Input:
A series parallel digraph G.

Question:
What is the cutwidth of G?

Cutwidth of Series Parallel Digraphs
Given a series parallel digraph G, we follow a bottom-up dynamic programming scheme along the decomposition tree T that yields G. Each node t ∈ V (T ) has a subgraph G t of G associated with it, that is also series parallel. Naturally, we use the property that G t is obtained either via series or parallel composition of the SPD's associated with its two children.
To make this problem amenable to be solved using merges of integer sequences, we define the following notion of a cut-size sequence of a topological order of a directed acyclic graph which records for each position in the order, how many arcs cross it.
Throughout the remainder of this section, we slightly abuse notation: If G 1 and G 2 are SPD's that are being composed with a series composition, and π 1 ∈ Π(G 1 ) and π 2 ∈ Π(G 2 ), then we consider π = π 1 • π 2 to be the concatenation of the two topological orders where t 2 = s 1 only appears once in π.
We first argue via two simple observations that when computing the cutwidth of a series parallel digraph G by following its decomposition tree in a bottom up manner, we only have to keep track of a set of topological orders that induce a set of cut-size sequences that dominate all cut-size sequences of G.
The following lemma states that the cut-size sequences of an SPD G can be computed by pairwise concatenation or non-diagonal merging (depending on whether G is obtained via series or parallel composition) of the two smaller SPD's that G is obtained from. Intuitively speaking, the reason why we can only consider non-diagonal merges is the following. When G is obtained from G 1 and G 2 via parallel composition, then each topological order of G can be considered the 'merge' of a topological order of G 1 and one of G 2 , where each position (apart from the first and the last) contains a vertex either from G 1 or from G 2 . Now, in a merge of a cut-size sequence of G 1 with a cut-size sequence of G 2 , a diagonal step would essentially mean that in some position, we insert both a vertex from G 1 and a vertex of G 2 ; this is of course not possible.
Lemma 4.4. Let G 1 and G 2 be SPD's. Then the following hold.
We now prove the crucial lemma of this section which states that we can compute a dominating cut-size sequence of an SPD G from dominating cut-size sequences of the smaller SPD's that G is obtained from. For technical reasons, we assume in the following lemma that G has no parallel arcs, which does not affect the algorithm presented in this section. Lemma 4.5. Let G be an SPD without parallel arcs. Then there is a topological order π * of G such that σ(π * ) dominates all cut-size sequences of G. Moreover, the following hold. Let G 1 and G 2 be SPD's and for r ∈ [2], let π * r be a topological order of G r such that σ(π * r ) dominates all cut-size sequences of G r .
Proof. We prove the lemma by induction on the number of vertices of G. If |V (G)| = 2, then the claim is trivially true (there is only one topological order). Suppose that |V (G)| = . . n > 2. Since n > 2 and G has no parallel arcs, we know that G can be obtained from two SPD's G 1 and G 2 via series or parallel composition with |V (G 1 )| = . . n 1 < n and |V (G 2 )| = . . n 2 < n. By the induction hypothesis, for r ∈ [2], there is a unique topological order π * r such that σ(π * r ) dominates all cut-size sequences of G r .
Theorem 4.6. Let G be an SPD on n vertices. There is an algorithm that computes in time O(n 2 ) the cutwidth of G, and outputs a topological ordering that achieves the upper bound.
Proof. We may assume that G has no parallel arcs; if so, we simply subdivide all but one of the parallel arcs. This neither changes the cutwidth, nor the fact that G is series parallel. We can therefore apply Lemma 4.5 on G in the correctness proof later. We use the algorithm of Valdes et al. [20] to compute in time O(n + |A(G)|) a decomposition tree T that yields G, see Theorem 2.13. We process T in a bottom-up fashion, and at each node t ∈ V (T ), compute a topological order π t of G t , the series parallel digraph associated with node t, such that σ(π t ) dominates all cut-size sequences of G t . Let t ∈ V (T ).
Case 1 (t is a leaf node). In this case, G t is a single arc and there is precisely one topological order of G t ; we return that order.
Case 2 (t is a series node with left child and right child r). In this case, we look up π , a topological order such that σ(π ) dominates all cut-size sequences of G , and π r , a topological order such that σ(π r ) dominates all cut-size sequences of G r . Following Lemma 4.5(i), we return π • π r .
Case 3 (t is a parallel node with left child and right child r). In this case, we look up π and π r as in Case 2, and we compute π t such that σ(π t ) dominates σ(π ) σ(π r ) using the Merge Dominator Lemma (Lemma 3.17). Following Lemma 4.5(ii), we return π t .
Finally, we return π r , the topological order of G r = G, where r is the root of T . Observations 4.2 and 4.3 ensure that it is sufficient to compute in each of the above cases a set Π * t ⊆ Π(G t ) with the following property. For each π t ∈ Π(G t ), there is a π * t ∈ Π * t such that σ(π * t ) ≺ σ(π t ). By Lemma 4.5, we know that we can always find such a set of size one which is precisely what we compute in each of the above cases. Correctness of the algorithm follows. Since T has O(n) nodes and each of the above cases can be handled in at most O(n) time by Lemma 3.17, we have that the total runtime of the algorithm is O(n 2 ).
Our algorithm in fact works for the more general problem of computing the weighted cutwidth of a series parallel digraph which we now define formally.
The corresponding computational problem is defined as follows.

Input:
A series parallel digraph G and an arc-weight function ω : A(G) → N.

Question:
What is the weighted cutwidth of (G, ω)?

Weighted Cutwidth of Series Parallel Digraphs
Corollary 4.8. Let G be an SPD on n vertices and ω : A(G) → N an arc-weight function. There is an algorithm that computes in time O(n 2 ) the weighted cutwidth of (G, ω), and outputs a topological ordering that achieves the upper bound.

Modified Cutwidth
We now show how to use the algorithm for computing the weighted cutwidth of series parallel digraphs from Corollary 4.8 to give an algorithm that computes the modified cutwidth of a series parallel digraph on n vertices in time O(n 2 ). Recall that given a topological order v 1 , . . . , v n of a directed acyclic graph G, its modified cutwidth is the maximum over all i ∈ [n − 1] of the number of arcs that have their tail vertex in {v 1 , . . . , v i−1 } and their head vertex in {v i+1 , . . . , v n }, and that the modified cutwidth of G is the minimum modified cutwidth over all its topological orders. We are dealing with the following computational problem.

Input:
A series parallel digraph G.

Question:
What is the modified cutwidth of G?

Modified Cutwidth of Series Parallel Digraphs
To solve this problem, we will provide a transformation which allows for applying the algorithm for the Weighted Cutwidth of SPD's problem to compute the modified cutwidth. We would like to remark that this transformation is similar to one provided in [6], however some modifications are necessary to ensure that the digraph resulting from the transformation is an SPD.  Proof. We give a transformation that enables us to solve Modified Cutwidth of SPD's with help of an algorithm that solves Weighted Cutwidth of SPD's. Let (G, (s, t)) be an SPD on n vertices and m arcs. Again, we assume that G has no parallel arcs; if so, we simply subdivide all but one of the parallel arcs. This does not change the (modified) cutwidth, and keeps a digraph series parallel. We construct another digraph G and an arc-weight function ω : A(G ) → N as follows. For each vertex v ∈ V (G) \ {s, t}, we add to G two vertices v in and v out . We add s and t to G and write s as s out and t as t in . We add the following arcs to G . First, for each v ∈ V (G), we add an arc (v in , v out ) and we let ω((v in , v out )) . . = m + 1. Next, for each arc (v, w) ∈ A(G), we add an arc (v out , w in ) to G and we let ω((v out , w in )) . . = 1. For an illustration see Figure 11.
We observe that the size of G is linear in the size of G, and then prove that if G is obtained from applying the above transformation to a series parallel digraph, then G is itself an SPD.  Proof. We prove the claim by induction on n, the number of vertices of G. For the base case when n = 2, we have that G is a single arc in which case G is a single arc as well. Now suppose n > 2. Since n > 2, G is obtained from two series parallel digraphs G 1 and G 2 via series or parallel composition. Since G has no parallel arcs, we can use the induction hypothesis to conclude that the graphs G 1 and G 2 obtained via our construction are series parallel. Now, if G = G 1 ⊥ G 2 , then it is immediate that G is series parallel. If G = G 1 G 2 , then we have that in G , the vertex that was constructed since t 1 and s 2 were identified, call this vertex x, got split into two vertices x in and x out with a directed arc of weight m + 1 pointing from x in to x out . Call the series parallel digraph consisting only of this arc (X, (x in , x out )). We now have that G = G 1 X G 2 , so G is series parallel in this case as well.
We are now ready to prove the correctness of this transformation. To do so, we will assume that we are given an integer k and we want to decide whether the modified cutwidth of G is at most k. Claim 4.9.3. If G has modified cutwidth at most k, then G has weighted cutwidth at most m+k +1.
Proof. Take a topological ordering π of G such that mcutw(π) ≤ k. We obtain π from π by replacing each vertex v ∈ V (G) \ {s, t} by v in followed directly by v out . Clearly, this is a topological order of G . We show that the weighted cutwidth of this ordering is at most m + k + 1.
Let i ∈ [n − 1] and consider the cut between position i and i + 1 in π . We have to consider two cases. In the first case, there is some v ∈ V (G) such that π −1 (i) = v in and π −1 (i + 1) = v out . inception, algorithms based on typical sequences give the best asymptotic bounds for linear time FPT algorithms for treewidth and pathwidth, as functions of the target parameter. It still remains a challenge to improve upon these bounds (2 O(pw 2 ) , respectively 2 O(tw 3 ) ), or give non-trivial lower bounds for parameterized pathwidth or treewidth. Possibly, the Merge Dominator Lemma can be helpful to get some progress here.
As other open problems, we ask whether there are other width parameters for which the Merge Dominator Lemma implies polynomial time or XP algorithms, or whether such algorithms exist for other classes of graphs. For instance, for which width measures can we give XP algorithms when parameterized by the treewidth of the input graph?