Abstract

An algorithm for generating a family of alternating knots (which are described by means of a chain code) is presented. The family of alternating knots is represented on the cubic lattice, that is, each alternating knot is composed of constant orthogonal straight-line segments and is described by means of a chain code. This chain code is represented by a numerical string of finite length over a finite alphabet, allowing the usage of formal-language techniques for alternating-knot representation. When an alternating knot is described by a chain, it is possible to obtain its mirroring image in an easy way. Also, we have a compression efficiency for representing alternating knots, because chain codes preserve information and allow a considerable data reduction.

1. Introduction

In 1993, Livingston [1] stated that β€œknot theory remains a lively topic today. Many of the basic questions, some dating to Tailt’s first paper in the subject, remain open. At the other extreme, the results of recent years promise to provide many new insights’’. Knot theory is a branch of algebraic topology. The three main techniques of knot theory are: geometric techniques, combinatorial methods, and algebraic tools. A knot 𝐾 is a simple closed polygonal curve in three-dimensional Euclidean space β„œ3 [1]. Knots are cataloged in order of increasing complexity. One measure of complexity that is often used is the crossing number, that is, the number of double points in the simplest planar projection of the knot. There is only one knot with crossing number of three (ignoring mirror reflections) the trefoil. The figure-eight knot is the only knot with a crossing number of four. There are two knots with a crossing number of five, three knots with a crossing number of six, and seven knots with a crossing number of seven. From there on the numbers increase dramatically. There are 12,965 knots with a crossing number of 13 or fewer crossings in a minimal projection. A complex knot is a knot with a huge crossing numbers. Imagine, how many knots are there in an alternating knot which is represented by a complex knot with a crossing number of 1200? This paper deals with complex knots of this order of crossing numbers. 𝑍3 is a more computer-friendly place for generating knots. In β„œ3, every point in space has coordinates drawn from the set of real numbers. Thus, the generation of complex knots in β„œ3 produces a very complex computation. On the other hand, in 𝑍3 all points have integer coordinates. Thus, we represent complex knots which are embedded on the cubic lattice. Complex knots are composed of constant orthogonal straight-line segments and are represented by means of a chain code [2] which produces a numerical string of finite length over a finite alphabet, allowing the usage of grammatical techniques for alternating-knot representation. The above mentioned generates a very simple computation.

Several authors have analyzed knots on the cubic lattice. In 1993, Diao presented the minimal knotted polygons on the cubic lattice [3] and, in 1994, the number of smallest knots on the cubic lattice [4]. van Rensburg and Promislow define the minimal knots in the cubic lattice [5]. Hayes [6] presents the β€œSquare Knots" on the cubic lattice, which are simple closed polygonal curves embedded in 𝑍3. Other interesting theories: Kauffman [7] introduces the β€œVirtual Knot Theory”, which includes general Gauss codes. Nakamura and Rosenfeld [8] define the β€œDigital Knots” which represent an initial effort at the study of the concepts of knottedness and linkedness for digital objects. Complex knots are embedded on the cubic lattice. Thus, these knots are composed of constant orthogonal straight-line segments and are represented by chain coding [2]. In order to have a self-contained paper, Appendix A describes the used chain code. The left-hand side of Figure 1 shows an example of a complex knot in a continuous representation. The right-hand side of Figure 1 illustrates the same knot embedded on the cubic lattice. In the content of this work, knots are represented as ropes. This improves the understanding of the figures.

This paper is organized as follows: Section 2 describes the proposed family of rectangular alternating links. In Section 3, we present some results. Section 4 gives some conclusions. Finally, we present Appendix A which describes the used chain code and Appendix B which presents the program of the proposed algorithm.

The alternating link diagrams of the type illustrated in Figure 2 are used here to construct links like that shown in Figure 1. Each diagram is a set of rectilinear polygons and can be characterized in terms of two positive integers π‘Ž and 𝑏. In what follows we present such a characterization, from which we obtain some properties of the family of polygons, useful to construct an algorithm for generating a chain code representation of the corresponding link.

Let π‘Ž and 𝑏 be integers such that 0<π‘β‰€π‘Ž. Let π‘†π‘Ž be a square on the 2-dimensional integer lattice, with one corner at the origin and another at the point (π‘Ž,π‘Ž). Let π‘…π‘Ž,𝑏 be the rectangle with sides parallel to the diagonals of π‘†π‘Ž, symmetric with respect to the central point of π‘†π‘Ž, and with sides through the points (0,π‘Žβˆ’π‘) and (0,π‘Žβˆ’π‘+1).

