Yarn ball knots and faster computations

We make use of the 3D nature of knots and links to find savings in computational complexity when computing knot invariants such as the linking number and, in general, most finite type invariants. These savings are achieved in comparison with the 2D approach to knots using knot diagrams.

1. Introduction 1.1.Motivation.A recurring question in knot theory is "Do we have a 3D understanding of a knot invariant?".We often think about knots as planar diagrams and compute invariants from the diagrams.In this paper, we consider computation from a planar diagram to be a "2D" understanding of the invariant.For example, Kauffman [Kau90] gave a description of the Jones polynomial using planar diagrams, bringing the understanding of this invariant to 2D. 1 Witten [Wit89] developed Chern-Simons theory, a 3-dimensional topological quantum field theory, partially in order to understand the Jones polynomial in a 3D way.However, this theory does not seem to lead to easier computations of the invariant.So, while the Chern-Simons theory description is 3D, from the point of view of this paper, it is (at least computationally) still an incomplete 3D understanding of the Jones polynomial.
The complexity of planar knot diagrams is often measured by their number of crossings, denoted by n in this paper, and the computational complexity of a knot invariant is typically described in terms of n.Three-dimensionally, planar diagrams can be seen as projections of knots embedded in "pancakes"-very flat and wide subsets of R 3 , as in Figure 1 (A).This pancake description of a knot is somewhat artificial and does not realistically describe knots that occur in nature.For example, knotted DNA is shaped much more like the ball of yarn in Figure 1 (B), than the pancake knot in (A).
The point of view we present in this paper is that knots are three-dimensional and the best way to understand a knot should be three-dimensional.In the subsequent sections, we propose some new language to aid the knot theory community in discussion surrounding current understanding of an invariant.
1.2.Yarn balls and pancakes.For complexity measurements in this paper, we measure only polynomial degree (i.e.we ignore constants and log(n) terms).We write f (n) ∼ g(n) to mean there exist natural numbers c, k, N so that for all n > N , we have that < cg(n)(log(n)) k .
For example, for us, n 4 ∼ 5.4 n 4 (log(n)) 8 .If the inequality (1) holds true, we write g ≳ f .Also, we write g ≫ f to mean that for all constants c and k, and for all large enough n we have that cf (n)(log(n)) k < g(n).Given a knot, i.e. a particular embedding of S 1 into 3-space, a knot invariant by definition will output the same value for different diagrams of the knot (i.e.different planar projections).However, the complexity of computing the invariant using a particular algorithm may differ depending on the number of crossings n in the input diagram.So, we will measure the computational complexity of an invariant using the number of crossings of the input diagram, rather than the minimal crossing number of the knot type (the knot considered up to ambient isotopy).Similarly, if we start with a 3D presentation of a knot, in a yarn ball or a grid as discussed in Section 2, the complexity of an invariant will be measured by the volume V of the input knot, described below, and not by the minimal volume of the knot type.
The comparison between 3D computational complexity and 2D complexity of a knot invariant relies on the comparison of V to V 4/3 .The quantity ∼ V 4/3 is the number of crossings in a generic projection of a yarn ball knot.We describe this result here and formalize the concepts of a pancake knot and yarn ball knot.Definition 1.1.A pancake is a thickened disk in R 3 with radius greater than 2 and constant height 2. A pancake knot is a knot contained in a pancake.
Planar diagrams of knots are projections of pancake knots in R 3 .Definition 1.2.A yarn ball knot in R 3 is a knotted tube of uniform width 1 in a 3-ball of diameter L, such that the volume of the knot (i.e. the volume of the tube) is ∼ L 3 .L is called the diameter of the yarn ball knot.
Projection of a yarn ball knot to a disk of diameter L. To count the crossings in the projection, subdivide the disk into 1 × 1 squares.Each square will have ∼ L 2 strands crossing each other, for a total of ∼ L 2 ∼ L 2 crossings in that square.
An equivalent notion of a yarn ball knot is a knot embedded in a grid, which we discuss further in Section 2. Theorems 2.1 and 3.3 are proved using knots embedded in a grid.
A yarn ball knot in a 3-ball of volume V has by definition volume and length both ∼ V .Most knots appearing in nature are yarn ball knots, as for example the knotted ball of yarn in Figure 2.
By projecting the yarn ball knot in a generic direction onto a disk, and shrinking the width of the tube to ϵ, we attain a planar knot diagram.The number of crossings of this projection can be estimated by subdividing the disk into 1 × 1 squares, as in Figure 2.For a sufficiently complicated knot, heuristically we expect most such 1 × 1 squares will have L layers of strands above them, and one can expect these strands to cross around ∼ L 2 ∼ L 2 times in the projected square.Since there are ∼ L 2 squares, the total crossing number of this projection is around n ∼ L 2 L 2 = L 4 = V 4/3 .We assert that at worst, a knot of volume V can always be projected with ∼ V 4/3 crossings.
Since we aim to have a 3D understanding of knot invariants, we study knots in the shape of the yarn ball as opposed to the pancake.We see that to describe a yarn ball knot of volume (or length) V as a planar diagram, we would need ∼ V 4/3 crossings.Since V ≪ V 4/3 , for large values of V it requires many more bits to describe a yarn ball knot via its projection rather than directly as a yarn ball.

