Connected components of meanders: I. Bi-rainbow meanders

Closed meanders are planar configurations of one or several disjoint closed Jordan curves intersecting a given line or curve transversely. They arise as shooting curves of parabolic PDEs in one space dimension, as trajectories of Cartesian billiards, and as representations of elements of Temperley-Lieb algebras. Given the configuration of intersections, for example as a permutation or an arc collection, the number of Jordan curves is unknown and needs to be determined. We address this question in the special case of bi-rainbow meanders, which are given as non-branched families (rainbows) of nested arcs. Easily obtainable results for small bi-rainbow meanders containing up to four families suggest an expression of the number of curves by the greatest common divisor (gcd) of polynomials in the sizes of the rainbow families. We prove however, that this is not the case. In fact, the number of connected components of bi-rainbow meanders with more than four families cannot be expressed as the gcd of polynomials in the sizes of the rainbows. On the other hand, we provide a complexity analysis of nose-retraction algorithms. They determine the number of connected components of arbitrary bi-rainbow meanders in logarithmic time. In fact, the nose-retraction algorithms resemble the Euclidean algorithm, which is used to determine the gcd, in structure and complexity. Looking for a closed formula of the number of connected components, the nose-retraction algorithm is as good as a gcd-formula and therefore as good as we can possibly expect.


Introduction
Meander curves in the plane emerge as shooting curves of parabolic PDEs in one space dimension [FR99], as trajectories of Cartesian billiards [FC12], and as representations of elements of Temperley-Lieb algebras [DGG97].
In general, we regard closed meanders as the pattern created by one or several disjoint closed Jordan curves in the plane as they intersect a given line transversely. The pattern of intersections remains the same when we deform the curves into collections of arcs with endpoints on the horizontal axis, see figure 2.1.
They induce a permutation on the set of intersection points with the horizontal axis. Starting from the permutation, the inverse problem raises two questions: First, is a given permutation a meander permutation, i.e. is it generated by a meander? Second, if yes, is it generated by a single curve, or more generally, of how many curves is the meander composed of?
After this partly negative result, we could look for more complicated formulae. Instead of that, we shall shift our viewpoint a little bit. We argue, that the gcd is an abbreviation for the Euclidean algorithm rather than an "explicit" expression. The Euclidean algorithm has logarithmic complexity: It requires O(log α 1 + log α 2 ) steps to determine gcd(α 1 , α 2 ). Conversely, any formula for the number Z of connected components also provides a formula for the gcd. Therefore, whatever "closed" formula we find, it cannot be of smaller complexity. In section 6 we provide algorithms which calculate the number of connected component by nose retractions, which we introduce in section 4. They have a structure very similar to the Euclidean algorithm. They also have the same logarithmic complexity. Although the search for exact gcd expressions might be futile, we still find a gcd-like interpretation of the number of connected components of meanders.
We start with one or several disjoint closed Jordan curves in the plane, intersected by a given line -without loss of generality the horizontal axis. By homotopic deformations, without introduction or removal of intersections, the curve can be represented by collections of arcs above and below the horizontal axis. Both collections have the same number α of disjoint arcs and hit the axis in the same 2α points {1, . . . , 2α}, see figure 2.1. There are now several possibilities to represent a meander.
Necessarily, both π and π must interchange odd and even numbers, be the cyclic permutation of the 2α intersection points with the axis. Then a product π / of α disjoint transpositions represents a disjoint arc collection if, and only if, the permutation π / σ has exactly α + 1 (disjoint) cycles.
Proof. Start with a disjoint arc collection. Take the graph with the v := 2α vertices {1, . . . , 2α}. The e := 3α − 1 edges are given by the α arcs of the collection together with the 2α − 1 edges {(1, 2), . . . , (2α − 1, 2α)} on the axis. Each cycle of π / σ corresponds to the oriented boundary of a face. By Euler's formula, the number of faces f of a (planar) graph is given by f = e − v + 2. Therefore, there must be exactly α + 1 cycles. Now start with an arbitrary arc collection. If π / σ has a fixed point then this fixed point belongs to an arc connecting the neighbouring points , + 1. (The points 2α and 1 are also neighbours in this sense.) This arc can be removed, decreasing α and the number of cycles by one and keeping the structure of the remaining arcs (including their intersections) and of the remaining cycles of π / σ. If π / σ does not have a fixed point then all cycles have length at least 2. Therefore there can be at most α cycles, and the arc collection is not disjoint due to the first argument.
For non-disjoint initial arc collections π / , the iterative removal of fixed points of π / σ must stop earlier: at an arc collectionπ / such thatπ / σ has no fixed points. The number of cycles of π / σ is therefore less than or equal to α.

