betaFeedback

WorksMathematics

An Algebraic Matching Algorithm for the Genus of Grid Diagrams

Abstract

Grid diagrams encode knots and links combinatorially through an (n,n) winding matrix W(G). A fundamental invariant of the grid diagram is its genus g(G), which records essential topological information about the underlying knot. We give an algebraic algorithm that computes g(G) directly from W(G). The method repurposes the Hungarian algorithm ,after a column normalization that makes the matrix non-negative, it applies row-column reductions and minimum-vertex-cover corrections until the zero entries admit a perfect matching, equivalently until the minimum marking number equals n. By Konig's theorem the resulting permutation defines a distinguished grid state, and g(G) is then read from this matrix via the classical grid homology formula (Ozsvath-Stipsicz-Szabo). The novelty of this paper is the algorithm and its strongly polynomial analysis; the underlying invariant is known grid-homology theory. We illustrate the method on the trefoil and additional examples, and discuss extensions to (m,n) matrices and grid-move navigation toward the knot genus g(K).

Introduction

Grid diagrams provide a purely combinatorial encoding of knots and links: an n×nn \times n grid diagram GG records the positions of XX and OO markers, and the horizontal and vertical segments joining them form a knot diagram (Cromwell [2, 3]; Dynnikov [4]).

In 2009, C. Manolescu, P. Ozsváth, and S. Sarkar [9] found a purely combinatorial description of knot floer homology by grid diagram. In 2025, C. Manolescu, P. Ozsváth and D. Thurston [10] gave combinatorial descriptions of the Heegaard Floer homology groups for arbitrary three-manifolds via the grid diagram of link.

What we consider here is the genus of grid diagram. Each grid diagram carries a winding matrix W(G)W(G), an n×nn \times n integer matrix (first column and last row identically zero) that records the relative winding of the horizontal and vertical arcs. A central integer of GG is its associated genus g(G)g(G) (the genus of a Seifert surface constructed from GG). In the grid-homology framework of Ozsváth–Stipsicz–Szabó [11], g(G)g(G) is computed from a minimal non-negative matrix HH derived from W(G)W(G) by row and column operations. The associated genus of a grid diagram realises the Seifert genus of the underlying knot: for every knot KK there exists a grid diagram GG with g(G)=g(K)g(G) = g(K) (see e.g. Ozsváth–Stipsicz–Szabó [11]); computing it directly from W(G)W(G) is the central problem addressed in this paper.

The contribution of this paper is algorithmic. We show that the relevant matrix HH can be produced from W(G)W(G) by a repurposed Hungarian algorithm, and that the data required are computed in strongly polynomial O(n3)\mathcal{O}(n^3) time. We do not re-prove that g(G)g(G) is determined by HH; our result is the computation of HH and of g(G)g(G).

Theorem 1.1 (Main algorithmic result). Let GG be a grid diagram of index nn with winding matrix W(G)W(G). After the column normalization (2) and Algorithm 1, the output is a matrix HH with MNM⁡(H)=n\operatorname{MNM}(H) = n that is a minimal non-negative matrix in the sense of Ozsváth–Stipsicz–Szabó [11]. The genus g(G)g(G) is then obtained from HH by the closed formula of Proposition 3.4.9 in [11], whose well-definedness is guaranteed by Corollary 3.4.10 in [11]. The algorithm performs this computation in strongly polynomial O(n3)\mathcal{O}(n^3) time.

Termination of Algorithm 1 and the O(n3)\mathcal{O}(n^3) bound are established in § 3. That the output HH is a minimal non-negative matrix, and that g(G)g(G) is read from HH, which are known results in grid homology; we recall them and verify that our normalization (2) places us in their setting in § 4.

As an application of the algorithm, the effect of grid moves on the associated genus of grid diagram was considered in Section 5. It is known that given a grid diagram GG representing knot KK, after a sequence of grid moves, we will obtain a new grid diagram G′G' satisfying g(G′)=g(K)g(G') = g(K). Therefore, the study of the associated genus of grid diagram, and in particular the effect of grid moves on the associated genus, is important for the study of knot genus. In [8], Marc Lackenby proved that any diagram of the unknot with cc crossings may be reduced to the trivial diagram using at most (236c)11(236c)^{11} Reidemeister moves. Thus we have the following conjecture.

Conjecture 1.2. Given a grid diagram GG representing knot KK. How can we find a finite sequence of grid moves to obtain a grid diagram G′G' from GG, which satisfying g(G′)=g(K)g(G') = g(K)? Or is there an upper bound on the grid moves?

The algebraic procedure developed here is not new in the optimisation sense: it is the Hungarian algorithm repurposed, looking for any permutation of zeros rather than a minimum-cost one. What is new is the application to grid diagrams: the winding matrix of a grid diagram encodes its genus g(G)g(G), and Algorithm 1 computes g(G)g(G) algebraically, by producing the minimal non-negative matrix from which g(G)g(G) is read via the grid-homology formula of Ozsváth–Stipsicz–Szabó (Proposition 3.4.9; Corollary 3.4.10).

The method extends without difficulty to m×nm \times n matrices, with the termination condition MNM⁡(A)=min⁡{m,n}\operatorname{MNM}(A) = \min\{m,n\}. Directions for further work include adapting it to coloured grid graphs and to diagrams that encode knots, and relating the extracted genus more explicitly to the Seifert genus g(K)g(K) over all grid diagrams of a knot (see e.g. Cromwell [2] and Jin, Stoimenow & Lee [6]). The minimal grid number c(K)c(K) and the range of associated genera g(G)g(G) over grid diagrams of KK have been studied extensively, e.g. by Cromwell [2] and Jin, Stoimenow & Lee [6].