The worst-case complexity of computing ζ on a knot given as a yarn ball of volume
However, these abstract complexities, while well defined, are unknown and often unknowable.In practice, one works with a known upper bound for the complexity coming from a current best known algorithm.To reflect this more practical perspective, we define F KT ζ (kD, n), or f astest known time.Definition 1.4.Let ζ be a knot invariant.F KT ζ (kD, n) is the computational complexity of the current fastest algorithm known to compute ζ with k-dimensional input of size n.
F KT ζ (kD, n) is dependent on our current understanding of the computational problem, as the current known fastest algorithm may be improved or supplanted by a better one.In analogy, a current world record may be broken by a faster athlete.To summarise, C ζ (kD, n) has a fixed value, which can however be very difficult to determine, while the value of F KT ζ (kD, n) depends on the current best known algorithm and so can be computed using that knowledge.By these definitions, we always have that 1.4.2D versus 3D algorithms.Given a yarn ball K of volume V , we can always compute an invariant ζ on K by first projecting to the plane2 , obtaining a planar diagram with ∼ V 4/3 crossings, and then computing ζ using our best 2D techniques.Hence always, ).It is interesting to know when 3D techniques can do even better.Our first main result is to show that for the link invariant the linking number, there is a 3D computation technique whose worst-case complexity is faster than every worst-case 2D technique.
Theorem 2.1.(Proof in Section 2) Let lk denote the linking number of a 2-component link.
The linking number of a link is an example of a finite type invariant.Finite type invariants underlie many of the classical knot invariants, for instance they give the coefficients of the Jones, Alexander, and more generally HOMPFLY-PT polynomials [BL93,BN95a].We prove the following computational bounds for all finite type invariants.
The actual complexities C ζ (2D, n) for some specific though 'special' finite type ζ's, such as the coefficients of the Alexander polynomial, are known to be much smaller.However, for generic ζ's, these theorems suggest that 3D techniques will be more computationally efficient than 2D ones.We suspect the upper bounds in Theorem 3.2 and 3.3 can be improved by closer consideration of the counting arguments used in the proofs.However, we view these theorems as a significant starting point that we hope to improve upon in the future and encourage our readers to do the same.
To capture the comparison between the complexity of 2D and 3D techniques, we introduce the following terminology.