The 2(π‘Ž+1) grid nodes lying on the edges of π‘…π‘Ž,𝑏 serve as vertices of a set π’«π‘Ž,𝑏 of rectilinear polygons, each of whose sides is the vertical or horizontal line segment that joins a corresponding pair of nodes. In Figure 2 those vertices appear counterclockwise enumerated from 0 to 2π‘Ž+1, beginning with the node at coordinates (0,π‘Žβˆ’π‘). Accordingly, let π‘‰π‘Ž={0,1,…,2π‘Ž+1} be the set of vertices of π’«π‘Ž,𝑏.

Let π‘£βˆΆπ‘‰π‘Žβ†’π‘‰π‘Ž be the function such that 𝑣(𝑖) is the vertex of π’«π‘Ž,𝑏 vertically opposed to vertex 𝑖. As a consequence of the way the enumeration of the vertices was done, we have that 𝑖+𝑣(𝑖)=2π‘Ž+1. Then, from this equation and defining 𝑛=2(π‘Ž+1), we arrive to𝑣(𝑖)=π‘›βˆ’1βˆ’π‘–.(2.1)

Now, let β„ŽβˆΆπ‘‰π‘Žβ†’π‘‰π‘Ž be the function such that β„Ž(𝑖) is the vertex horizontally opposed to vertex 𝑖. There are two cases: 𝑖+β„Ž(𝑖)=2π‘Žβˆ’2𝑏+1=π‘›βˆ’2π‘βˆ’1, if 𝑖≀2π‘Žβˆ’2𝑏+1, and 𝑖+β„Ž(𝑖)=4π‘Žβˆ’2𝑏+3=2π‘›βˆ’2π‘βˆ’1, otherwise. Taking into account that β„Ž(𝑖)<𝑛, in both cases we obtainβ„Ž(𝑖)=(βˆ’2π‘βˆ’1βˆ’π‘–)mod𝑛.(2.2)

Remark 2.1. (1) The functions 𝑣 and β„Ž are bijections, they are self-inverse, and each one maps odd numbers to even numbers and vice versa.
(2) By the above remark, also the function composition π‘£βˆ˜β„ŽβˆΆπ‘‰π‘Žβ†’π‘‰π‘Ž is bijective, but preserves the parity of its argument.
(3) The functions 𝑣, β„Ž, and π‘£βˆ˜β„Ž, being bijections, are elements of the group π‘†π‘‰π‘Ž of symmetries of π‘‰π‘Ž. In particular, we call attention to βŸ¨π‘£βˆ˜β„ŽβŸ©β€”the cyclic subgroup generated by π‘£βˆ˜β„Ž on π‘†π‘‰π‘Žβ€”and to its (induced) action over π‘‰π‘Ž.
(4) Along any polygon π‘ƒβˆˆπ’«π‘Ž,𝑏, the horizontal sides alternate with the vertical ones. Thus, the consecutive vertices of 𝑃 can be obtained by iterating alternate applications of β„Ž and 𝑣. For example, with π‘Ž=9 and 𝑏=4 (which is the particular case presented in Figure 2), for the polygon through vertex 0, the corresponding iteration produces the (periodic) sequence 0,β„Ž(0),𝑣(β„Ž(0)),β„Ž(𝑣(β„Ž(0))),…(2.3) which has 0,11,8,3,16,15,4,7,12,19(2.4) as a shortest period.
(5) From the first remark, it follows that in sequences like those just presented the elements alternate in parity. So, if π‘ˆ is the set of even (odd) vertices of 𝑃, then β„Ž(π‘ˆ) and 𝑣(π‘ˆ) both are equal to the set of odd (even) vertices of 𝑃.

Now, to count the number of polygons in π’«π‘Ž,𝑏, it is useful to interpret this set as a graph, in the obvious way, and then proceed to count the number of cycles in this graph.

