Skip to main content

LIS and network flow

· 17 min read
Xinyu Ma
Research Scientist @ Meta

This post discusses Longest Increasing Subsequence (LIS) and network flow problem.

Two Chains Problem

link Give a NN-permutation σ=(a1,,an)\sigma = (a_1, \ldots, a_n) and a poset PσP_{\sigma} associated with it. That is, Pσ=(σ,)P_{\sigma} = (\sigma, \prec) such that (a,b)(x,y)(a,b)\prec(x,y) if a<xa < x and b<yb < y. Find two nonintersecting chains C1,C2C_1, C_2 such that C1C2|C_1\sqcup C_2| is maximized. Output C1C2|C_1\sqcup C_2|.

Note that finding a maximal chain first and picking up another longest one does not work. For example, the array is (236145)(2 3 6 1 4 5). Then, the longest chain is (2345)(2 3 4 5), but the answer is (236)(145)(2 3 6) \sqcup (1 4 5).

Sol 1 - DP

Let AxymA^m_{xy} denote the maximum size of two chain covering in (a1,,am)(a_1, \ldots, a_m) such that the two chains end with xx and yy respectively. Here, to make math concepts reflect the program code, I use superscripts to represent the iteration of algorithm (i.e. loop variables) and subscripts for indices of arrays.

At the mm-th step, we try to pick ama_m to one of the chain, and let another chain remain xx. Thus, the best length is gxm=1+maxy=1aiAxym1g^m_{x} = 1 + \max_{y=1}^{a_i}{A^{m-1}_{xy}}. Then we can update AA as:

Aai,ym=max(Aai,ym1,gym)Ax,aim=max(Ax,aim1,gxm)A^m_{a_i,y} = \max(A^{m-1}_{a_i,y}, g^m_y) \\ A^m_{x,a_i} = \max(A^{m-1}_{x,a_i}, g^m_x)

Other cells do not change.

Note that we can use a segment tree to handle the second dimension of AA. Thus, the overall complexity is O(N2log(N))O(N^2\log(N)).

Sol 2 - Cost Flow

This problem can be reduced to a min-cost circulation problem as follows. Let node ss and tt denote the "source" and "destination". We need two chains, so add a flow tst\to s with (min=2,max=2,cost=0)(min=2,max=2, cost=0) For each element aia_i, we build two nodes pip_i and qiq_i for it. Add edges spi:(0,1,0)s\to p_i : (0,1,0), piqi:(0,1,1)p_i\to q_i: (0, 1, -1), qit:(0,1,0)q_i\to t: (0, 1, 0). Now we need to add edges among elements to represent the chain relationship.

The simplest solution is to add qipj:(0,1,0)q_i\to p_j: (0, 1, 0) for all i<jai<aji < j\wedge a_i < a_j. However, this adds up to N2N^2 edges into the graph. Since \prec is a partial order, we can use the transtivity to optimize the graph. That is, we only link aia_i to the antichain covering aia_i:

Ai={j:aiajk¬(aiakaj)}A_i = \{ j: a_i\prec a_j \wedge \forall k \neg(a_i\prec a_k\prec a_j) \}

Add qipj:(0,1,0)q_i\to p_j: (0, 1, 0) for all jAij\in A_i. To let a flow bypass a node, we can add one of the follows:

  • piqi:(0,,0)p_i\to q_i: (0, \infty, 0) for all ii;
  • pipj:(0,1,0)p_i\to p_j: (0, 1, 0) for all jAij\in A_i.

In the worst case we can still have N2N^2. For example, N=2NN = 2N' and σ=(N,N1,,1,2N,2N2,,N+1)\sigma = (N', N'-1, \ldots, 1, 2N', 2N'-2, \ldots, N'+1). But this is more efficient in most cases, especially when chains are long, since any two elements that are connected must be neighbours in a saturated chain.

Two-Chain Covering Problem