Conversation Starter 1. A knot invariant ζ is said to be computationally 3D, or C3D, if
In other words, ζ is C3D if substantial savings can be made to the computation of ζ on a yarn ball knot, relative to the complexity of computing ζ by first projecting the yarn ball to the plane.
As discussed above, the notion of an invariant being computationally 3D that we use here is dependent on the current knowledge of the invariant.As our understanding grows and our computational techniques get better, an invariant might become C3D, or lose its C3D status.However, the question of whether an invariant is C3D, as we understand it at a given time, still has merit as it measures our understanding, as a community, of knot theory as a 3D subject.With this new terminology, Theorem 2.1 could be restated as Theorem 2.1.(restated) The linking number of a 2-component link is C3D.
The results of Theorems 3.2 and 3.3 naively suggest that finite type invariants are also C3D, but the theorems only give one sided bounds.Yet, we believe that our naive conclusion remains valid, at least in the form "most finite type invariants are C3D".
The opinion in this paper is that in general knot invariants should be C3D.Unfortunately, as of the time this paper is written, very few knot invariants are known to be C3D.Are the Alexander, Jones, or HOMFLY-PT polynomials C3D?Why or why not?Are the Reshetikhin-Turaev invariants C3D? Are knot homologies C3D?While we seem to have a weak understanding of these fundamental invariants from a 3D perspective, this is cause for optimism; there is still much work to be done.1.5.Further directions.The above ideas admit a further generalization or extension.Instead of using computational complexity to compare 2D and 3D understandings of invariants, we can also use the notion of the maximal value of other quantities relating to the size of the knot, which motivates the next conversation starter.

Conversation Starter 2. If η is a stingy quantity (i.e. we expect it to be small for small knots), we say η has savings in 3D, or has 'S3D' if
where M η (kD, s) is the maximum value of η on all knots described k-dimensionally and of size s.
For example, the hyperbolic volume is a stingy quantity-the more complicated a knot is, the more complicated its complement in S 3 will be, which makes the question of putting a hyperbolic structure on it harder.We expect hyperbolic volume to have savings in 3 dimensions.

Conjecture (D. Bar-Natan, van der Veen) Hyperbolic volume has S3D.
The genus of a knot is another example of a stingy quantity, but we do not know if the genus of a knot has S3D, or not.If a knot is given in 3-dimensions, is the best way to find the genus truly to compute the Seifert surface from a projection to 2D, at a great cost?The genus is by all means a 3D property of a knot, and it seems as though it should be best computed in a 3D manner.
We hope that these conversation starters will encourage our readers to think about more 3D computational methods.The remaining two sections of this paper are dedicated to proving Theorems 2.1 and 3.3.
Acknowledgements.This work was partially supported by NSERC grant RGPIN-2018-04350, and by the Chu Family Foundation (NYC).We would like to thank our anonymous referee for helpful comments.