Definition 2.2. Let π‘Ž, 𝑏, π‘‰π‘Ž, 𝑣, and β„Ž, be as above. πΊπ‘Ž,𝑏=(π‘‰π‘Ž,πΈπ‘Ž,𝑏) is the graph with vertex-set π‘‰π‘Ž and edge-set πΈπ‘Ž,𝑏={{𝑖,𝑣(𝑖)}βˆ£π‘–βˆˆπ‘‰π‘Ž}βˆͺ{{𝑖,β„Ž(𝑖)}βˆ£π‘–βˆˆπ‘‰π‘Ž}.
We can see Figure 2 also as a drawing of πΊπ‘Ž,𝑏. Since each vertex is an end point of exactly two edges, πΊπ‘Ž,𝑏 is a regular graph of degree 2. Therefore, every component of πΊπ‘Ž,𝑏 is a cycle [9]. Now we will see how many components have 𝐺 and how long they are.

Lemma 2.3. The graph πΊπ‘Ž,𝑏 defined above is composed of 𝑐=gcd(π‘Ž+1,𝑏) cycles of length 𝑛/𝑐, and all the vertices 0,1,…,π‘βˆ’1 belong to distinct cycles.

Proof. From (2.1) and (2.2) we have that 𝑣(β„Ž(𝑖))=π‘›βˆ’1βˆ’(βˆ’2π‘βˆ’1βˆ’π‘–)mod𝑛=(2𝑏+𝑖)mod𝑛, that is (π‘£βˆ˜β„Ž)(𝑖)=(2𝑏+𝑖)mod𝑛.(2.5) Now, to analyze the action of βŸ¨π‘£βˆ˜β„ŽβŸ© over π‘‰π‘Ž (see Remark 2.1(3)), it is useful the embedding of π‘‰π‘Ž into the additive group β„€/𝑛. From (2.5) it follows that (π‘£βˆ˜β„Ž)π‘ž(0)=π‘ž(2𝑏)mod𝑛, for π‘žβˆˆβ„•. Hence, the orbit of 0 under the action of βŸ¨π‘£βˆ˜β„ŽβŸ© is the (finite) set {π‘ž(2𝑏)modπ‘›βˆ£π‘ž=0,1,2,…} which is the (cyclic) subgroup of β„€/𝑛 generated by 2𝑏. Then, this subgroup has 𝑐′=gcd(𝑛,2𝑏) as its least generator, it is of order 𝑛/𝑐′ [10, Section  6.5-6], and the set {[𝑖]|0≀𝑖<𝑐′} of its 𝑐′ cosets coincide with the set of orbits of βŸ¨π‘£βˆ˜β„ŽβŸ© on β„€/𝑛. But the set of vertices of a cycle of πΊπ‘Ž,𝑏 is equal to the union of two of these orbits (see Remark 2.1(5)). Hence, there are 𝑐=𝑐′/2=gcd(𝑛,2𝑏)/2=gcd(π‘Ž+1,𝑏) cycles in πΊπ‘Ž,𝑏, each one of length 2(𝑛/𝑐′)=𝑛/𝑐. Now, in terms of cosets, the set of vertices of a cycle of πΊπ‘Ž,𝑏 is equal to a union of the form [𝑖]βˆͺ𝑣([𝑖]), with 0≀𝑖<𝑐′. By (2.1), and because π‘›βˆ’1βˆ’π‘– and π‘β€²βˆ’1βˆ’π‘– are in the same coset, we obtain that 𝑣([𝑖][𝑣]=[]=𝑐)=(𝑖)π‘›βˆ’1βˆ’π‘–ξ…žξ€»βˆ’1βˆ’π‘–.(2.6) Therefore, the 𝑐 cycles have, respectively, the following sets of vertices: [𝑖]βˆͺπ‘ξ€Ίξ€·ξ…žξ€Έξ€»βˆ’1βˆ’π‘–,for0≀𝑖<𝑐′2=𝑐.(2.7)

Next, we will define a link β„’π‘Ž,𝑏 for the alternating link diagram π’«π‘Ž,𝑏. Figure 3(a) shows β„’9,4. To begin with, we state some additional observations on Figure 2.