Give PσP_{\sigma} and a saturated chain CC. Find two disjoint chains C1,C2C_1, C_2 such that CC1C2C \subseteq C_1\sqcup C_2 and the total length is maximized. Output a feasible pair of chains C1,C2C_1, C_2. Of course cost flow works. But the condition that CC is saturated gives us more chances.

This problem is proposed by me. I'm not sure whether there are more solutions if only the length is required. I think my DP is the best algorithm if we need the chains.

Sol 1 - DP

A naive thinking is letting C1=CC_1=C and C2C_2 be another LIS. This is wrong of course, but we can improve it. (PS: a longer counter example is (241369578)(241369578) and C=(23678)C=(23678), where CC needs to be broken into 3\geq 3 fragments.) Note that CC can be segmented into subsequences, where each segment is either in C1C_1 or C2C_2. Suppose C=(c1,,cm)C=(c_1, \ldots, c_m) and C1=X=(x1,,xu)C_1 = X = (x_1, \ldots, x_u), C2=Y=(y1,,yv)C_2 = Y = (y_1, \ldots, y_v). For example, assume (cl,,cr)(c_l, \ldots, c_r) is in XX. Then, cl1c_{l-1} and cr+1c_{r+1} are in YY: yl1=cl1y_{l'-1} = c_{l-1}, yr+1=cr1y_{r'+1} = c_{r-1}. Thus, if we replace (cl,,cr)(c_l, \ldots, c_r) with (yl,,yr)(y_{l'}, \ldots, y_{r'}) in CC, CC will be still a chain. Based on this observation, consider interval-based dynamic programming (区間DP).

Let did_i denote the maximal length when we only consider (c1,,ci)(c_1, \ldots, c_i) and (a1,,as(i))(a_1, \ldots, a_{s(i)}) where as(i)a_{s(i)} is cic_i. Let flrf_{lr} denote the how many element in σC\sigma\setminus C we can choose to make a chain between ala_l and ara_r. Clearly, dx=maxy=1x1(dy+fs(y1),s(x))d_x = \max_{y=1}^{x-1}{(d_y + f_{s(y-1),s(x)})}. Let wi=0w_i = 0 for all ii s.t. aia_i in CC and wi=1w_i = 1 for all aia_i not in CC. We know that fi,i=wif_{i,i} = w_i and fl,r=wl+max{fi,r:l+1iral<ai<ar}f_{l,r} = w_l + \max\{ f_{i,r} : l+1 \leq i\leq r\wedge a_l < a_i < a_r \}. Here the calculation of fl,rf_{l,r} is costly, so we want to optimize it. Similar to the optimization used in cost flow, let AlA_l be the antichain covering ala_l:

Al={j:alajk¬(alakaj)}A_l = \{ j: a_l\prec a_j \wedge \forall k \neg(a_l\prec a_k\prec a_j) \}

And we only need to consider those ii from AlA_l:

fl,r=wl+max{fi,r:iAli<rai<ar}f_{l,r} = w_l + \max\{ f_{i,r} : i\in A_l \wedge i < r \wedge a_i < a_r \}

If this algorithm can calculate fl,rf_{l,r} in O(N2)O(N^2), the overall complexity will become O(N2)O(N^2). Well, it is false in some rare cases, but true most of the time.

PσP_\sigma is a graded poset. All AlA_l are actually part of an antichain decomposition. Therefore, the time complexity is bound by O(N3/h)O(N^3 / h) and the worst case is

σ=(x,x1,,1,2x,2x1,,x+1,3x,3x1,,2x+1)\sigma = (x, x-1, \ldots, 1, 2x, 2x-1, \ldots, x+1, 3x, 3x-1, \ldots, 2x+1)

where h=3h=3 and our algorithm is O(N3)O(N^3). However, the shorter hh is, the easier we can find another long chain.

Min-Cost Flow/Circulation Problem