Grid Knots and Linking Number
To emphasize the 3D nature of knots, we think of them as yarn ball knots, instead of as pancake knots.An equivalent notion is "grid knots" (see also [BL12]).A grid knot (or link) of size L is a labeled parameterized knot or link embedded as a subset of a grid with side length L. The arcs of a grid knot are enumerated in order of the parametrization of the knot along the unit grid segments of the grid lines.For a grid link, the link components are enumerated, and each arc of the link is labeled by a pair (c, p), where c is the arc's component enumeration, and p is the arc's parametrization enumeration.Some examples of grid knots are shown in Figure 3. Figure 4 (A) and (B) shows an example of a 4 × 4 × 4 grid from different perspectives.The process of converting an oriented yarn ball knot of length/volume V to a grid knot is as follows.Replace the yarn by an approximation along grid lines with grid spacing say 1 10 'th the unit width of the yarn.Rescale so that the grid squares are unit length again.Starting at any corner of the grid knot, label the arcs of the knot in order according to the orientation.The resulting knot is bounded in a box of size ∼ 10 3 V , and this process takes ∼ V computation steps.To convert a grid knot to a yarn ball knot, scale the grid so the distance between neighbouring grid points is say 3 or 5 units.Replace the arcs of the knot with yarn of width 1 and round out the corners.This process takes time proportional to the length of the knot.When computing an invariant of a yarn ball knot, first converting the knot into a grid knot adds a negligible amount of computation time.
For the remainder of this paper, we conventionally view grids with the slightly askew topdown view as in Figure 4 (B).From this perspective, all of the crossings of a grid knot occur in triangular crossing fields of the grid-highlighted in Figure 4 (C).The grid lines in the x, y directions are colored in green and red, and the grid lines in the vertical direction are colored blue.From the askew top down perspective as in Figure 4 (B), we keep the convention that "/" grid lines are called "green", "\" grid lines are called "red", and horizontal grid lines are called "blue".All of the crossings in a crossing field occur between green and red grid lines.The vertical blue grid lines never participate in a crossing.There are 2L 2 triangular crossing fields; 2 at each of the (L − 1) 2 interior corners, and one along each exterior corner except two corners, which is 2L + 2(L − 1), for a total of 2(L − 1) 2.1.Linking Number.For a two-component link L, the linking number of L, denoted lk(L), is a classical link invariant that measures how the two components are linked.From a planar projection of L, lk(L) can be computed as follows: Only counting "mixed" crossings that involve both components (the over strand is from one component and the under strand is from the other component), lk(L) is one half the difference of the number of positive crossings and the number of negative crossings.Using this 2D method for a planar diagram with n crossings, computing lk requires ∼ n steps-one for every crossing 3 -which shows that C lk (2D, n) ∼ n.Using grid links, we provide a 3D algorithm that computes lk in time ∼ V , and since n = V wasn't the case, it would mean that lk could be computed without looking at parts of the yarn (in the 3D case, for the length of the yarn is ∼ V ) or at some of the crossings (in the 2D case, for there are n crossings).But this is absurd: changing any crossing could change the linking number, and likewise, slightly moving any piece of yarn.Also, the standard "sum of signs over crossings" formula for lk shows that C lk (2D, n) ≲ n.
So we only need to prove that C lk (3D, V ) ≲ V .Let L be a grid link with size L and volume V = L 3 .There are 8 possible "mixed" crossing types in L according to the orientations of the two strands, whether the green or red strand crosses on top.
The linking number is computed by counting how many crossings of each of the 8 types are in the grid knot, adding these numbers together (with signs) and dividing by 2. We further 3 Notice that in the worst case, and presumably also typically, the number of mixed crossings is ∼ n. break this down by counting how many crossings of each type occur in a single crossing field, then sum over all the crossing fields.
We show here how to count instances of the first crossing listed in the diagram above where we assume the green strand comes from the link component labeled 1, and the red strand from the link component labeled 2.
The other seven cases are counted similarly and with the same computational complexity.Fix a crossing field F k and let G be a subset of the green arcs of the grid link labeled (1, p), for any p, in F k and let R be a subset of the red edges of the grid link in F k labeled (2, p), for any p.For any such crossing field F k , we can define a height map on the sets R and G, denoted z : R, G → [0, L], which gives the vertical strand height in F k .
Within the fixed F k , to count the number of times a green strand crossed over a red strand, we need to count the number of pairs {(r, g) ∈ R × G : z(r) < z(g)}.To do this, line up the elements of R and G in increasing order based on their z-value, as shown below.
If there is a pair (r, g) of R × G such that z(r) = z(g), there is a convention for which order to place the dots on the line.If we are counting greens over red, put the green dot first, and red dot second, as shown in Figure 6.If we count red crossing over green, put the red dot first and green dot second.Start with rb = cf = 0 ("reds before" and "cases found") and with the place holder ∇ before the leftmost dot.Slide ∇ from left to right, incrementing rb by one each time ∇ crosses a red dot and incrementing cf by rb each time ∇ crosses a green dot.The value of cf is the desired number of pairs that we wished to count.An example of the computation is shown in Figure 6.
For a fixed crossing field F k , this computation can be carried out in time ∼ L. There are ∼ L 2 crossing fields and 8 types of colored orientation crossing types, which yields an overall computation time of ∼ L 3 = V .□