Remark 2.4. (1) There are 𝑏 and π‘Ž+1βˆ’π‘ vertices of π’«π‘Ž,𝑏 in the upper left side and in the lower left side of π‘…π‘Ž,𝑏, respectively. Let 𝑏′=min(𝑏,π‘Ž+1βˆ’π‘).(2.8) Since 𝑐=gcd(π‘Ž+1,𝑏)=gcd(π‘Ž+1,𝑏′)≀𝑏′, the vertices 0,1,…,π‘βˆ’1 lie on the lower left side of π‘…π‘Ž,𝑏.
(2) Let 𝑒 be an edge of a polygon π‘ƒβˆˆπ’«π‘Ž,𝑏. If the end points of 𝑒 lie on parallel sides of π‘…π‘Ž,𝑏, then 𝑒 is of even length 2π‘ξ…ž, otherwise 𝑒 has odd length. Furthermore, 𝑒 has odd length if and only if 𝑒 is at distance 𝑑<π‘ξ…ž from a side of π‘†π‘Ž parallel to 𝑒, and in this case 𝑒 is of length 2𝑑+1. Thus, the lengths of the vertical and horizontal edges through the vertex 𝑖 are, respectively, given by the functions 𝑙𝑣,π‘™β„ŽβˆΆπ‘‰π‘Žβ†’β„• such that 𝑙𝑣(⎧βŽͺ⎨βŽͺβŽ©π‘–)=2𝑗+1,if𝑗<π‘ξ…ž,2𝑙(π‘Žβˆ’π‘—)+1,if𝑗>π‘Žβˆ’π‘β€²,with𝑗=𝑖mod(π‘Ž+1),2𝑏′,otherwise,(2.9)β„Ž(𝑖)=𝑙𝑣(𝑖+𝑏).(2.10) For example, the alternate application of π‘™β„Ž and 𝑙𝑣 to the vertices obtained for the polygon 𝑃 in Remark 2.1(4) gives the following sequence of edge lengths: 8,3,5,7,1,8,3,5,7,1.(2.11)
(3) If 𝑒 has even length, then its adjacent edges lie on distinct semiplanes with respect to the line containing 𝑒, otherwise they are to the same side of such a line.
The link β„’π‘Ž,𝑏 is constructed in such a way that π’«π‘Ž,𝑏 is the projection of β„’π‘Ž,𝑏 on the plane π‘₯=0, under the mapping (π‘₯,𝑦,𝑧)↦(0,𝑦,𝑧). Let πΎπ‘–βˆˆβ„’π‘Ž,𝑏 be the component knot whose projection is the polygon π‘ƒπ‘–βˆˆπ’«π‘Ž,𝑏 trough vertex π‘–βˆˆ{0,1,…,π‘βˆ’1}, with 𝑐 as defined in the preceding lemma. We orient 𝑃𝑖 by departing from 𝑖 to the right, that is, following the cycle 𝑖,β„Ž(𝑖),…,𝑖. The knot 𝐾𝑖 is an axis-aligned polygon whose vertices lie on the planes π‘₯=0 and π‘₯=1/2, with 𝑖 as the starting vertex. In turn, this polygon is a concatenation of β€œsections,’’ which are planar polygonal curves corresponding to the edges of 𝑃𝑖, similar to that shown in Figure 3(b).
The section 𝑠 related to a directed edge 𝑒 is a concatenation of |𝑒| β€œpieces’’ like the three shown in Figure 3(c); 𝑠 begins with a horizontal piece, which belongs either to the plane π‘₯=0 or to the plane π‘₯=1/2 and is followed by |𝑒|βˆ’1 alternate occurrences of the other two pieces. If we split the first piece at its midpoint, 𝑠 can be seen as a directed polygonal composed of line segments of constant length (1/2), as delineated in Figure 4(a) which also shows the code obtained by means of (A.1) for each vertex apart from the first and fourth ones, whose codes 𝑝 and π‘ž remain unknown until we have the placement of 𝑠 along the knot (but π‘žβ‰ 0 since π‘ž labels a right angle). Thus, in formal language terminology, a section is a chain over Ξ£={0,1,2,3,4} of the form either 𝑝0 or 𝑝00π‘ž2(042)⋆, where 𝑝,π‘žβˆˆΞ£ and π‘žβ‰ 0, with the interpretation given in A. Figures 4(b)–4(f) show some configurations that correspond to five of the 20 possible values for the pair (𝑝,π‘ž). Next we will prove that only the first two illustrated cases occur in 𝐾𝑖.

Lemma 2.5. Let 𝑒 be an edge of 𝑃𝑖 and let 𝑠 be the section of 𝐾𝑖 corresponding to 𝑒. Then, 𝑠 has 𝑝=3 or 4, and, if |𝑒|>1, π‘ž=1.