...as a single meander permutation
The two products of transpositions which we used in the previous section both interchange odd and even numbers, see (2.2). Therefore, we can combine them into a single permutation The cycles of this permutation directly correspond to the closed curves of the meander. We find: Proposition 2.2 The number of connected components, i.e. the number of closed Jordan curves, of a meander equals the number of cycles of the associated meander permutation π . Additionally, the number of cycles of π π is twice the number of connected components.

...as a shooting permutation
In [Roc91,FR99] meander curves are found as shooting curves of scalar reaction-advectiondiffusion equations, They are used to describe the global attractors of these systems.
Indeed, the u-axis {u x | x=0 = 0}, corresponding to a Neumann boundary condition on the left boundary, is propagated by to a curve in the (u, u x )-plane at the right boundary x = L. In particular, intersections of this curve with the horizontal axis yield stationary solutions of (2.6) with Neumann boundary conditions.
To facilitate its application in this context, the meander is described by a permutation π such that (k, π(k)) are the right and left boundary values of the stationary solutions of the PDE. In fact, the meander is connected by construction, i.e. consists of only one Jordan curve. It is originally open, going to ±∞ for large |u|, but can be artificially closed. The permutation used in [Roc91] yields with the cyclic permutation σ as in (2.3). The shooting permutation π maps the enumeration of intersections along the horizontal axis onto the enumeration along the shooting curve, see figure 2.2 for an illustration of an artificially closed shooting curve and [FR99,FR09] for recent results on attractors of (2.6).

...as a (condensed) bracket expression
When we replace each arc by a pair of brackets, with the opening bracket at the left end and the closing bracket at the right end of the arc, we find corresponding balanced bracket expressions. The example in figure 2. k representing consecutive closing brackets alias right ends of arcs. Zero entries could be allowed but can always be removed. The example in figure 2.1 then reads ((3, 2), (2, 3)) ((2, 1), (1, 2), (2, 2)) .
(2.10) On the other hand, each bracket expression represents a disjoint arc collection provided Indeed, the arcs given by matching brackets are automatically disjoint.
Note that this representation as condensed bracket expression is particularly useful for arc collections which contain large families of non-branched nested arcs.

...as a cleaved rainbow meander
We are interested in the number of connected components, i.e. closed curves, of the meander. This number remains the same if we "simplify" the lower arc collection of the meander by flipping it to the upper part. More precisely, we rotate the lower arc collection around a point on the horizontal axis to the right of the meander, see figure 2.3. This operation doubles the number of intersection points with the horizontal axis but replaces the lower arc collection by a single non-branched family of nested arcs -a rainbow family.
In [DGG97], a meander is called a rainbow meander if the lower arcs form a single rainbow family, i.e. are all nested. A meander is called cleaved if none of the upper arcs connects a point 1 ≤ ≤ α on the left half to a point α <˜ ≤ 2α on the right half of the horizontal axis, that is if the upper arc collection is split at the midpoint. The flip, described above, then results in a cleaved rainbow meander.

Definition 2.3 (Meander)
We identify a meander with the condensed bracket expression of its upper arc collection (after the flip, for non-rainbow meanders) and use the notation satisfying (2.11).
Note that a given n-tuple (2.14) of pairs of positive integers represents a flipped meander if, and only if, it is cleaved: for an appropriate k. Otherwise, the inverse flip would create a meander curve with "overhanging" arcs from the upper to the lower side of the axis. Such meanders can be interpreted as the intersection pattern of closed Jordan curves with a half line instead of a line. See again [DGG97], where this viewpoint is further developed.