Given a digraph D=(V,E)D=(V,E) with capacity function c:ERc: E\to\mathbb{R}, cost function k:ERk: E\to\mathbb{R}, supply-demand function d:VRd: V\to\mathbb{R} A feasible flow is a function f:ERf: E\to\mathbb{R} s.t. (capacity constraints) 0f(e)c(e)0 \leq f(e)\leq c(e) for all eEe\in E and (flow conservation) uvEf(uv)vuEf(vu)=d(u)\sum_{uv\in E}{f(uv)} - \sum_{vu\in E}{f(vu)} = d(u) for all uVu\in V. In most of the cases, d(s)=dd(s)=d, d(t)=dd(t) = -d, d(u)=0d(u) = 0 for all uV{s,t}u\in V\setminus\{ s,t \}. In the circulation problem, d(u)=0d(u)=0 for all uVu\in V.

Negative Circuit Condition

Given a feasible flow ff, define its residue network to be Df=(V,Ef=EE1)D_f=(V,E_f = E\sqcup E^{-1}), where E1={e1=(v,u):e=(u,v)E}E^{-1} = \{ e^{-1}=(v,u) : e=(u,v)\in E \}, with cf(e)=c(e)f(e)c_f(e) = c(e) - f(e), cf(e1)=f(e)c_f(e^{-1}) = f(e), kf(e)=k(e)k_f(e) = k(e), kf(e1)=k(e)k_f(e^{-1}) = -k(e). Then, ff is a min-cost flow if and only if there is no negative circuit with non-zero capacity in DfD_f.

Proof: \Rightarrow is clear, as we can always augment on a negative circuit to get a better flow.