Proof. The proof goes by induction on the position of 𝑠 along 𝐾𝑖. If 𝑠 is the first section of 𝐾𝑖, then its initial point is vertex 𝑖 which, by Remark 2.4(2.1), lies on the lower left side of π‘…π‘Ž,𝑏. Thus, the right angle previous to 𝑖 along 𝐾𝑖 must belong to one of the two configurations shown in Figures 4(b)-4(c), depending on the length 𝑑′ of the edge of 𝑃𝑖 previous to 𝑒; if 𝑑′=1, then 𝑝=4, and if 𝑑′>1, then 𝑝=3. Furthermore, if |𝑒|>1 (thus there is a point for π‘ž in 𝑠), π‘ž=1 in both cases.
Now, suppose by induction that a section 𝑠 satisfies the lemma. We want to show that the section π‘ ξ…žξ…ž next to 𝑠 also satisfies the lemma. Let 𝑠′ be the section previous to 𝑠. The induction hypothesis implies that the configuration for 𝑠′ and 𝑠 must be one of those in Figures 4(b)-4(c), up to a rotation. Suppose |𝑒| is odd; then, as a consequence of Remark 2.4(3), 𝑠′ and π‘ ξ…žξ…ž are to the same side of the plane containing 𝑠 and, since 𝑠 jumps |𝑒|βˆ’1 times between the planes π‘₯=0 and π‘₯=1/2, the end points of 𝑠 lie both in the same of these planes; therefore, the configuration determined by 𝑠 and π‘ ξ…žξ…ž must be also, up to a rotation, one of those shown in Figures 4(b)-4(c). On the other hand, if |𝑒| is even, from the same remark it follows that 𝑠′ and π‘ ξ…žξ…ž are in opposite sides of the plane of 𝑠 and, since now |𝑒|βˆ’1 is odd, the end points of 𝑠 lie one in the plane π‘₯=0 and the other in the plane π‘₯=1/2, facts that lead to the same conclusion obtained in the first case.

Corollary 2.6. Let 𝑒′ and 𝑒 be two successive edges of 𝑃𝑖, of lengths 𝑑′ and 𝑑, respectively. Then the chain code of the section 𝑠 in 𝐾𝑖 corresponding to 𝑒 is given by the following function: πœ…ξ€·π‘‘ξ…žξ€Έ=⎧βŽͺ⎨βŽͺ⎩,𝑑40ifπ‘‘ξ…ž=1,𝑑=1,30ifπ‘‘ξ…ž>1,𝑑=1,40012(042)π‘‘βˆ’2ifπ‘‘ξ…ž=1,𝑑>1,30012(042)π‘‘βˆ’2ifπ‘‘ξ…ž>1,𝑑>1.(2.12)

The following program, written in Haskell language [11, 12], is a computable version of the function πœ…:ξ€·π‘‘π‘ π‘’π‘π‘‘π‘–π‘œπ‘›ξ…žξ€Έ,𝑑=π‘π‘œπ‘›π‘π‘Žπ‘‘ξ€·ξ€·π’πŸπ‘‘ξ…žξ€Έ==1𝐭𝐑𝐞𝐧"40"𝐞π₯𝐬𝐞"30"βˆΆπ‘‘π‘Žπ‘˜π‘’(π‘‘βˆ’1)("012"βˆΆπ‘Ÿπ‘’π‘π‘’π‘Žπ‘‘"042")),(2.13)

For example, section(1,8) evaluates to β€œ40012042042042042042042”. The next function calculates the chain code for 𝐾𝑖:ξ€Ίξ€·π‘‘π‘β„Žπ‘Žπ‘–π‘›π‘–=π‘π‘œπ‘›π‘π‘Žπ‘‘π‘ π‘’π‘π‘‘π‘–π‘œπ‘›ξ…žξ€Έβˆ£ξ€·π‘‘,π‘‘ξ…žξ€Έξ€»,π‘‘βŸ΅π‘ π‘–π‘‘π‘’_π‘™π‘’π‘›π‘”π‘‘β„Ž_π‘π‘Žπ‘–π‘Ÿπ‘ π‘–,(2.14) where 𝑠𝑖𝑑𝑒_π‘™π‘’π‘›π‘”π‘‘β„Ž_π‘π‘Žπ‘–π‘Ÿπ‘ π‘– gives the list of pairs (𝑑′,𝑑) needed to compute the successive sections of 𝐾𝑖. The definitions of these functions, as well as those for 𝑣, β„Ž, 𝑙𝑣, π‘™β„Ž, 𝑛, 𝑐, and 𝑏′, are local to the main function, which computes the list of strings of code for the 𝑐 cycles of the link β„’π‘Ž,𝑏:[[,π‘π‘Žπ‘Ÿπ‘π‘’π‘‘π‘Žπ‘=π‘β„Žπ‘Žπ‘–π‘›π‘–βˆ£π‘–βŸ΅0β€¦π‘βˆ’1]](2.15) The complete definition of this program is presented in Appendix B.