...as an element of a Temperley-Lieb algebra
The multiplicative generators e 0 = 1, e 1 , . . . , e α−1 of a Temperley-Lieb algebra T L α (q) [TL71] obey the relations (2.16) They can be visualized as strand diagrams, see figure 2.4. Then, the strand diagram of a general product e 1 · · · e n is given as the concatenation of the individual strand diagrams of e 1 , . . . , e n . The properties (2.16) allow isotopic transformations of the strand diagrams. Possible islands, i.e. closed Jordan curves in the strand diagram, can be removed and then appear as a pre-factor q due to (2.16a). Relations (2.16) can be used to define a basis of reduced elements written as pure products e 1 · · · e n without islands.
A reduced element e 1 · · · e n becomes a rainbow meander when we connect the left and right vertical boundaries of the strand diagram by a rainbow family. This closure is illustrated in figure 2.5, where we again obtain the meander example (2.13) of figure 2.3. The horizontal line of the meander corresponds to the left and right boundaries of the strand diagram of the Temperley-Lieb element, glued at their bottom ends.
The trace tr(e) is defined as a linear function on T L α (q). It plays a crucial role in defining further operators on the Temperley-Lieb algebra. On products e = e 1 · · · e n the trace is given by where Z(e) is the number of connected components of the strand diagram with identified endpoints of the same height in the left and right boundary. Without islands, this coincides with the number of Jordan curves in the associated meander. The ring element q is the parameter of the Temperley-Lieb algebra. See [DGG97] for further background on this correspondence.  Z + 1 2 } and hit the boundary polygon in half-integer midpoints Z × (Z + 1 2 ) ∪ (Z + 1 2 ) × Z with the standard reflection rule. See figure 2.6 for an illustration.