The paper is organised as follows. Section 2 develops the algebraic algorithm (minimum marking number, the iterative procedure, and why a maximum matching survives each correction). Section 3 establishes termination via a potential-function argument and a strongly polynomial O(n3)O(n^3) time bound. Section 4 applies the algorithm to grid diagrams, recalls the grid-homology formula that yields g(G)g(G), and illustrates it on the trefoil and further examples. Section 5 applied the algorithm to find the relation between associated genus of grid diagram and gird move. This is important for computing the genus of knot.

Algorithm

Let AA be an n×nn \times n matrix. Write Z(A)={(i,j):aij=0}Z(A) = \{(i,j) : a_{ij} = 0\} for its set of zero positions.

Definition 2.1. A pair (R,C)(R,C) with R,C⊆{1,…,n}R,C \subseteq\{1,\ldots,n\} marks all zeros of AA if for every (i,j)∈Z(A)(i,j) \in Z(A), either i∈Ri \in R or j∈Cj \in C (or both). The minimum marking number of AA is defined by

MNM⁡(A):=min⁡{∣R∣+∣C∣∣(R,C) marks all zeros of A}.\operatorname{MNM}(A) := \min\{|R| + |C| \mid(R,C) \text{ marks all zeros of } A\}.

By König’s theorem, MNM⁡(A)\operatorname{MNM}(A) equals the size of a maximum matching in the bipartite graph with bipartition {1,…,n}⊔{1,…,n}\{1,\ldots,n\} \sqcup\{1,\ldots,n\} and edge set Z(A)Z(A). One can therefore compute MNM⁡(A)\operatorname{MNM}(A) in O(n5/2)O(n^{5/2}) time via the Hopcroft–Karp algorithm [5], or by any other maximum matching algorithm.

We now describe the algorithm.

The algorithm has two phases. Phase 1 ensures that every row and every column of the matrix contains at least one zero. Phase 2 iteratively adjusts the n×nn \times n matrix until MNM⁡=n\operatorname{MNM} = n.

Algorithm 1 Transforming a non-negative matrix to one with MNM⁡(H)=n\operatorname{MNM}(H) = n

Require: An n×nn \times n non-negative integer matrix W0W^{0}

Ensure: A non-negative matrix HH with MNM⁡(H)=n\operatorname{MNM}(H) = n

  1. Phase 1: Initial reduction.

  2. for i=1i = 1 to nn do

  3. ui←min⁡1≤j≤nwij0u_i \leftarrow\min_{1 \le j \le n} w_{ij}^{0}

  4.   for j=1j = 1 to nn do

  5.     wij1←wij0−uiw_{ij}^{1} \leftarrow w_{ij}^{0} - u_i

  6.   end for

  7. end for

  8. for j=1j = 1 to nn do

  9. vj←min⁡1≤i≤nwij1v_j \leftarrow\min_{1 \le i \le n} w_{ij}^{1}

  10.   for i=1i = 1 to nn do

  11.     wij2←wij1−vjw_{ij}^{2} \leftarrow w_{ij}^{1} - v_j

  12.   end for

  13. end for

  14. Phase 2: Incremental Hungarian (Kőnig) iteration.

  15. Initialise dual potentials ui,vju_i, v_j from Phase 1 (the current reduced matrix is wij2−ui−vjw_{ij}^{2} - u_i - v_j, non-negative with a zero in each row/column).

  16. Compute an initial maximum matching MM in the zero graph E={(i,j):wij2−ui−vj=0}E = \{(i,j) : w_{ij}^{2} - u_i - v_j = 0\}.

  17. t←2t \leftarrow2

  18. loop

  19.   if MNM⁡(W2)=n\operatorname{MNM}(W^{2}) = n then

  20.     H←(wij2−ui−vj)H \leftarrow(w_{ij}^{2} - u_i - v_j) and terminate

  21.   end if

  22.   Grow an alternating tree TT from the unmatched rows of MM in EE

  23.   if an augmenting path is found then

24: Augment MM along it; restart TT from the new unmatched rows ▷ MNM increases by 1

25: else

26: TT defines a minimum vertex cover (Rt,Ct)(R_t,C_t); set It′←{1,…,n}∖RtI'_t \leftarrow\{1,\ldots,n\}\setminus R_t, Jt′←{1,…,n}∖CtJ'_t \leftarrow\{1,\ldots,n\}\setminus C_t

27: ε←min⁡{wij2−ui−vj∣i∈It′, j∈Jt′}\varepsilon\leftarrow\min\{w_{ij}^{2}-u_i-v_j \mid i\in I'_t,\ j\in J'_t\} ▷ ε>0\varepsilon>0, Lemma 2.2

28: Update potentials: ui←ui+εu_i\leftarrow u_i+\varepsilon for i∈It′i\in I'_t; vj←vj−εv_j\leftarrow v_j-\varepsilon for j∈Ctj\in C_t

29: The newly created zeros enter EE and are added to TT; continue growing ▷ no restart

30: t←t+1t\leftarrow t+1

31: end if

32: end loop

Figure 1. Flowchart of the iterative correction phase (Phase 2). The loop repeats the minimum-vertex-cover correction until the minimum marking number reaches nn (equivalently, the zero positions admit a perfect matching); RiR_i (CjC_j, respectively) denotes the matrix with all elements equal to 0, except the ii-th row (jj-th column, respectively), where all elements are 1; the the returned non-negative matrix is H=WtH=W^t.

For each row of the Phase 1 (lines 2–13), we subtract its minimum entry, then for each column we subtract its minimum entry. The resulting matrix W2W^2 is non-negative and each row and each column contains at least one zero.

At the start of Phase 2 (lines 15–32) we maintain, together with the current reduced matrix, a maximal matching MM in its zero graph and the dual potentials ui,vju_i, v_j introduced in Phase 1 (so that the current entry is wij2−ui−vjw_{ij}^{2} - u_i - v_j). If MNM⁡(W2)=n\operatorname{MNM}(W^2) = n the matching is perfect and we terminate. Otherwise we grow an alternating tree from an unmatched row. If an augmenting path is found we augment MM (raising MNM by one) and continue; if no augmenting path exists, the tree yields a minimum vertex cover (Rt,Ct)(R_t, C_t) by König’s theorem. This is the standard alternating-path construction (see e.g. [12 Ch. 7]) and has the following well-known property:

Lemma 2.2. Let (Rt,Ct)(R_t, C_t) be the minimum vertex cover obtained from a maximum matching MM via alternating paths. Let It′I'_t and Jt′J'_t be the rows and columns not in the cover. Then there is no zero of the current reduced matrix in It′×Jt′I'_t \times J'_t. Hence

ε=min⁡{wij2−ui−vj∣i∈It′, j∈Jt′}≥1.\varepsilon= \min\{w_{ij}^{2} - u_i - v_j \mid i \in I'_t,\ j \in J'_t\} \ge1.

We then apply the dual update

  • decrease uiu_i by ε\varepsilon for every unmarked row i∈It′i \in I'_t;

  • increase vjv_j by ε\varepsilon for every marked column j∈Ctj \in C_t.

Equivalently, in the explicit matrix form this subtracts ε\varepsilon from the unmarked rows and adds ε\varepsilon to the marked columns. The operation is the dual-update step of the Hungarian algorithm (Kuhn [7]; see also Burkard, Dell’Amico & Martello [1]). Crucially, the alternating tree, the matching MM and a slack array over the tree frontier are maintained across corrections: a correction only exposes new zero edges on the frontier and the search continues without restarting. It is this incremental maintenance—not a from-scratch recomputation of the matching at each step—that delivers the strongly polynomial O(n3)O(n^3) bound of § 3.

Row statusColumn statusUpdateZeros preserved?
i∈It′i \in I'_t (unmarked)j∈Ctj \in C_t (marked)−ε+ε=0-\varepsilon+ \varepsilon= 0unchanged
i∈It′i \in I'_t (unmarked)j∈Jt′j \in J'_t (unmarked)−ε-\varepsilonnew zeros appear
i∈Rti \in R_t (marked)j∈Ctj \in C_t (marked)+ε+\varepsilonzeros disappear
i∈Rti \in R_t (marked)j∈Jt′j \in J'_t (unmarked)00unchanged

Table 1. Effect of the correction step on matrix entries

After the update we increment tt and repeat.

Termination and Complexity

The termination proof requires that MNM never decreases along the iteration. The naive claim that the current maximum matching survives each correction step is false in general; we therefore establish monotonicity from the structure of minimal markings instead. Write Z(A)Z(A) for the set of zero positions of a matrix AA.

Non-decrease of MNM

Lemma 3.1. Let (RA,CA)(R_A,C_A) be a minimal marking of all zeros of an n×nn \times n matrix AA, where RAR_A is the set of marked rows and CAC_A the set of marked columns. For any subset B⊆RAB \subseteq R_A, define its neighbour set in the unmarked columns by

N(B)={j∣j∉CA, ∃i∈B with ai,j∈Z(A)}.N(B)=\{j \mid j \notin C_A,\ \exists i \in B\text{ with }a_{i,j}\in Z(A)\}.

Then ∣N(B)∣≥∣B∣|N(B)| \ge|B|.

Proof. Suppose, for a contradiction, that some B⊆RAB \subseteq R_A satisfies ∣N(B)∣<∣B∣|N(B)| < |B|. Build a new marking (R1,C1)(R_1,C_1) with R1=RA∖BR_1=R_A\setminus B and C1=CA⊔N(B)C_1=C_A\sqcup N(B). We check that (R1,C1)(R_1,C_1) marks every zero z=ai,j∈Z(A)z=a_{i,j}\in Z(A):

  • if i∈RA∖B=R1i\in R_A\setminus B=R_1, then zz is marked by the row i∈R1i\in R_1;

  • if i∈B⊆RAi\in B\subseteq R_A: when j∈CAj\in C_A we have j∈C1j\in C_1, and when j∉CAj\notin C_A the definition of N(B)N(B) gives j∈N(B)⊆C1j\in N(B)\subseteq C_1;

  • if i∉RAi\notin R_A, minimality of the original marking forces j∈CA⊆C1j\in C_A\subseteq C_1.

Since N(B)∩CA=∅N(B)\cap C_A=\varnothing, we have ∣C1∣=∣CA∣+∣N(B)∣|C_1|=|C_A|+|N(B)|. Let m=∣RA∣+∣CA∣m=|R_A|+|C_A| be MNM(A)(A). Then

∣R1∣+∣C1∣=∣RA∣−∣B∣+∣CA∣+∣N(B)∣=m+(∣N(B)∣−∣B∣)<m.|R_1|+|C_1|=|R_A|-|B|+|C_A|+|N(B)|=m+\bigl(|N(B)|-|B|\bigr)<m.

contradicting the minimality of (RA,CA)(R_A,C_A). Hence ∣N(B)∣≥∣B∣|N(B)|\ge|B|.

The symmetric statement also holds: for any E⊆CAE\subseteq C_A, writing N(E)={i∣i∉RA, ∃j∈E with ai,j∈Z(A)}N(E)=\{i\mid i\notin R_A,\ \exists j\in E\text{ with }a_{i,j}\in Z(A)\}, one has ∣N(E)∣≥∣E∣|N(E)|\ge|E|.

Definition 3.2. A zero of AA that is marked by both a row in RAR_A and a column in CAC_A is called a cross zero.

Proposition 3.3. Let ZZ be the set of all zeros of AA, and let Z′Z' be obtained from ZZ by deleting all cross zeros. Then the minimum marking number of Z′Z' equals the minimum marking number of ZZ.