3. Results

In order to probe our proposed method, we present some examples of alternating-knot generation. Figure 5 illustrates an example of an alternating knot of 22Γ—12 (π‘Ž=22, 𝑏=12).

The chain of the alternating knot shown in Figure 5 is as follows:

400120420420420420420420420420420420420420420420420420420420423001204230

012042042042042042042042042042042042042042042042042042300120420420423001

204204204204204204204204204204204204204204204230012042042042042042300120

420420420420420420420420420420420420423001204204204204204204204230012042

042042042042042042042042042042300120420420420420420420420420423001204204

204204204204204204204230012042042042042042042042042042042042300120420420

420420420420423001204204204204204204204204204204204204204230012042042042

042042300120420420420420420420420420420420420420420420423001204204204230

012042042042042042042042042042042042042042042042042042300120423001204204

204204204204204204204204204204204204204204204204204230400120420420420420

420420420420420420420420420420420420420420420423040012042042042042042042

042042042042042042042042042042042042042300120423001204204204204204204204

204204204204204204204204204204230012042042042300120420420420420420420420

420420420420420420420423001204204204204204230012042042042042042042042042

042042042042042300120420420420420420420423001204204204204204204204204204

204204230012042042042042042042042042042300120420420420420420420420420423

001204204204204204204204204204204204230012042042042042042042042300120420

420420420420420420420420420420420423001204204204204204230012042042042042

042042042042042042042042042042042300120420420423001204204204204204204204

204204204204204204204204204204230012042300120420420420420420420420420420

420420420420420420420420420423040012042042042042042042042042042042042042

04204204204204204204204230.

If we replace the chain elements 1 by the chain elements 3 and vice versa in the above-mentioned chain, we obtain the mirroring image [2] of the alternating knot illustrated in Figure 5.

Figure 6 illustrates another example of an alternating knot of 50Γ—25 using the proposed method.

4. Conclusions

We have presented a modest attempt for generating alternating knots which are represented by means of chain coding. The chain-code representation of alternating knots preserves information and allows a considerable data reduction. Also, the mirror images of alternating knots are obtained in an easy way.

Appendices

A. The Chain Code

In order to have a self-contained paper, we summarize the main concepts and definitions of the used chain code. In the content of this paper, we use this chain code to represent complex knots.

Definition A.1. A discrete knot 𝐾𝐷 is the digitalized representation of a knot 𝐾 and is composed of constant orthogonal straight-line segments, whose direction changes are described as a chain.

Definition A.2. A chain 𝐴 is a finite sequence of elements and is represented by 𝐴=π‘Ž1π‘Ž2β‹―π‘Žπ‘›={π‘Žπ‘–βˆΆ1≀𝑖≀𝑛}, where 𝑛 indicates the length of the chain.

The chain elements for a discrete knot are obtained by calculating the relative orthogonal direction changes of the contiguous constant straight-line segments along the knot. There are only five possible orthogonal direction changes [13, 14] for representing any discrete knot. Thus, each discrete knot is represented by a chain of elements. Figure 7(b) illustrates an example of a discrete complex knot.

An element π‘Žπ‘– of a chain, taken from the set {0,1,2,3,4}, labels a vertex of the discrete knot and indicates the orthogonal direction change of the polygonal path in such a vertex. Figure 7(a) summarizes the rules for labeling the vertices: to a straight-angle vertex, a 0 is attached; to a right-angle vertex corresponds one of the other labels, depending on the position of such an angle with respect to the preceding right angle in the polygonal path.