Finite Type Invariants
A Gauss diagram of an n-crossing knot diagram parameterized by an interval I is given by the interval I along with n arrows.Each arrow corresponds to one of the n crossings and connects a point in the parameter space I which parametrizes the top of the crossing to a point which parametrizes the bottom of the crossing.Each arrow is also decorated with a sign corresponding to the sign of the crossing.We give an example of a Gauss diagram in Figure 7. diagrams⟩ is the Q-vector space of all formal linear combinations of Gauss diagrams.We will denote the subspace of Gauss diagrams with d or fewer arrows by GD d = ⟨Gauss diagrams⟩ d .Gauss diagrams play an important role in the theory of finite type, or Vassiliev, invariants [Vas90,Vas92].Any knot invariant V taking numerical values can be extended to an invariant of knots with finitely many double points (i.e.immersed circles whose only singularities are transverse self-intersections), using the following locally defined equation: The above should be interpreted in the setting of knot diagrams which coincide outside of the given crossing.A knot invariant is a finite type invariant of type d if it vanishes on all knot diagrams with at least d + 1 double points [BL93,BN95a].
Let Theorem 3.2.(see also [BN95b]) Next, we prove that in fact finite type invariants can be computed more efficiently from a 3D presentation: Proof.Let ζ be a finite type invariant of type d and let K be a grid knot with side lengths L viewed as a diagram from the top-down perspective as in Figure 4.By Theorem 3.1, , for some linear functional ω.Since GD d is a fixed finite-dimensional vector space, the complexity of computing ω does not depend on K or V .Thus, to prove the theorem, it suffices to show that φ d (K) can be computed in time V To compute φ d (K) it suffices to compute c Dχ for every D χ ∈ LGD d .The following argument will compute c Dχ and will be repeated for every D χ ∈ LGD d .Such repetition will not contribute to the complexity of φ d up to ∼ as LGD d is a fixed finite dimensional space independent of K.
Let D χ ∈ LGD d be a labeled Gauss diagram with ℓ ≤ d arrows.The most computationally difficult case is when ℓ = d, so we will count instances of diagrams with ℓ = d and all other counts will be similar and easier.We count all instances of D χ that fall into specific crossing fields of the grid knot K.
Number each arrow of D χ with j ∈ {1, • • • , d}, in the order in which the arrows first occur from left to right in D χ .As a labeled Gauss diagram, each arrow j of D χ is also decorated with χ j ∈ {x 1 , • • • , x 8 } which specifies the crossing type associated to arrow j.We also label the ends of the arrows.Following the example in Figure 8, label the head of arrow j with α(j) ∈ {1, • • • , 2d} and each tail by β(j) ∈ {1, • • • , 2d} in increasing order according to the parametrization.We will count the occurrences of D χ in K by scanning the grid knot in the following way: 1. We consider all possible d-tuples F = (F k 1 , . . ., F k d ) of crossing fields in K.For such a tuple, the jth arrow in D χ gets assigned the crossing field denoted F k j .This choice specifies that the arrow j corresponds to a crossing of type χ j which occurs in the crossing field F k j in the grid knot diagram for K (if such a crossing exists in F k j , see Example 3.4).There are ∼ L 2 choices of crossing fields for each of the d arrows, so there ∼ L 2d possible choices of crossing field tuples for D χ .
2. For any d-tuple F of crossing fields, we also assign to each arrow of D χ a pair of sets: B i , associated to the head, and B i ′ associated to the tail of the arrow.The index i of B i will not necessarily match the label j of the arrow, but rather the labelling of the B i 's is according to the order in which the ends of the arrows appear along the parametrization, as in Figure 8.Thus, the set B i associated to the head of arrow j will have i = α(j), and the B i ′ associated to the tail of arrow j will have i ′ = β(j).The sets B i and B i ′ for arrow j will depend on both the crossing field F k j and the crossing type χ j of the arrow.The crossing type χ j determines whether we count green strands on top of red, or red on top of green, and which orientation of the strands to count.In general, B i will be the set of strands of the knot in F k j that have the same color and orientation as the under strand in crossing type χ j .The set B i ′ will be the strands of the knot in F k j that have the same color and orientation as the over strands in crossing type χ j .
Example 3.4.Suppose χ j = x 1 and refer to Figure 9.The crossing type x 1 determines we are counting green and red arrows both oriented upwards, with green on top.We look to the crossing field F k j of our knot diagram for K.In F k j , if all of the red strands cross on top, then both B i and B i ′ are empty, as the crossings are not compatible with the x 1 type crossing.If the green strands in F k j cross on top, then the set B i , associated to the head of arrow j, will be all of the red strands of the knot in F k j oriented upwards.The set B i ′ , associated to the tail of arrow j, will be all of the green strands of the knot in F k j oriented upwards.
3. With the crossing fields chosen and the B i 's assigned, we look for instances of D χ within the grid knot, by choosing a strand b i in each B i and checking if the collection of chosen strands {b 1 , • • • , b 2d } is compatible with the parametrization and gives rise to exactly d crossings in K that recover the diagram D χ .To check this compatibility, there are two functions defined on the sets B i .
. An example of computing the sets B i and B i ′ for a crossing of type χ i = x 1 and two different crossing fields.
• t : ∪B i → Z gives the order in which the arrow endpoints labeled by the B i 's occur in the parametrization of the grid diagram for K. • z : ∪B i → {0, • • • , L} gives the vertical height of the strand in the grid knot.Notice that for each i, the elements of B i are strands of the same color inside a single crossing field, all of which have distinct heights.So z| B i is injective for every i.
First, we need the crossings to occur in the correct order along the grid knot according to the parametrization.This means we need t(b 1 ) < t(b 2 ) < ... < t(b 2d ).Second, we need to ensure that the chosen strands for a given arrow in the diagram actually cross.For an arrow j, b β(j) needs to be the over strand of the crossing and b α(j) is the under strand.To get that b β(j) crosses over b α(j) , we need the height of b α(j) to be lower than the height of b β(j) , i.e. z(b α(j) ) < z(b β(j) ).Notice that b α(j) and b β(j) can be elements from different B i 's.
In Section 4 we will prove Proposition 4.2, which asserts that this computation can be carried out in time L d .Since we had ∼ L 2d choices of d-tuples of crossing fields, a large but finite constant number of labeled Gauss diagrams with d or fewer arrows, and for each choice we have L d computations to find instances of this diagram in the knot, we get a total computation time of ∼ L 2d L d = V d as claimed.□