Proof. Write m=MNM⁡(Z)m=\operatorname{MNM}(Z) and m0=MNM⁡(Z′)m_0=\operatorname{MNM}(Z'). Since Z′⊆ZZ'\subseteq Z, we have m0≤mm_0\le m.

For the reverse inequality, take any marking (R′,C′)(R',C') of Z′Z', and set B=RA∖R′B=R_A\setminus R' and E=CA∖C′E=C_A\setminus C'. For a row i∈Bi\in B we have i∉R′i\notin R', so every zero z=ai,j∈Z′z=a_{i,j}\in Z' with j∉CAj\notin C_A must be column-marked, i.e. j∈C′j\in C', hence j∈N(B)j\in N(B); thus N(B)⊆C′N(B)\subseteq C'. Because the columns in N(B)N(B) avoid CAC_A, they are disjoint from CA∩C′C_A\cap C', so ∣C′∣≥∣CA∩C′∣+∣N(B)∣|C'|\ge|C_A\cap C'|+|N(B)|. Symmetrically, ∣R′∣≥∣RA∩R′∣+∣N(E)∣|R'|\ge|R_A\cap R'|+|N(E)|. Adding and using Lemma 3.1 (and its symmetric form),

∣R′∣+∣C′∣≥∣RA∩R′∣+∣E∣+∣CA∩C′∣+∣B∣=∣RA∣+∣CA∣=m.|R'|+|C'|\ge|R_A\cap R'|+|E|+|C_A\cap C'|+|B|=|R_A|+|C_A|=m.

Since (R′,C′)(R',C') was arbitrary, m0≥mm_0\ge m, and therefore m0=mm_0=m.

Proposition 3.4. In each iteration of the algorithm the minimum marking number MNM⁡\operatorname{MNM} stays the same or increases.

Proof. Let mm be MNM⁡\operatorname{MNM} before the correction, m0m_0 the MNM⁡\operatorname{MNM} of the zeros remaining after deleting the cross zeros before the correction, and m′m' the MNM⁡\operatorname{MNM} after the correction. If there are no cross zeros, the correction only creates new zeros and never removes old ones, so m′≥mm'\ge m. If cross zeros are present, Proposition 3.3 gives m0=mm_0=m; the post-correction m′m' is the minimum marking number of the old non-cross zeros together with the newly created zeros, hence m′≥m0=mm'\ge m_0=m. In either case m′≥mm'\ge m, so MNM⁡\operatorname{MNM} never decreases.

Termination

For each matrix WtW^t, let ri(t)r_i^{(t)} be the total amount subtracted from row ii of W2W^2 and cj(t)c_j^{(t)} the total amount added to column jj of W2W^2. Then the matrix Wt=(wi,jt)n×nW^t=(w_{i,j}^t)_{n\times n} can be expressed as

wijt=wij2−ri(t)+cj(t),t≥2.(1)w_{ij}^t=w_{ij}^2-r_i^{(t)}+c_j^{(t)},\qquad t\ge2. \tag*{(1)}

Denote

St:=∑i=1nri(t)−∑j=1ncj(t),S_t:=\sum_{i=1}^{n}r_i^{(t)}-\sum_{j=1}^{n}c_j^{(t)},

with S2=0S_2=0.

Lemma 3.5. If MNM⁡(Wt)=m<n\operatorname{MNM}(W^t)=m<n, then

St+1=St+ε(n−m)≥St+1.S_{t+1}=S_t+\varepsilon(n-m)\ge S_t+1.

Hence StS_t strictly increases when the algorithm has not yet terminated.

Proof. The correction step subtracts ε\varepsilon from the ∣It′∣|I_t'| unmarked rows and adds ε\varepsilon to the ∣Ct∣|C_t| marked columns. Therefore

St+1−St=ε∣It′∣−ε∣Ct∣=ε(∣It′∣−∣Ct∣).S_{t+1}-S_t=\varepsilon|I_t'|-\varepsilon|C_t|=\varepsilon\left(|I_t'|-|C_t|\right).

Since m=∣Rt∣+∣Ct∣m = |R_t| + |C_t| and ∣It′∣=n−∣Rt∣|I'_t| = n - |R_t|, we have ∣It′∣−∣Ct∣=n−m|I'_t| - |C_t| = n - m. The assumption m<nm < n gives n−m≥1n - m \ge1, and ε≥1\varepsilon\ge1 by Lemma 2.2, so the increment is at least 1. □\square

Lemma 3.6 (Bounded potential). For every permutation σ\sigma in the symmetric group SnS_n,

St≤∑i=1n(wi,σ(i)2).S_t \le\sum_{i=1}^{n} (w_{i,\sigma(i)}^{2}).

Proof. From (1) and the non-negativity of WtW^t we have ri(t)−cj(t)≤wij2r_i^{(t)} - c_j^{(t)} \le w_{ij}^{2} for all i,ji,j. Fix σ\sigma and sum with j=σ(i)j = \sigma(i):

∑i=1n(ri(t)−cσ(i)(t))≤∑i=1nwi,σ(i)2.\sum_{i=1}^{n} \left(r_i^{(t)} - c_{\sigma(i)}^{(t)}\right) \le\sum_{i=1}^{n} w_{i,\sigma(i)}^{2}.

Because σ\sigma is a bijection, ∑icσ(i)(t)=∑jcj(t)\sum_i c_{\sigma(i)}^{(t)} = \sum_j c_j^{(t)}, and the left-hand side is StS_t. □\square

Proposition 3.7. If MNM⁡=m<n\operatorname{MNM} = m < n at some iteration, then MNM⁡\operatorname{MNM} must strictly increase after finitely many additional iterations.

Proof. Assume MNM⁡\operatorname{MNM} stays constant at mm forever after that iteration. Then by Lemma 3.5, the potential StS_t increases by at least 1 at each step and diverges to +∞+\infty. But Lemma 3.6 gives a finite upper bound (take any permutation, say the identity), a contradiction. Hence MNM⁡\operatorname{MNM} cannot stay at mm indefinitely. □\square

Theorem 3.8. For any n×nn \times n non-negative integer matrix W0W^0, Algorithm 1 terminates with a matrix HH satisfying MNM⁡(H)=n\operatorname{MNM}(H) = n.