In order to improve the understanding of the chain elements, we have colored the straight-line segments which are defined by their corresponding chain elements. Thus, the straight-line segment defined by the chain element 0 in green, 1 in cyan, 2 in yellow, 3 in magenta, and 4 in red, respectively. This is valid for the web version of the paper; however, the gray-level version of the paper also allows us to understand the above-mentioned notation. Formally, if the consecutive sides of the reference angle have respective directions 𝐛 and 𝐜 (see Figure 7(a)), and the side from the vertex to be labeled has direction 𝐝 (here, by direction we understand a unit vector), then the label or chain element is given by the following function, where Γ— denotes the vector product in ℝ3:⎧βŽͺβŽͺ⎨βŽͺβŽͺβŽ©π‘β„Žπ‘Žπ‘–π‘›_π‘’π‘™π‘’π‘šπ‘’π‘›π‘‘(𝐛,𝐜,𝐝)=0if𝐝=𝐜,(ingreen),1if𝐝=π›Γ—πœ,(incyan),2if𝐝=𝐛,(inyellow),3if𝐝=βˆ’(π›Γ—πœ),(inmagenta),4if𝐝=βˆ’π›,(inred).(A.1)

Thus, the procedure to find the chain of a discrete knot is as follows.(i)Select an arbitrary vertex of the discrete knot as the origin. Also, select a direction for traveling around the discrete knot. Figure 7(b) illustrates the selected origin which is represented by a sphere. Also, the selected direction is to the right.(ii)Compute the chain elements of the discrete knot. Figure 7(b) shows the first element of the chain which corresponds to the element 0. The second element corresponds to the chain element 0, too. The third element corresponds to the chain element 1. Note that when we are traveling around a discrete knot, in order to obtain its chain elements and find zero elements, we need to know what nonzero element (labeling a right angle) was the last one in order to define the next element. Finally, we obtain the following chain:00120420423040012042300120423040012042042304001204230012042304.(A.2)

The main characteristics of this chain code are as follows.(i)It is invariant under translation and rotation. This is due to the fact that only relative orthogonal direction changes are used.(ii) In this code, there are only five possible orthogonal direction changes for representing any discrete knot, this produces a numerical string of finite length over a finite alphabet, allowing the usage of grammatical techniques for complex-knot generation.(iii)Using this code, it is possible to obtain the mirror image of a discrete knot with ease. The chain of the mirror image of a discrete knot is another chain (termed the reflected chain) whose elements 1 are replaced by elements 3 and vice versa. This replacement does not depend on the orthogonal reflecting plane used, it is valid for the three possible orthogonal mirroring planes. We do not prove this, only we illustrate it [13].

A complete review of the above-mentioned code can be found in [2, 13].

B. The Program

Here is the function π‘π‘Žπ‘Ÿπ‘π‘’π‘‘that computes the links presented in Section 2. Let π‘Ž,π‘βˆˆβ„€; if 0<π‘β‰€π‘Ž, (π‘π‘Žπ‘Ÿπ‘π‘’π‘‘π‘Žπ‘) returns the list of chains of code for the knots of β„’π‘Ž,𝑏, otherwise the returned list is empty.

π‘π‘Žπ‘Ÿπ‘π‘’π‘‘π‘Žπ‘=𝐒𝐟0<π‘β‰€π‘Žπ­π‘πžπ§[π‘β„Žπ‘Žπ‘–π‘›π‘–βˆ£π‘–β†[0β€¦π‘βˆ’1]]𝐞π₯𝐬𝐞[]
 where
β€ƒβ€ƒπ‘š=π‘Ž+1;𝑛=2Γ—π‘š;𝑐=π‘”π‘π‘‘π‘šπ‘;π‘ξ…ž=min𝑏(π‘šβˆ’π‘)
  𝑣𝑖=π‘›βˆ’1βˆ’π‘–β€”See (2.1)
β€ƒβ€ƒβ„Žπ‘–=(βˆ’2Γ—π‘βˆ’1βˆ’π‘–)mod𝑛—See (2.2)
β€ƒβ€ƒπ‘™π‘£π‘–βˆ£π‘—<π‘ξ…ž=2×𝑗+1β€”See (2.9)
β€ƒβ€ƒβ€ƒβ€‚βˆ£π‘—>π‘Žβˆ’π‘ξ…ž=2Γ—(π‘Žβˆ’π‘—)+1
β€ƒβ€ƒβ€ƒβ€‚βˆ£otherwise=2Γ—π‘ξ…ž
    where 𝑗=𝑖modeπ‘š