...as a Cartesian billiard
In [FC12] the close relation of Cartesian billiards and meanders has been studied. If the boundary of the billiard region is a single curve without self intersections (or, more generally, of self intersection only at integer lattice points -removable by making the corners of the boundary polygon round) then the billiard trajectories correspond to meander curves. Indeed, we take any consecutive enumeration of the half integer midpoints along the billiard boundary. They represent the intersection points of the meander with the horizontal line. The two families of parallel pieces of the billiard trajectories represent, respectively, the upper and lower arcs of the meander. In particular, the closed trajectories of the Cartesian billiard are mapped onto the closed Jordan curves of the meander.
Conversely, a cleaved rainbow meander M((α can be easily represented by a Cartesian billiard. Indeed, we construct the billiard boundary by starting at the origin and attaching a horizontal or vertical unit interval for each of the 2α upper brackets of our meander representation: On the first half, i.e. for the first α brackets, we go up for opening brackets and right for closing brackets. Due to condition (2.15), we arrive at the point (α/2, α/2), and stay above the diagonal x = y. On the second half, i.e. for the last α brackets, we go down for opening brackets and left for closing brackets. We stay below the diagonal x = y and arrive at the origin. matching brackets on the same side of the midpoint, we do the same as before. For pairs of matching brackets on opposite sides of the midpoint, we switch the rule for the bracket closer to the midpoint. (We must exclude the case of brackets of the same distance to the midpoint, which create a circle.) If the opening bracket is closer to the midpoint, we go right for the opening and left for the matching closing bracket, switching the former rule for opening brackets of the first half. If the closing bracket is closer to the midpoint, we go up for the opening and down for the closing bracket, switching the former rule for closing brackets of the second half. This results in a closed billiard boundary without self intersections (except, possibly, integer-lattice touching points which can be removed by making the corners round), provided the original meander is circle-free, i.e. has no closed curve consisting of only one upper and one lower arc. See [FC12] for a complete proof.

Bi-rainbow meanders
We have already called a single non-branched family of nested arcs a rainbow family, and a meander with a single lower rainbow family a rainbow meander.
If a meander consists only of rainbow families, that is if also the upper arc collection consists only of non-branched families of nested arcs, then we call the meander a birainbow meander, see figure 2.7.

Definition 2.4 (Bi-rainbow meander) A bi-rainbow meander is a meander
(2.17) consisting of α = n =1 α upper arcs in n rainbow families and one lower rainbow family of α nested arcs.
Bi-rainbow meanders -or rather their collapsed variants introduced in section 3represent the structure of seaweed algebras [DK00,CMW12]. Here, the number of connected components is related to the index of the associated seaweed algebra. In [FC12,CMW12], the question is raised, how to compute the number of connected components, i.e. closed curves, (2.18) of a bi-rainbow meander. In fact the easy expressions Z(α 1 , α 2 ) = gcd(α 1 , α 2 ), Z(α 1 , α 2 , α 3 ) = gcd(α 1 + α 2 , α 2 + α 3 ), see (6.1), in terms of the greatest common divisors provoked the call for a general "closed" formula. This has also been the initial purpose of our investigation.

Collapsed meanders
In this section, we introduce the collapse of a meander. We start with a bi-rainbow meander RM = RM(α 1 , . . . , α n ), drawn as arc collections in the plane, see figure 2.7. Above and below the horizontal axis, the meander splits the half plane into connected components. Coming from infinity, we colour each second component black: If a path in the half plane from infinity into the component crosses an odd number of arcs, then we colour this component. The coloured components hit the horizontal axis in the intervals [2 − 1, 2 ], > 1. In particular, the coloured components above and below the horizontal axis match. Furthermore, each arc bounds exactly one coloured component.
There are two types of coloured components. Most coloured components are "thickened arcs" bounded by two (neighbouring) arcs of the same rainbow family and two intervals on the axis. The only exceptions are the innermost components of rainbow families with an odd number of arcs: they are half disks bounded by an arc and an interval on the axis. See figure 3.1 for an illustration.
Definition 3.1 (Collapsed bi-rainbow meander) The collapsed bi-rainbow meander, denoted by CRM = CRM(α 1 , . . . , α n ), arises when we collapse pairs of arcs of the birainbow meander RM(α 1 , . . . , α n ) to single arcs, that is when we collapse each coloured component, described above, into an arc or a point. The value α is the number of arcs in the -th upper family of RM and the number of intersections with the axis in the -th upper family of CRM.
The collapsed bi-rainbow meander is again composed of several rainbow arc collections above and a single rainbow arc collection below the axis. However, if α is odd, then the innermost "arc" of this upper rainbow collection is a single point, which we call semiisolated. Similarly, if α = n =1 α is odd then the innermost "arc" of the lower rainbow collection is a semi-isolated point.
Combining the arc collections of CRM above and below the axis, we find again Jordan curves. These curves can either be closed cycles or open paths ending in semiisolated points. If α = 2 m−1 =1 α + α m is odd, then the lower semi-isolated point coincides with the upper semi-isolated point of the m-th rainbow family and becomes an isolated point of the collapsed bi-rainbow meander. We consider such an isolated point to be a path. (3.1) Proof. We reverse the collapse from RM to CRM. This replaces the curves of CRM by "thick" curves which are non-intersecting domains in the plain. The boundary curves of these domains are the Jordan curves of the original bi-rainbow meander RM. A thickened path is a simply-connected domain, its boundary a single Jordan curve. A thickened cycle is a deformed ring domain, its boundary consists of two Jordan curves.
Note in particular the special case of an isolated point of CRM. Its "thick" counterpart is a disk bounded by a single Jordan curve. Indeed, an isolated point is created by the innermost arc of an upper family matching the innermost arc of the lower family and thus forming a Jordan curve.
Let us count again the number of paths of the collapsed bi-rainbow meander. Each path has two endpoints. These endpoints must be semi-isolated points of the upper or lower arc collections. Semi-isolated points are created by the innermost arcs of odd rainbow families. We find:  where 2 Z path is the number of odd components of (α 1 , . . . , α n , α), α = n =1 α .
Note that α is odd if, and only if, the number of odd entries among (α 1 , . . . , α n ) is odd. Thus, the number of odd components of (α 1 , . . . , α n , α) is always even.
General meanders can also be collapsed in a similar fashion. The resulting curves, however, will in general be branched. See figure 3.2 for the collapse of our example (2.13). The connected components of the collapsed meander must then be counted by the number of components into which the plane is split by the branched curve. We obtain a result similar to theorem 3.2: Theorem 3.5 The number Z((α A similar construction is used in [CJ03] to relate meanders and their Temperley-Lieb counterparts to planar partitions. In fact, its inverse is used to represent a planar partitions by a Temperley-Lieb algebra. Theorem 3.5 is found in the form In other words, the number of Jordan curves of the meander equals the number of coloured and bounded uncoloured regions.

Nose retractions of bi-rainbow meanders
Let RM = (α 1 , . . . , α n ) be again an arbitrary bi-rainbow meander with n rainbow families of given numbers of arcs above and one rainbow of α = n k=1 α k arcs below the horizontal line, see figure 2.7. In this section, we discuss deformations of the meander RM which result again in a bi-rainbow meander with the same number Z(RM) = Z(α 1 , . . . , α n ) of connected components. The general idea is to retract parts of upper rainbow families, which we call noses, through the horizontal axis.
Note, how the retraction of a single arc through the horizontal axis removes two intersection points. In the PDE application of section 2.3, this corresponds to a saddlenode bifurcation in which the associated stationary solutions of the PDE disappear.
In case (d), 2α 1 ≤ α n , we retract the full first (leftmost) upper rainbow family of size α 1 , as shown in figure 4.1a. We hit the right half of the last (rightmost) upper rainbow family and retract further until the retracted nose of size α 1 arrives left of the remaining α n − 2α 1 arcs of the last rainbow family. In the boundary case (c), 2α 1 = α n , nothing remains of last rainbow family, see figure 4.1b.
In case (b), α 1 < α n < 2α 1 , we retract only the inner part of the first rainbow family, such that we just hit the innermost arc of the last rainbow family, as shown in figure 4.1c. Thereby, after retraction, the last rainbow family will remain a (non-branched) rainbow family. To hit the innermost arc, the retracted nose must consist of α n − α 1 arcs. Therefore, α 1 −(α n −α 1 ) = 2α 1 −α n arcs of the first rainbow family and α n −(α n −α 1 ) = α 1 arcs of the last rainbow family remain.
In terms of Cartesian billiards, section 2.7, rainbow families which do not encompass the midpoint are represented as triangles attached to the diagonal. Cases (a) and (c) . . .  In case (d), however, we need α 2 > α n − 2α 1 for the second square to fit inside the billiard domain; otherwise, the procedure fails. The Cartesian billiard benefits at this point from the relation to meander curves, where the nose retraction is always possible.

· · ·
We already see that this lemma provides a strict reduction of the meander. Therefore, its iteration will determine the number of connected components after finitely many steps. In section 6, we will improve the case 2α 1 < α n to find an algorithm of logarithmic complexity.
Instead of retracting the outer noses, as in the lemma above, we now want to retract an inner nose. The middle rainbow turns out to be a particular useful choice. To determine the middle upper rainbow family, we define L( ) := α 1 + α 2 + · · · + α −1 , R( ) := α +1 + · · · + α n , For later reference, we note  Proof. If L * = R * , then the middle family forms m * closed cycles, as each arc of the family matches an arc of the lower family.
Otherwise, we retract the inner part of the m * -th upper rainbow family, such that we just hit the innermost arc of the lower rainbow family, as in figure 4.3. To achieve this, the retracted nose must consist of |L * − R * | arcs. Then, α m * − |L * − R * | arcs remain in the middle upper rainbow family. The lower family remains a (non-branched) rainbow family.
In the special case |L * − R * | = α m * , this procedure retracts the full m * -th rainbow family. In fact, in this case, R * = α/2 and the midpoint lies between the m * -th and its right neighbouring family. Either of both families could be removed.
We can again try to rephrase the inner nose retraction in terms of Cartesian billiards, section 2.7. Note, that the middle rainbow m * contains the upper arcs which encompass the midpoint. It is the only rainbow family which is not represented by a triangle over the diagonal. We find simple cuts of single squares, see figure 4.4. Cases (b) and (c) require, however, that the new middle family is the old one or a direct neighbour. Otherwise, i.e. if the neighbouring family is too small, there is no full square available, as seen in the last picture of figure 4.4. Again, the meander view point is the preferred one.
Before we show that there do not exist similar expressions of Z for n ≥ 4 in theorem 5.3, we establish a particular family of examples and a scaling property of Z in the following two preparatory lemmata. This proves the claim with the above base clauseñ = 0.  We are now well prepared to prove the theorem claimed in the introduction: Theorem 5.3 Let n ≥ 4 be given. Then there do not exist homogeneous polynomials f 1 , f 2 ∈ Z[x 1 , . . . , x n ] of arbitrary degree with integer coefficients such that the number of connected components Z(α 1 , . . . , α n ) of every bi-rainbow meander RM(α 1 , . . . , α n ) is given by the gcd (f 1 (α 1 , . . . , α n ), f 2 (α 1 , . . . , α n )). In other words: to every choice of polynomials f 1 , f 2 , we find a counterexample.
3. Find conditions on the parity of the coefficients of f 1 , f 2 . 4. Show the contradiction by the pigeonhole principle.
This is a contradiction. Therefore, d 2 = 1 as claimed.
Step 3. [Conditions on the parity of the coefficients of f j .] Let be the homogeneous polynomials of degree one. From corollary 3.3 we know that Z(ᾱ) is odd for arbitraryᾱ = (α 1 , . . . , α n ) with exactly one or two odd components. The parity (mod 2) of assumption (5.4) applied to bi-rainbow meanders with exactly one odd component α yields 1 ≡ gcd(f 1, , f 2, ) (mod 2).
If n ≥ 4 then one of the three choices must appear more than once, say at k and . But this violates the second condition of (5.5). This is the final contradiction to the initial assumption and proves the impossibility of a gcd-formula (5.4).

Euclidean-like algorithms
Nose retractions, as introduced in section 4, have been used before to establish finite algorithms on meander curves [CMW12]. Here, however, we will improve the nose retractions (4.1) and (4.6) to establish rigorous bounds on the complexity of the resulting algorithms. This will show a striking similarity to the calculation of the greatest common divisor by the Euclidean algorithm.
Proof. The proof is easily done by induction over α = α k using either nose retraction (4.1) or (4.6).
Note that the greatest common divisor is an abbreviation for the Euclidean algorithm: gcd(a 1 , a 2 ) = gcd(a 2 , a 1 ) = a 1 , a 1 = a 2 , gcd(a 1 , R(a 2 , a 1 )) , a 1 < a 2 . (6.2) Here, R(a 2 , a 1 ) denotes the remainder of the integer division a 2 /a 1 . This algorithm stops after O(log a 1 + log a 2 ) steps. Indeed, R(a 2 , a 1 ) < a 2 /2. The number of bits needed to encode the problem is strictly decreased in each step. Here, we assume the elementary operations of (6.2) to be of complexity O(1). Complexity of arithmetic of large integers could be considered but is not our focus here.
Turning back to the nose-retraction algorithm, denote log α the number of bits needed to encode the bi-rainbow meander RM(α 1 , . . . , α n ). We want to improve the nose retractions (4.1) and (4.6) to decrease b.
Proof. The validity of the algorithm follows directly from (4.1) of lemma 4.1 and the observations (6.3, 6.4) above. Note the special case (f), which is case (g) with zero remainder.
Cases (b,c,d,f,g) reduce the number b of bits. Case (a) cannot be applied twice in succession, in fact it could be replaced by symmetric copies of (c-g). Finally, case (e) can be applied at most (n − 2) times in succession. This yields the claimed complexity of the algorithm.
Although we have found an algorithm of similar complexity than the Euclidean algorithm, the number of cases is quite large. The inner nose retraction (4.6) turns out to be more beautiful. Proof. The validity of the algorithm follows again by iteration of (4.6) of lemma 4.2. Indeed, as long as α m * after application of (4.6)(c) is not smaller than |L * − R * |, the m * -th family remains the middle one. Furthermore, the values L * and R * do not change. Iteration yields case (c) of (6.6) with the special case (b) of zero remainder.
All cases of (6.6) reduce the number b of bits. However, the values m * , L * , R * need to be computed in every step. Together, we again find the bound O(b) O(n) on the complexity of the algorithm.
For rainbow families α k of similar size, the update of m * , L * , R * can be done starting from the old values. The old and new midpoints should then only be O(1) apart. This is similar to theorem 6.2 where the factor O(n) is due to the case of α n very large with respect to all the other families.
The resulting complexity is therefore expected to be rather close to O(b) for "typical" bi-rainbow meanders.