Proof. After Phase 1, 2≤MNM⁡(W2)≤n2 \le\operatorname{MNM}(W^2) \le n. Proposition 3.4 shows that MNM⁡\operatorname{MNM} never decreases. Proposition 3.7 shows that whenever MNM⁡\operatorname{MNM} is below nn, it must eventually rise. Since it can only take integer values bounded by nn, it reaches nn after finitely many steps. □\square

Time bound

Let M0=max⁡i,jwij2M_0 = \max_{i,j} w_{ij}^{2} be the largest entry after Phase 1. Lemmas 3.5 and 3.6 give a crude pseudo-polynomial bound of O(nM0)O(nM_0) iterations between successive increases of MNM⁡\operatorname{MNM}. This is sharpened to a strongly polynomial bound by implementing Phase 2 as the incremental Hungarian (Kőnig) iteration described above: the alternating tree, the matching MM, and a slack array over the tree frontier are maintained across corrections, so a single correction that exposes new zeros costs only O(n)O(n) amortised work and adds at least one new vertex to the tree. Consequently at most nn corrections occur between two augmentations, and there are at most nn augmentations in total. Each augmenting-path search therefore terminates in O(n2)O(n^2) time, and the overall worst-case running time is O(n3)O(n^3). This is the classical tight bound of the Hungarian method (Kuhn [Kuh55]; see also Burkard, Dell’Amico & Martello [BDM12]) and is independent of the numerical magnitude M0M_0.

Application 1: computing the genus of grid diagrams

A grid diagram of size nn places nn rows and nn columns of squares in the plane, with one “X” marker and one “O” marker in each row and each column. Connecting each X to the O in its column by a vertical segment and each O to the X in its row by a horizontal segment, with crossing information determined by the diagram, gives a knot diagram. We follow Cromwell [3] in defining the winding matrix W(G)W(G) of a grid diagram GG. This is an n×nn \times n integer matrix whose first column and last row are identically zero. The matrix need not be non-negative. To apply the algorithm we first add column constants:

dj=−min⁡1≤i≤nwijG,wij0=wijG+dj, ∀i.(2)d_j=-\min_{1\le i\le n}w^G_{ij},\qquad w^0_{ij}=w^G_{ij}+d_j,\ \forall i. \tag*{(2)}

The algorithm then produces a matrix HH with MNM⁡(H)=n\operatorname{MNM}(H)=n. By König’s theorem, HH admits a permutation σ\sigma with hi,σ(i)=0h_{i,\sigma(i)}=0 for all ii. And this matrix is minimal non-negative matrix by [11 Lemma 3.4.2]. This permutation encodes a distinguished grid state.

The fact that g(G)g(G) can be read from any minimal non-negative matrix HH derived from W(G)W(G), and that its value is independent of the choice of HH, is part of the grid-homology framework of Ozsváth–Stipsicz–Szabó [11]. In that work, the Euler characteristic χ(FH)\chi(F_H), and hence the genus g(G)g(G), as a function of the θ(H)\theta(H) and the grid number nn; then shows that χ(FH)\chi(F_H), and therefore g(G)g(G), is independent of the particular minimal non-negative matrix chosen. Our contribution is algorithmic: we show that the row–column reduction of Algorithm 1 produces exactly such a matrix HH from W(G)W(G) and computes the data needed for the formula in O(n3)\mathcal{O}(n^3) time.

Theorem 4.1 (Genus formula, Ozsváth–Stipsicz–Szabó). [11 Prop. 3.4.9] Let HH be a minimal non-negative matrix produced by Algorithm 1 and let nn be the grid number of GG. The Euler characteristic of the associated surface FHF_H is

χ(FH)=n−θ(H),(3)\chi(F_H)=n-\theta(H), \tag*{(3)}

where θ(H)\theta(H) is the invariant of HH defined in [11 Def. 3.4.8]: for each square QQ marked with an X or an O in the grid, let θ(Q,H)\theta(Q,H) be the average of the four matrix entries hi,jh_{i,j}, hi,j+1h_{i,j+1}, hi+1,jh_{i+1,j}, hi+1,j+1h_{i+1,j+1} adjoining QQ (indices taken modulo nn on the torus), and set

θ(H)=∑X∈Xθ(X,H)+∑O∈Oθ(O,H).\theta(H)=\sum_{X\in\mathsf{X}}\theta(X,H)+\sum_{O\in\mathsf{O}}\theta(O,H).

Since FHF_H is a connected orientable surface with one boundary component, χ(FH)=1−2g(G)\chi(F_H)=1-2g(G); therefore the genus of the grid diagram is

g(G)=1−χ(FH)2=12θ(H)−n−12.(4)g(G)=\frac{1-\chi(F_H)}{2}=\frac{1}{2}\theta(H)-\frac{n-1}{2}. \tag*{(4)}

Example 4.2 (Trefoil knot). The 5×55 \times5 grid diagram of the trefoil knot 313_1 (σO={5,4,3,2,1}\sigma_O=\{5,4,3,2,1\}, σX={2,1,5,4,3}\sigma_X=\{2,1,5,4,3\}) gives the winding matrix

W(G)=(0110001210012210011100000).W(G)=\begin{pmatrix} 0 & 1 & 1 & 0 & 0\\ 0 & 1 & 2 & 1 & 0\\ 0 & 1 & 2 & 2 & 1\\ 0 & 0 & 1 & 1 & 1\\ 0 & 0 & 0 & 0 & 0 \end{pmatrix}.

Phase 1: All column minima and row minima are 0, so W2=W1=W0=W(G)W^2=W^1=W^0=W(G).

Phase 2: Zero positions:

(1,1)(1,1), (1,4)(1,4), (1,5)(1,5), (2,1)(2,1), (2,5)(2,5), (3,1)(3,1), (4,1)(4,1), (4,2)(4,2), (5,1)(5,1), (5,2)(5,2), (5,3)(5,3), (5,4)(5,4), (5,5)(5,5).

Then we get that MNM⁡(W2)\operatorname{MNM}(W^2) has the number 5 (e.g. R={1,4,5}R=\{1,4,5\}, C={1,5}C=\{1,5\}). Hence the algorithm terminates immediately with H=W2H=W^2. The permutation (1,4,2,5,3)(1,4,2,5,3) selects the zeros a1,4=a2,5=a3,1=a4,2=a5,3=0a_{1,4}=a_{2,5}=a_{3,1}=a_{4,2}=a_{5,3}=0. Thus θ(H)=14(2+10+7+5)\theta(H)=\frac{1}{4}(2+10+7+5), hence the genus formula then gives g(G)=12θ(H)−12(5−1)=1g(G)=\frac{1}{2}\theta(H)-\frac{1}{2}(5-1)=1. This is equal to Seifert genus of the trefoil. □

Example 4.3 (Conway knot). The 11×1111 \times11 grid diagram of Conway knot (σO={4,5,10,3,1,11,9,8,7,2,6}\sigma_O=\{4,5,10,3,1,11,9,8,7,2,6\}, σX={1,2,4,8,5,7,6,10,3,9,11}\sigma_X=\{1,2,4,8,5,7,6,10,3,9,11\}) gives the winding matrix

W(G)=(000000−1−1−1−1−1000−1−1−1−2−2−1−1−1000−1−1−1−2−3−2−2−1000−100−1−2−2−2−1000−1000−1−1−2−1000−100000−1000−1−2−10000−100−1−2−2−10000−100−1−2−2−2−1−1−1−1−100−1−1−1−100000000000000000).W(G)=\begin{pmatrix} 0&0&0&0&0&0&-1&-1&-1&-1&-1\\ 0&0&0&-1&-1&-1&-2&-2&-1&-1&-1\\ 0&0&0&-1&-1&-1&-2&-3&-2&-2&-1\\ 0&0&0&-1&0&0&-1&-2&-2&-2&-1\\ 0&0&0&-1&0&0&0&-1&-1&-2&-1\\ 0&0&0&-1&0&0&0&0&0&-1&0\\ 0&0&-1&-2&-1&0&0&0&0&-1&0\\ 0&-1&-2&-2&-1&0&0&0&0&-1&0\\ 0&-1&-2&-2&-2&-1&-1&-1&-1&-1&0\\ 0&-1&-1&-1&-1&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0 \end{pmatrix}.

Phase 1: First, get the non-negative matrix:

W0=(0122211211001211001110012110000000121211100001212122100012121232110110112321100001123211000000121110011112322101222123221).W^0=\begin{pmatrix} 0&1&2&2&2&1&1&2&1&1&0\\ 0&1&2&1&1&0&0&1&1&1&0\\ 0&1&2&1&1&0&0&0&0&0&0\\ 0&1&2&1&2&1&1&1&0&0&0\\ 0&1&2&1&2&1&2&2&1&0&0\\ 0&1&2&1&2&1&2&3&2&1&1\\ 0&1&1&0&1&1&2&3&2&1&1\\ 0&0&0&0&1&1&2&3&2&1&1\\ 0&0&0&0&0&0&1&2&1&1&1\\ 0&0&1&1&1&1&2&3&2&2&1\\ 0&1&2&2&2&1&2&3&2&2&1 \end{pmatrix}.

Phase 2: All column minima and row minima are 0, then W2=W1=W0W^2=W^1=W^0.

Phase 3:

Zero positions:

(1,1)(1,1), (1,11)(1,11), (2,1)(2,1), (2,6)(2,6), (2,7)(2,7), (2,11)(2,11), (3,1)(3,1), (3,6)(3,6), (3,7)(3,7), (3,8)(3,8), (3,9)(3,9), (3,10)(3,10),

(3,11)(3,11), (4,1)(4,1), (4,9)(4,9), (4,10)(4,10), (4,11)(4,11), (5,1)(5,1), (5,10)(5,10), (5,11)(5,11), (6,1)(6,1), (7,1)(7,1), (7,4)(7,4), (8,1)(8,1),

(8,2)(8,2), (8,3)(8,3), (8,4)(8,4), (9,1)(9,1), (9,2)(9,2), (9,3)(9,3), (9,4)(9,4), (9,5)(9,5), (9,6)(9,6), (10,1)(10,1), (10,2)(10,2), (11,1)(11,1). Then we get MNM⁡(W2)\operatorname{MNM}(W^2) has the number 10 (e.g. R={2,3,4,5,7,8,9,10}R = \{2,3,4,5,7,8,9,10\}, C={1,11}C = \{1,11\}). Hence the algorithm continue, and we get ε=1\varepsilon= 1. Thus it is obtained

W3=(0011100100011211001111112110000011121211100111212122101001010121011110112321210001123212100000121121011112322200111012111).W^3 = \begin{pmatrix} 0 & 0 & 1 & 1 & 1 & 0 & 0 & 1 & 0 & 0 & 0 \\ 1 & 1 & 2 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 \\ 1 & 1 & 2 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\ 1 & 1 & 2 & 1 & 2 & 1 & 1 & 1 & 0 & 0 & 1 \\ 1 & 1 & 2 & 1 & 2 & 1 & 2 & 2 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 & 1 & 0 & 1 & 2 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 & 1 & 1 & 2 & 3 & 2 & 1 & 2 \\ 1 & 0 & 0 & 0 & 1 & 1 & 2 & 3 & 2 & 1 & 2 \\ 1 & 0 & 0 & 0 & 0 & 0 & 1 & 2 & 1 & 1 & 2 \\ 1 & 0 & 1 & 1 & 1 & 1 & 2 & 3 & 2 & 2 & 2 \\ 0 & 0 & 1 & 1 & 1 & 0 & 1 & 2 & 1 & 1 & 1 \end{pmatrix}.