To prove \Leftarrow, suppose all circuits CDfC\in D_f has a non-negative cost cf(C)0c_f(C) \geq 0. Let ff' be an arbitrary feasible circulation. Then, by flow conservation, fff'-f is the sum of several circuits in DfD_f: ff=λiCif'-f = \sum {\lambda_i C_i}. Thus, cost(ff)=cost(f)cost(f)=λicf(Ci)0cost(f'-f) = cost(f') - cost(f) = \sum {\lambda_i c_f(C_i)} \geq 0.

Complementary Slackness Condition

The linear programming equiation is: (here uvu\to v denotes (u,v)E(u,v)\in E)

minuvk(uv)f(uv)s.t.uvf(uv)vuf(vu)=d(u)uVf(uv)c(uv)uvf(uv)0uv\begin{darray}{rrcll} \min \quad & \sum_{u\to v}{k(uv)f(uv)} & & & \\ \text{s.t.} \quad & \sum_{u\to v}f(uv) - \sum_{v\to u}f(vu) & = & d(u) & \forall u\in V \\ & -f(uv) &\geq& - c(uv) & \forall u\to v \\ & f(uv) &\geq & 0 & \forall u\to v \end{darray}

The first constraint can be written as Bf=d\mathbf{B}\mathbf{f}=\mathbf{d}, where B\mathbf{B} is the incidence matrix. Recall that a digraph's incidence matrix is always totally unimodular, so the linear programming automatically gives an integer solution if cc, dd and kk are all integers.

Its dual programming is:

maxud(u)π(u)uvc(uv)z(uv)s.t.π(u)π(v)z(uv)k(uv)uvz(uv)0uv\begin{darray}{rrcll} \max \quad & \sum_{u}{d(u)\pi(u)} - \sum_{u\to v}{c(uv)z(uv)} & & & \\ \text{s.t.} \quad & \pi(u) - \pi(v) - z(uv) &\leq& k(uv) & \forall u\to v \\ & z(uv) &\geq & 0 & \forall u\to v \end{darray}

Recall how we write dual programming equations:

  • Transpose the matrix, swap coefficients in the goal and right hand side in constraints.
  • For every \geq constraint in min\min (\leq constraint in max\max), let the dual varible be non-negative.
  • For every == constraint, let the dual variable be free.
  • For every non-negative variable, let the dual constraint be \leq in min\min (\geq in max\max).
  • For every free variable, let the dual constraint be ==.

Look at the dual programming, observe that:

  • the absolute values of π\pi (called potential) does not matter. Relative values make sense.
  • Since all c(uv)c(uv) are positive, we can always take z(uv)=max(π(u)π(v)k(uv),0)z(uv) = \max(\pi(u)-\pi(v)-k(uv), 0) to get a optimized solution.

By the complementary slackness theorem, if ff and π,z\pi, z are feasible solutions to two programmings respectively, then they are optimal if and only if

f(uv)[π(u)π(v)z(uv)k(uv)]=0z(uv)[f(uv)c(uv)]=0\begin{darray}{rcl} f(uv)[\pi(u) - \pi(v) - z(uv) - k(uv)] &=& 0 \\ z(uv)[f(uv) - c(uv)] &=& 0 \end{darray}

Substitute for z(uv)z(uv) and get the the following condition: ff is a min-cost flow if and only if there exists a potential function π\pi s.t.

  • π(u)π(v)k(uv)\pi(u) - \pi(v) \leq k(uv) for all f(uv)<c(uv)f(uv) < c(uv)
  • π(u)π(v)k(uv)\pi(u) - \pi(v) \geq k(uv) for all f(uv)>0f(uv) > 0
  • Note:
    • Some book uses p(uv)=π(uv)p(uv) = -\pi(uv) so \leq and \geq are interchanged.
    • When 0<f(uv)<c(uv)0 < f(uv) < c(uv), we have π(v)=π(u)k(uv)\pi(v) = \pi(u) - k(uv).
    • We can take π(s)=0\pi(s) = 0 if we want to calculate π\pi.

Let k(vu)=k(uv)k(vu) = - k(uv) for all uvu\to v. Take a cycle CC with non-zero capacity from the residue network DfD_f, sum the inequality up, and get:

uvCk(uv)0\sum_{uv \in C}{k(uv)} \geq 0

which is exactly the negative circuit condition.

Feasible Tree Theorem

In simplex algorithm of linear programming, one jumps among vertices to get an optimal solution. Then, a natural problem is what a vertex means in a digraph. Consider the edges with 0<f(uv)<c(uv)0 < f(uv) < c(uv) in the residue graph. If there is a cycle CC, it must have zero cost. Thus, we can flow in either direction until the cycle breaks. This cycle is corresponding to a hyperplane perpendicular to the target, and the two directions give two optimal vertices. Suppose DD is weakly connected. Then, we only need to consider case that all non-tight arcs form a spanning tree.

Theorem

A set of columns of the incidence matrix B\mathbf{B} is a basis if and only if its arcs form a spanning tree.

Proof: Since B\mathbf{B} is weakly connected, rank(B)=n1\mathrm{rank}(\mathbf{B}) = n-1. Let B1B_1 denote a set of n1n-1 columns. If B1B_1 is a basis, then rank(B1)=n1\mathrm{rank}(B_1) = n-1, which means there is no cycle in its arcs. Thus, it must be connected and a spanning tree. If B1B_1 is a spanning tree, then clearly rank(B1)=n1\mathrm{rank}(B_1) = n-1. Thus, B1B_1 is a basis.

Pivoting in the (residue) network is:

  • Select a non-tree edge e=(u,v)e=(u,v) such that the entering number kπ(uv)=k(uv)π(u)+π(v)<0k^{\pi}(uv) = k(uv) - \pi(u) + \pi(v) < 0.
    • π\pi is calculated along the tree by setting the root π(s)=0\pi(s) = 0.
  • Augment through the cycle it makes until some edge is tight (f=0f = 0 or f=cf = c)
    • The augment amount is the minimum capacity of all edges on the cycle, which can be zero.
  • Remove the tight edge and move the new edge in.

Similar to Bland Rule, one can prove that this algorithm does not fall into an infinite loop with some rules obeyed.

Lemma

Fix a root node ss in a feasible tree. Call a feasible tree strong, if all degenerated edges with f(uv)=0f(uv) = 0 is pointing away from the root (and similarly edges that f(uv)=c(uv)f(uv)=c(uv) is pointing towards the root). A strong tree will only pivot into another strong tree. And if one always remove the first edge going from ss in pivoting, all strong trees will be different.

Greene-Kleitman Theorem

Theorem

Let D=(V,E)D=(V,E) be an DAG, BEB\subseteq E and kZ+k\in\mathbb{Z}_+. Then, for any collection of at most kk directed cuts C\mathcal{C}, and any collection of any number of paths P\mathcal{P},

maxCBΓ=minP[BΠ+kP]\max_{\mathcal{C}}|B\cap\Gamma| = \min_{\mathcal{P}}[|B \setminus \Pi| + k|\mathcal{P}|]

where Γ=C\Gamma = \bigcup\mathcal{C} and Π=P\Pi = \bigcup\mathcal{P}.

note
  • Here, a directed cut is all edges going out of a set SS into T=VST=V\setminus S, δout(S)=δin(T)\delta^{out}(S)=\delta^{in}(T), where TT \neq \varnothing and δout(T)=\delta^{out}(T) = \varnothing.
  • Some books define S-T cut as δout(S)\delta^{out}(S), sSs\in S and tTt\in T, without requiring δout(T)=\delta^{out}(T) = \varnothing. The minimum S-T cut under this definition equals to the minimal directed cut.

Proof: To see maxmin\max \leq \min:

BΓBΠ+ΠΓBΠ+kP|B\cap\Gamma| \leq |B\setminus\Pi| + |\Pi\cap\Gamma| \leq |B\setminus\Pi| + k|\mathcal{P}|

because one path can intersect with each cut at most once.

note

The intersection property does not apply to S-T cut. For example, V={s,a,b,t}V = \{ s,a,b,t \}, E={sa,sb,ab,at,bt}E=\{ sa,sb,ab,at,bt \}, S={s,b}S = \{ s,b \} and T={a,t}T = \{ a, t \}. Then, the S-T cut contains 2 edges {sa,bt}\{ sa, bt \}, and path sabts\to a\to b\to t passes both.

To prove equality, suppose DD has a single source ss and a single sink tt, and construct P,C\mathcal{P}, \mathcal{C} that make both sides equal.

Make a network D=(V,EB{(t,s)})D' = (V, E\cup B'\cup \{ (t,s) \}), where B={b=(u,v):b=(u,v)B}B' = \{ b'=(u,v) : b=(u,v)\in B \} is a copy of BB. Assign

  • c(uv)=,k(uv)=0c(uv) = \infty, k(uv) = 0 for uvEuv\in E
  • c(uv)=1,k(uv)=1c(uv) = 1, k(uv) = -1 for uvBuv\in B'
  • c(ts)=,k(ts)=kc(ts) = \infty, k(ts) = k