β€ƒβ€ƒπ‘™β„Žπ‘–=𝑙𝑣(𝑖+𝑏)β€”See (2.10)
  𝑐𝑦𝑐𝑙𝑒𝑖=π‘‘π‘Žπ‘˜π‘’(𝑛div𝑐)(π‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’2β„Žπ‘£π‘–)β€”See Remark 2.1(4)
  𝑠𝑖𝑑𝑒_π‘™π‘’π‘›π‘”π‘‘β„Žπ‘ π‘–=π‘šπ‘Žπ‘2π‘™β„Žπ‘™π‘£(𝑐𝑦𝑐𝑙𝑒𝑖)β€”See Remark 2.4(2)
  𝑠𝑖𝑑𝑒_π‘™π‘’π‘›π‘”π‘‘β„Ž_π‘π‘Žπ‘–π‘Ÿπ‘ π‘–=𝑧𝑖𝑝(π‘™π‘Žπ‘ π‘‘π‘‘π‘ βˆΆπ‘‘π‘ )𝑑𝑠
           where𝑑𝑠=𝑠𝑖𝑑𝑒_π‘™π‘’π‘›π‘”π‘‘β„Žπ‘ π‘–
β€ƒβ€ƒπ‘ π‘’π‘π‘‘π‘–π‘œπ‘›(π‘‘ξ…ž,𝑑)=π‘π‘œπ‘›π‘π‘Žπ‘‘((π’πŸπ‘‘ξ…ž==1π­π‘πžπ§β€40"𝐞π₯π¬πžβ€30")β€”See (2.12)
            βˆΆπ‘‘π‘Žπ‘˜π‘’(π‘‘βˆ’1)(”012"βˆΆπ‘Ÿπ‘’π‘π‘’π‘Žπ‘‘β€042"))
β€ƒβ€ƒπ‘β„Žπ‘Žπ‘–π‘›π‘–=π‘π‘œπ‘›π‘π‘Žπ‘‘[π‘ π‘’π‘π‘‘π‘–π‘œπ‘›(π‘‘ξ…ž,𝑑)∣(π‘‘ξ…ž,𝑑)←𝑠𝑖𝑑𝑒_π‘™π‘’π‘›π‘”π‘‘β„Ž_π‘π‘Žπ‘–π‘Ÿπ‘ π‘–]

The functions π‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’2and π‘šπ‘Žπ‘2have definitions similar to those of the standard functions π‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’ and map provided by Haskell. The invocation (π‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’2𝑓𝑔π‘₯) returns the infinite list [π‘₯,𝑓π‘₯,𝑔(𝑓π‘₯),𝑓(𝑔(𝑓π‘₯)),…] of repeated and alternate applications of 𝑓 and 𝑔 to π‘₯:[π‘Ž]π‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’2∢∢(π‘ŽβŸΆπ‘Ž)⟢(π‘ŽβŸΆπ‘Ž)βŸΆπ‘ŽβŸΆπ‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’2𝑓𝑔π‘₯=π‘₯βˆΆπ‘–π‘‘π‘’π‘Ÿπ‘Žπ‘‘π‘’2𝑔𝑓(𝑓π‘₯)(B.1) and (π‘šπ‘Žπ‘2𝑓𝑔[π‘₯0,π‘₯1,π‘₯2,π‘₯3,…]) returns the list [𝑓π‘₯0,𝑔π‘₯1,𝑓π‘₯2,𝑔π‘₯3,…] of alternate applications of 𝑓 and 𝑔 to the successive elements of the list [π‘₯0,π‘₯1,π‘₯2,π‘₯3,…]:[π‘Ž]⟢[𝑏]=π‘šπ‘Žπ‘2∢∢(π‘ŽβŸΆπ‘)⟢(π‘ŽβŸΆπ‘)βŸΆπ‘šπ‘Žπ‘2𝑓𝑔[][]π‘šπ‘Žπ‘2𝑓𝑔(π‘₯∢π‘₯𝑠)=𝑓π‘₯βˆΆπ‘šπ‘Žπ‘2𝑔𝑓π‘₯𝑠.(B.2)

Acknowledgment

The authors wish to express their gratitude to Guillermo Rojas for his help in generating patterns of alternating knots.