Zero positions:

(1,1)(1,1), (1,2)(1,2), (1,6)(1,6), (1,7)(1,7), (1,9)(1,9), (1,10)(1,10), (1,11)(1,11), (2,6)(2,6), (2,7)(2,7), (3,6)(3,6), (3,7)(3,7), (3,8)(3,8),

(3,9)(3,9), (3,10)(3,10), (4,9)(4,9), (4,10)(4,10), (5,10)(5,10), (6,1)(6,1), (6,2)(6,2), (6,4)(6,4), (6,6)(6,6), (6,10)(6,10), (7,4)(7,4), (8,2)(8,2),

(8,3)(8,3), (8,4)(8,4), (9,2)(9,2), (9,3)(9,3), (9,4)(9,4), (9,5)(9,5), (9,6)(9,6), (10,2)(10,2), (11,1)(11,1), (11,2)(11,2), (11,6)(11,6).

Then we get MNM⁡(W2)\operatorname{MNM}(W^2) has the number 11 (e.g. R={1,2,3,4,6,8,9,11}R = \{1,2,3,4,6,8,9,11\}, C={2,4,10}C = \{2,4,10\}). Hence the algorithm terminated with H=W3H = W^3.

The permutation (1,11,6)(2,7,4,9,5,10)(3,8)(1,11,6)(2,7,4,9,5,10)(3,8) selects the zeros a1,11=a2,7=a3,8=a4,9=a5,10=a6,1=a7,4=a8,3=a9,5=a10,2=a11,6=0a_{1,11}=a_{2,7}=a_{3,8}=a_{4,9}=a_{5,10}=a_{6,1}=a_{7,4}=a_{8,3}=a_{9,5}=a_{10,2}=a_{11,6}=0. Thus θ(H)=14(5+12+7+5+4+9+15+7)\theta(H)=\frac{1}{4}(5+12+7+5+4+9+15+7), then we get that

g(G)=12θ(H)−12(11−1)=3.g(G)=\frac{1}{2}\theta(H)-\frac{1}{2}(11-1)=3.

In the first example the algorithm terminates after Phase 1. As shown in Example 4.3, more complex diagrams require additional iterative updates, but the bounded potential argument and standard augmenting path techniques guarantee efficient eventual termination.

Application 2: Grid moves and the search for minimal genus of knot

Grid diagrams admit three types of elementary moves—commutation, stabilization, and destabilization—coined grid moves collectively (Definition 3.1.8 of [11]). Cromwell’s theorem [3] states that two planar grid diagrams represent equivalent links if and only if one can be transformed into the other by a finite sequence of grid moves [11]. Consequently, every grid diagram GG of a knot KK can be reached from any other diagram of the same knot by a suitable sequence of commutations, stabilizations and destabilizations.

Unlike the Seifert genus g(K)g(K), which is a knot invariant, the quantity g(G)g(G) computed from a single grid diagram GG depends on the particular diagram chosen. Different grid diagrams representing the same knot may therefore yield different values of g(G)g(G). The Seifert genus is recovered as the minimum over all diagrams:

g(K)=min⁡{g(G)∣G is a grid diagram for K}.g(K) = \min\{g(G) \mid G \text{ is a grid diagram for } K\}.

Grid moves provide a mechanism for navigating the space of grid diagrams. In particular, destabilization can, in favourable cases, reduce g(G)g(G) and bring one closer to a genus-minimizing diagram. An analogous role is played by commutation, which permutes the markings without changing the grid size and can prepare a diagram for a subsequent destabilization. Together, they open the possibility of a descent algorithm that, starting from a given grid diagram G0G_0 of a knot KK, produces a sequence

G0→comm.G1→stab.G2→comm.⋯→destab.GmG_0 \xrightarrow{\mathrm{comm.}} G_1 \xrightarrow{\mathrm{stab.}} G_2 \xrightarrow{\mathrm{comm.}} \cdots\xrightarrow{\mathrm{destab.}} G_m

with maybe decreasing genus (or equal, or increasing) at each step, and terminates at a diagram GmG_m whose genus g(Gm)g(G_m) equals the Seifert genus g(K)g(K).

Understanding how each type of grid move affects the winding matrix W(G)W(G), and therefore the minimal non-negative matrix HH and the value θ(H)\theta(H), is an essential step towards realising such a descent algorithm. The analysis of these effects is the subject of ongoing work and will be presented in a subsequent paper. The present contribution provides the algebraic engine (Algorithm 1) that computes g(G)g(G) from W(G)W(G) in O(n3)O(n^3) time, which forms a necessary building block for any move-based optimisation.

This raises a natural question: given a grid diagram GG, what features of its winding matrix W(G)W(G) determine whether a particular stabilization or commutation will increase, decrease, or leave unchanged genus g(G)g(G)? We formulate this problem here and indicate a promising direction of investigation suggested by the algebraic machinery of Algorithm 1.

Let GG be an n×nn \times n grid diagram and G′G' a stabilization of GG, so that G′G' is an (n+1)×(n+1)(n+1) \times(n+1) grid diagram. Write H=H(G)H = H(G) and H′=H(G′)H' = H(G') for the minimal non-negative matrices produced by Algorithm 1. The genus formula gives

g(G)=12θ(H)−n−12,g(G′)=12θ(H′)−n2.g(G) = \frac{1}{2}\theta(H) - \frac{n-1}{2}, \qquad g(G') = \frac{1}{2}\theta(H') - \frac{n}{2}.

Their difference is therefore

g(G′)−g(G)=12(θ(H′)−θ(H)−1).(5)g(G') - g(G) = \frac{1}{2}\bigl(\theta(H') - \theta(H) - 1\bigr). \tag*{(5)}