Combinatorial Results
In this section, we prove Proposition 4.2, which was used in the proof of Theorem 3.3.We start with the following lemma.Lemma 4.1.Suppose we have sets B i , for i ∈ {1, • • • , 2d}, and a map t : ∪B i → N such that t| B i is injective for all i.Let K := max(|B i |).Then the quantity can be computed in time ∼ K.
Proof.In time ∼ K each of the B i 's can be sorted by the values of t on it and replaced by its indexing interval.So without loss of generality, each B i is just a list of integers {1, . . ., |B i |}, the function t is replaced by increasing functions t i : {1, . . ., |B i |} → N, and we need to count i.e.N ι,τ is the number of sequences of length ι with increasing t-values that terminate at a value less than or equal to t ι (τ ).Also set N ι,0 = 0 for all ι.Then clearly N = N 2d,|B 2d | , N 1,τ = τ for all τ and for ι > 1, where τ ′ = max({0} ∪ {τ ′′ : t ι−1 (τ ′′ ) < t ι (τ )}).Note that τ ′ can be computed in time log K ∼ 1 and hence the N ι,− 's can be computed from the N ι−1,− 's in time ∼ K. To find the N 2d,− 's and hence N this process needs to be repeated 2d .
Proof.Lemma 4.1 shows us how to count elements in the set A without the conditions on z.
We will show that |A| can be computed by writing A as a union of sets with the t-conditions and one Cartesian condition, so that we can apply Lemma 4.1 to count elements in each set of the union.Let p ∈ N so that 2 p−1 < L ≤ 2 p .Every z-value is in {0, • • • , L} and can be written as a binary expansion with exactly p binary digits, padding with zeros in front if needed.For example, if p = 5 the number 2 can be written as 00010.For two binary numbers z 1 and z 2 in this form, z 1 < z 2 if they have the same binary expansions from left to right up to a point, and in the first place they differ z 1 has a 0 and z 2 has a 1.The notation we use to describe this is as follows.Let σ be the binary sequence from left to right which z 1 and z 2 share in common.We write z 1 = σ0 * to mean the binary expansion of z 1 read left to right is σ followed by 0 followed by an arbitrary remainder of 0's and 1's.Similarly, we write z 2 = σ1 * .
For each j ∈ {1, • • • , d}, the relation z(b α(j) ) < z(b β(j) ) requires the pair (z(b α(j) ), z(b β(j) )) to be in the triangle below the diagonal shown in Figure 10.Notice that in a single pair, (z(b α(j) ), z(b β(j) )), the b α(j) and b β(j) are not necessarily elements of the same B i .Since the outputs of z are integral, we can divide the triangle into a finite number of squares below the diagonal.The sides of the squares in the triangle are labeled by binary sequences of length less than or equal to p.Each square is determined by all but the last entry in the sequences labeled on the right and bottom sides of the square.
Since j can range from 1 to d, there are d relations α(j) ) < z(b β(j) ) that must simultaneously hold.So, we consider d copies of the above triangle, one for each j.We will write A as a union of sets with the t-conditions and one Cartesian condition corresponding to a specific square in each of the triangles.
The collection of squares on a subdiagonal all have the same size and are labeled by binary sequences of the same length.To each subdiagonal, we can associate the q-value q = (the length of the binary sequences on the subdiagonal) − 1.
The subdiagonals with q-values 0 and 1 are shown in Figure 10.
Let σ = (σ j ) d j=1 be a d-tuple of binary sequences, where the length of σ j is |σ j | = q j ∈ {0, • • • , p − 1}.As demonstrated in Figure 11, the coordinates of σ pick out a specific square in each of the d triangles, (σ j is a binary sequence that labels a square in triangle j).
The length of σ j , q j , is the q-value for the subdiagonal that contains the square labeled by σ j .The coordinate (z(b α(j) ), z(b β(j) )) is in the square labeled by σ j if z(b α(j) ) = σ j 0 * and z(b β(j) ) = σ j 1 * .
For a given σ = (σ j ) d j=1 , we can define A σ, which collects all the choices of 2d-tuples of b i 's that satisfy the t-conditions and for each j satisfy the jth z-condition inside the square σ j .If we let q = (q j ) d j=1 ∈ {0, • • • , p − 1} d , we can consider all σ's so that the jth coordinate in σ has length equal to the jth entry in q, or |σ j | = q j .Then for we can define (2) A q = σ:∀j,|σ j |=q j A σ, which collects all the choices of b i that satisfy the t-conditions and satisfy the jth z-condition inside the diagonal q j .Finally, collecting up all possible A q's gathers every possible desired choice of b i 's that satisfy the t-conditions and the z-conditions, which is the desired set A, In essence, we break A into pieces by specifying that the z-condition must be satisfied on certain diagonals, the sets A q. Then we further break down A q by specifying that the z-condition must be satisfied in specific squares within the diagonals q, the sets A σ.
To compute the size of these sets, first notice from Equation 1 that A σ can be written as the set N from Lemma 4.1 with the sets B i replaced by subsets B ′ i ⊆ B i , where and where j ∈ {1, . . ., d} is such that either α(j) = i or β(j) = i (exactly one such j exists and exactly one of the conditions is met as im(α) ∪ im(β) = {1, . . ., 2d}).We are given that z| B i is injective, so |z(B i )| = |B i | ∼ L ∼ 2 p .The elements of z(B i ) are binary sequences of length p.In the new subset z(B ′ i ), we are constraining the first |σ j | + 1 = q j + 1 entries of the sequences, so there are p − (q j + 1) free digits in each element of z(B ′ i ).With this, we can approximate the size of B ′ i , 2 p 2 q j +1 ∼ 2 p 2 q j ∼ L 2 q j ≤ L 2 min(q j ) .
Using Lemma 4.1 we can compute |A σ| in time ∼ max |B ′ i | ∼ L 2 min(q j ) .In Equation 2, A q is written as a union of A σ's where there are 2 q i possible choices for σ.So, |A q| can be computed in time ∼ 2 q i L 2 min(q j ) = 2 ′ q i L, where ′ denotes "sum with the smallest summand omitted".The worst case is when in q = (q j ) d j=1 all but one of the entries are p − 1 and one (the one omitted in ′ ) is unconstrained, and in that case the complexity is Lastly, from Equation 3, A is the union of A q's where the number of choices for q is p d ∼ (log 2 L) d ∼ 1.So up to ∼, we can compute |A| with at most the complexity of the most expensive |A q|, which is ∼ L d .□ On behalf of all authors, the corresponding author states that there is no conflict of interest.