Let ff be a min-cost circulation and pp be the negative of potential function πf\pi_f such that p(t)=0p(t) = 0. More specifically,

  • p(v)p(u)p(v)\leq p(u) for a=uvAa=uv\in A, with equality if f(a=uv)>0f(a=uv)>0.
    • This ensures p(u)0p(u) \geq 0 for all uu.
  • For a=uvBa'=uv\in B'
    • p(v)p(u)1p(v)\leq p(u) - 1 if f(a=uv)=0f(a'=uv) = 0
    • p(v)p(u)1p(v)\geq p(u) - 1 if f(a=uv)=1f(a'=uv) = 1
  • p(s)p(t)+kp(s) \leq p(t) + k, with equality if the flow is not empty f(ts)>0f(ts) > 0

Take ff as the collection of paths P\mathcal{P}. The negative part of cost of ff (contributed by BB') is exactly BΠ|B\cap \Pi|, and the positive part is kPk|\mathcal{P}|. Thus, the right hand side of the equation is B+cost(f)|B| + \mathrm{cost}(f).

Note: Not clearly written in the book, but here we use the condition that DD is acyclic. Otherwise, ff may contain a cycle that does not pass ss and tt.

Take kk cuts as follows. For i=1,,vi= 1,\ldots, v, let Ui={vV:p(v)i}U_i = \{v\in V : p(v) \geq i\}. Take δout(Ui)\delta^{out}(U_i) as (at most) kk cuts. Since p(u)p(v)p(u)\geq p(v), for all uvEuv\in E, δin(Ui)=\delta^{in}(U_i) = \varnothing.

For all uvBuv\in B', if f(uv)=0f(uv) = 0, then p(v)p(u)1p(v)\leq p(u) - 1, so the original arc uvδout(Uu)uv\in\delta^{out}(U_u). That is, an arc in BB which is not in a path must be included in one of the cut (BΠBΓB\setminus\Pi\subseteq B\cap\Gamma). Thus, BΠ=(BΓ)ΠB\setminus \Pi = (B\cap \Gamma)\setminus\Pi.

On the other hand, for an arc in a cut, it may or may not be included in a path. (p(v)p(u)p(u+1)p(v)\leq p(u) \leq p(u+1) for f(a=uv)=1f(a' = uv) = 1) If it is included(BΓΠ|B\cap\Gamma\cap\Pi|), then must be on only exactly one path (p(u)=p(v)p(u)=p(v) for f(a=uv)>0f(a=uv) > 0). Actually,

BΠΓ=a=uvB(p(u)p(v))f(a)=a=uvE(p(u)p(v))f(a)+a=uvB(p(u)p(v))f(a)=(p(t)p(s))f(ts)=kP\begin{darray}{rcl} |B\cap\Pi\cap\Gamma| &=& \sum_{a=uv\in B}{(p(u)-p(v))f(a')} \\ &=& \sum_{a=uv\in E}{(p(u)-p(v))f(a)} + \sum_{a=uv\in B}{(p(u)-p(v))f(a')} \\ &=& - (p(t) - p(s))f(ts) \\ &=& k|\mathcal{P}| \end{darray}

The last step comes from flow conservation and that a potential function sums up to 00 on a circuit.

Thus,

BΓ=BΓΠ+BΓΠ=BΠ+kP|B\cap\Gamma| = |B\cap\Gamma\cap\Pi| + |B\cap\Gamma\setminus\Pi| = |B\setminus\Pi| + k|\mathcal{P}|
Theorem (the dual)

For any collection of at most kk paths P\mathcal{P}, and any collection of any number of directed cuts C\mathcal{C},

maxPBΠ=minC[BΓ+kC]\max_{\mathcal{P}}|B\cap\Pi| = \min_{\mathcal{C}}[|B \setminus \Gamma| + k|\mathcal{C}|]

where Γ=C\Gamma = \bigcup\mathcal{C} and Π=P\Pi = \bigcup\mathcal{P}.

Proof: Use the network DD' we build before, but change the tsts arc to c(ts)=kc(ts)=k, k(ts)=0k(ts)=0. Note that this is exactly what we do in the "Two Chains Problem". The rest of the proof is similar.

Theorem

In a poset P=(X,)P=(X,\prec), the maximum size of the union of kk antichains is equal to:

minCCCmin(k,C)\min_{\mathcal{C}}\sum_{C\in\mathcal{C}}{\min(k, |C|)}

where C\mathcal{C} ranges over disjoint chain partitions.

Proof: Build the network D=(V,E)D=(V,E) as follows:

  • V=XXV = X\sqcup X', where XX' is a copy of XX. Let pip_i and qiq_i denote the the xix_i in XX and XX', respectively.
  • E={(pi,qi):xiX}{(qi,pj):xixj}E = \{(p_i,q_i): \forall x_i\in X\}\sqcup\{ (q_i, p_j): \forall x_i\prec x_j \}
    • Recall what we do in the "Two Chains Problem".
  • Let B={(pi,qi):xiX}B = \{(p_i,q_i): \forall x_i\in X\}. Apply the theorem above. For each arc (pi,qi)Π(p_i,q_i)\notin\Pi, we take a singleton {xi}\{x_i\}.
Theorem (the dual)

The maximum size of the union of kk chains is equal to:

minAAAmin(k,A)\min_{\mathcal{A}}\sum_{A\in\mathcal{A}}{\min(k, |A|)}

where A\mathcal{A} ranges over disjoint antichain partitions.

Theorem

The difference of numbers of the union of kk chains & the union of kk antichains are conjugate partitions of PP.

RSK correspondence

Robinson-Schensted Bijection

Recall how we calculate LIS:

  • Let Pk(i)P_k^{(i)} be the least possible end of an increasing sequence of length kk, out of first ii elements.
    • Initialize this sequence empty Pk(0)P_k^{(0)}.
  • When we move to ii, we try to replace the first element greater than aia_i from Pk(i1)P_k^{(i-1)}
    • Suppose Pj(i1)>aiP_j^{(i-1)} > a_i is the first such element, then Pj(i)=aiP_j^{(i)} = a_i and Pk(i)=Pk(i1)P_k^{(i)} = P_k^{(i-1)} for kjk\neq j.
    • If aia_i is larger than all Pk(i1)P_k^{(i-1)}, append it to the last.

At last, the length of Pk(n)P_k^{(n)} is the length of LIS. We call this operation "inserting ana_n into a row".

Now let us modify this algorithm a bit so no element are dropped:

  • Initialize two empty standard Young tableaux (P,Q)(P,Q).
  • For i=1i=1 to nn, insert aia_i into the first row of PP.
    • If some element gets out, insert it into the next row; repeat this until no element is bumped out.
    • At last, write ii in QQ at the position we finish the insertion in PP.

It is easy to prove that (P,Q)(P,Q) are standard Young tableaux. Also, note that each step is invertible: we drop the largest element from QQ, and pop the corresponding element in PP up. Thus, this algorithm gives a correspondence between a permutation and a pair of standard Yound tableaux of the same shape.

λn#SYT(λ)2=n!\sum_{\lambda\vdash n}\#SYT(\lambda)^2 = n!

With proof omitted we have the following theorems:

  • Row insertion and column insertion commute.
  • The PP of the reversed sequence is the transpose.
  • If aia_i enters PP at the jj-th column, then the longest increasing sequence ending at aia_i has length jj.

Knuth Correspondence

Knuth relation: Suppose we have ai1<ai>ai+1a_{i-1}< a_{i} >a_{i+1}. Swap aia_{i} with min(ai1,ai+1)\min(a_{i-1}, a_{i+1}), and we will get a_i1>ai<a_i+1a'\_{i-1} > a'_{i} < a'\_{i+1}. We can also do this reversely.

Two permutations are Knuth equivalent if one can be flipped to another with a sequence of Knuth relations.

Theorem: Two permutations are Knuth equivalent if and only if they share the PP tableaux.

k-LIS

Theorem: The longest total length of kk-increasing subsequences is the total size of first kk rows of PP.

  • Let APA_P be the permutation concatenate the rows of PP bottom up. Clearly, the theorem is true for APA_P.
  • It is proven that Kunth relations preserve kk-LIS.

References

  • Igor Pak, UCLA MATH206A, Fall 2020.
  • Alexander Schrijver, Combinatorial Optimization, Chapter 14, Springer, 2004.
  • Bruce Sagan, The Symmetric Group, Second Ed., Chapter 3, Springer, 2000.