Thus gg increases by kk if and only if θ(H′)−θ(H)=2k+1\theta(H') - \theta(H) = 2k + 1; it stays the same precisely when θ(H′)=θ(H)+1\theta(H') = \theta(H) + 1.

Because θ(H)\theta(H) is a sum of local averages of the entries of HH around each XX and OO marking, the change θ(H′)−θ(H)\theta(H')-\theta(H) is controlled by how the new row and column inserted during stabilization affect these local averages. For a destabilization—the inverse operation—the sign is reversed, and one obtains a descent move precisely when θ(H)−θ(H′)>1\theta(H) - \theta(H') > 1.

We now consider the O:NWO:NW case as an example. Let GG be a grid diagram with grid number nn. After performing an O:NWO:NW stabilization on GG at an OO-marking (n−i+1,j−1)(n-i+1,j-1), denote by G′G' the resulting grid diagram, which has grid number n+1n+1, as shown in Figure 2.

Figure 2. O:NWO:NW

The following example is about the knot 515^1. We can see that the genus increase 1 after the stabilization O:NW which occur at a given O-marking (2,2)(2,2).

Example 5.1. The 7×77 \times7 grid diagram of knot 515^1 (σO={1,2,3,4,5,6,7}\sigma_{\mathrm{O}}=\{1,2,3,4,5,6,7\}, σX={5,6,1,2,7,3,4}\sigma_{\mathrm{X}}=\{5,6,1,2,7,3,4\}) gives the following winding matrix

W(G)=(0000011001112101222210122110012100001100000000000).W(G)=\begin{pmatrix} 0 & 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 1 & 2 & 1 \\ 0 & 1 & 2 & 2 & 2 & 2 & 1 \\ 0 & 1 & 2 & 2 & 1 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{pmatrix}.

We will see that W2=W1=W0=W(G)W^2=W^1=W^0=W(G). Since MNM⁡(W2)=7\operatorname{MNM}(W^2)=7, θ(H)=14(5+10+21+7)\theta(H)=\frac{1}{4}(5+10+21+7), and we get the associated genus

g(G)=12θ(H)−12(7−1)=2.g(G)=\frac{1}{2}\theta(H)-\frac{1}{2}(7-1)=2.

After the stabilization O:NW which occur at a given O-marking (2,2)(2,2), we get a 8×88 \times8 grid diagram (σO={1,2,3,4,5,6,7,8}\sigma_{\mathrm{O}}=\{1,2,3,4,5,6,7,8\}, σX={6,7,2,1,3,8,4,5}\sigma_{\mathrm{X}}=\{6,7,2,1,3,8,4,5\}), and its winding matrix is

W(G′)=(0000001100111121012222210122211001221000012100000111000000000000).W(G')=\begin{pmatrix} 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 1 & 1 & 2 & 1 \\ 0 & 1 & 2 & 2 & 2 & 2 & 2 & 1 \\ 0 & 1 & 2 & 2 & 2 & 1 & 1 & 0 \\ 0 & 1 & 2 & 2 & 1 & 0 & 0 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{pmatrix}.

It is easy to see MNM⁡(W2)=8\operatorname{MNM}(W^2)=8 under the algorithm 1, then θ(H′)=14(2+10+28+7+5)\theta(H')=\frac{1}{4}(2+10+28+7+5), and we get the associated genus

g(G′)=12θ(H′)−12(8−1)=3.g(G')=\frac{1}{2}\theta(H')-\frac{1}{2}(8-1)=3.

Acknowledgements

The author would like to thank Xiang Liu and Ziyi Liu at Hebei Normal University for discussions, and Xiaowei Pang for her encouragement. The project was funded by Science and Technology Project of Hebei Education Department (Grant No. QN2023030), Science Foundation of Hebei Normal University (Grant Nos. L2022B02, L2025ZD04).

Data availability

No data was used for the research described in the article.

Declaration

  • Python was used for the implementation of the algorithm.

  • AI was used for typesetting and grammar.

References

  1. [1]R. Burkard, M. Dell’Amico, and S. Martello. Assignment Problems. SIAM, Philadelphia, 2012.
  2. [2]P. R. Cromwell. Embedding knots and links in an open book I: Basic properties. Topology and its Applications, 64:37–58, 1995.DOI
  3. [3]P. R. Cromwell. Knots and Links. Cambridge University Press, 2004.DOI
  4. [4]I. A. Dynnikov. Arc-presentations of links: monotonic simplification. Fundamenta Mathemat-icae, 190:29–76, 2006.arxiv.org/abs/math/0208153
  5. [5]J. Hopcroft and R. Karp. An n⁵/² algorithm for maximum matchings in bipartite graphs. SIAM Journal on Computing, 2(4):225–231, 1973.
  6. [6]G. T. Jin and H. J. Lee. Minimal grid diagrams of 11 crossing prime alternating knots. Journal of Knot Theory and Its Ramifications, 29:1–14, 2020.DOI
  7. [7]H. W. Kuhn. The hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1–2):83–97, 1955.
  8. [8]Marc Lackenby. A polynomial upper bound on reidemeister moves. annals of mathematics, 182:491–564, 2015.arxiv.org/abs/1302.0180
  9. [9]C. Manolescu, P. Ozsvath, and S. Sarkar. A combinatorial description of knot floer homology. Annals of Mathematics, 169:633–660, 2009.
  10. [10]C. Manolescu, P. Ozsvath, and D. Thurston. Grid diagrams and heegaard floer invariants. Annals of Mathematics, 201, 2025.arxiv.org/abs/0910.0078
  11. [11]P. Ozsvath, Stipsicz A., and Szabo Z. Grid Homology for Knots and Links. American Mathematical Society, 2015.DOI
  12. [12]C. H. Papadimitriou and K. Steiglitz. Combinatorial Optimization: Algorithms and Complexity. Prentice-Hall International, Inc., New Jersey, 1982.

Paper details

vlnc:W_f4fgegpx
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

AI

View statement
Looking for related papers…
Contents