Figure 1 .
Figure 1.(A) A planar diagram of a knot in a pancake (knot diagram by Piccirillo [Pic20]).(B) A yarn ball.

1. 3 .
Computational complexities of knot invariants.We use the notation C ζ (3D, V ) and C ζ (2D, n) to denote the asymptotic time complexities of computing an invariant ζ via different dimensional methods (3D or 2D) and sizes of input.Definition 1.3.Let ζ be a knot invariant.The worst-case complexity of computing ζ on a knot given by a planar diagram with n crossings is denoted by

Figure 3 .
Figure 3. Two examples of grid knots.The left grid knot has L = 3 and 64 labeled arcs, and the right has L = 5 and 216 labeled arcs.

Figure 4 .
Figure 4.The grid in (B) shows a slightly askew top down view of the grid from (A). (C) highlights two crossing fields, F 1 and F 2 , of a grid.

Figure 5 .
Figure5.The 8 crossing types, where "/" strands are green and "\" are red.For later use we label these crossings x 1 through x 8 .

Figure 6 .Figure 7 .
Figure6.On the left is a portion of a grid knot passing through a crossing field where the green strands cross over the red strands.On the right, we show an example of the algorithm to count the number of crossings in this crossing field.
φ d : {knot diagrams} → GD d be the map that sends a knot diagram to the sum of all of the subdiagrams of its Gauss diagram which have at most d arrows.A Gauss diagram with n arrows has d i=1 n i subdiagrams with d or fewer arrows.Because n i ∼ n i , a Gauss diagram with n arrows has d i=1 n i ∼ d i=1 n i ∼ n d subdiagrams with d or fewer arrows.So φ d evaluated at a knot diagram with n crossings will be a sum of ∼ n d subdiagrams.The map φ d is not an invariant of knots, but, every finite type invariant factors through φ d , as described in the following theorem.Theorem 3.1 (Goussarov-Polyak-Viro [GPV00], see also [Rou]).A knot invariant ζ is of type d if and only if there is a linear functional ω on GD d such that ζ = ω • φ d .A corollary of Theorem 3.1 is that any type d invariant can be computed from an n-crossing planar diagram D in the time that it takes to inspect all n d size d subdiagrams of D for the purpose of computing φ d : d .By definition, φ d (K) = c D D where D ranges over all possible Gauss diagrams with at most d arrows, and c D is the number of times D occurs as a subdiagram in the Gauss diagram for K.The diagram D has arrows decorated with a ± sign corresponding to ± crossings in K.In a grid knot, there are 8 different realizations of oriented crossings depending on the colorings of the strands, which are shown in Figure 5.To compute the coefficient c D , we need to count the number of times D occurs as a subdiagram of K. Since K is a grid knot, we will subdivide this count by further specifying what type of ± crossing is associated to each ± arrow in D. To do this, we need to consider a more detailed labeling of Gauss diagrams.Let LGD d = ⟨Labeled Gauss Diagrams⟩ d be the space of Gauss diagrams with at most d arrows where each arrow is decorated with a label in {x 1 , • • • , x 8 }.These labels will denote the crossing type of an arrow.LGD d is large but finite dimensional, and for each diagram D ∈ GD d with ℓ arrows, there are 8 ℓ related diagrams D χ ∈ LGD d where χ ∈ {x 1 , • • • , x 8 } ℓ is a sequence specifying the labelling of the arrows of D χ .Thus, c D can be computed by c D = χ c Dχ where χ ranges over all sequences in {x 1 , • • • x 8 } ℓ .The coefficient c Dχ is the number of times D χ occurs as a subdiagram of K where an arrow j in D χ with label χ j corresponds to a crossing in K of type χ j .

Figure 8 .
Figure 8.An example of a labeled Gauss diagram with d = 2.