Q-system Cluster Algebras, Paths and Total Positivity

We review the solution of the $A_r$ Q-systems in terms of the partition function of paths on a weighted graph, and show that it is possible to modify the graphs and transfer matrices so as to provide an explicit connection to the theory of planar networks introduced in the context of totally positive matrices by Fomin and Zelevinsky.


Introduction
Discrete dynamical systems may take the form of recursion relations over a discrete time variable, describing the evolution of relevant physical quantities. Within this framework, of particular interest are the discrete integrable recursive systems, for which there exist sufficiently many conservation laws or integrals of motion, so that their solutions can be expressed in terms of some initial data. Interesting examples of such systems of non-linear integrable recursion relations arise from matrix models used to generate random surfaces, in the form of discrete Toda-type equations [1,15,20]. More recently, a combinatorial study of intrinsic geometry in random surfaces has also yielded a variety of integrable recursion relations, also related to discrete spatial branching processes [3].
We claim that other fundamental examples are provided by the so-called Q-systems for Lie groups, introduced by Kirillov and Reshetikhin [18] as combinatorial tools for addressing the question of completeness of the Bethe Ansatz states in the diagonalization of the Heisenberg spin chain based on an arbitrary Lie algebra. We proved integrability for these systems in the case of A r in [6]. In the case of other Dynkin diagrams, evidence suggests integrability still holds.
The Q-system with special (singular) initial conditions was originally introduced [18] as the recursion relation satisfied by the characters of special finite-dimensional modules of the Yangian Y (g), the so-called Kirillov-Reshetikhin modules. Remarkably, in the case g = A r , the same recursion relation also appears in other contexts, such as Toda flows in Poisson geometry [13], preprojective algebras [12] and canonical bases [2].
In [6], we used methods from statistical mechanics to study the solutions of the Q-system associated with the Lie algebra A r , for fixed but arbitrary initial conditions. Our approach starts with the explicit construction of the conserved quantities of the system, which appear as coefficients in a linear recursion relation satisfied by Q-system solutions. These are finally used to reformulate the solutions in terms of partition functions for weighted paths on graphs, the weights being entirely expressed in terms of the initial data.
Note that there is a choice of various sets of 2r variables which constitute an initial condition fixing the solutions of the Q-system recursion relation, a choice parametrized by Motzkin paths Date: July 21, 2022. 1 of length r. This set of initial variables determines the graphs and weights which solve the problem. This is the key point addressed in [6], and is related to the formulation as a cluster algebra.
Cluster algebras [9] are another form of discrete dynamical systems. They describe a specific type of evolution, called mutation, of a set of variables or cluster seed. Mutations are rational, subtraction-free expressions. This type of structure has proved to be very universal, and arises in many different mathematical contexts, such as total positivity [7,8], quiver categories [17], Teichmüller space geometry [11], Somos-type sequences [10], etc.
Cluster algebras have the property that any cluster variable is expressible as a Laurent polynomial of the variables in any other cluster in the algebra. It is conjectured that these Laurent polynomials have nonnegative coefficients [9] (the positivity conjecture). This property has only been proved in a few context-specific cases so far. The Q-system solutions for A r are also known to be cluster variables in the cluster algebra introduced in [16] (a result later generalized to all simple Lie algebras in [5]). In [6], our interpretation of the solutions in terms of partition functions of paths on graphs with positive weights gave a proof of the positivity conjecture in this case. Moreover, we obtained explicit expressions, in the form of finite continued fractions, for these cluster variables. We review our results in the first part of this paper.
Of particular interest to us is the connection of cluster algebras to total positivity. Fomin and Zelevinsky [7] expressed a parametrization of totally positive matrices in terms of electrical networks, and established total positivity criteria based on relations between matrix minors, organized into a cluster algebra structure. In this paper we show the explicit connection of their construction to the Q-system solutions.
In this paper, we review the methods and results of [6] in a more compact and hopefully accessible form. We first apply this method to the case of rank 2 affine cluster algebras, studied by Caldero and Zelevinsky [4]. These are the cluster algebras which arise from the Cartan matrices of affine Kac-Moody algebras. We obtain a simple explicit solution for the cluster variables in terms of initial data. We then proceed to describe the general solution of the A r Q-system using the same methods. In particular, we obtain an explicit formula for the fundamental cluster variables, which generalizes the earlier results of [4] to higher rank. Finally, we make the explicit connection between the path interpretation of the solutions of the Q-system and a subclass of the totally positive matrices of [7] and their associated electrical networks.
More precisely, it turns out that the generating function for the family of cluster variables R 1,n (n ∈ N) of the A r Q-system is given by the resolvent of the transfer matrix T m associated with a graph Γ m for some seed variables associated with the Motzkin path m. We show that it is possible to locally modify the graph without changing the path generating function, so that we obtain a transfer matrix of smaller size r + 1, equal to the rank of the algebra. From there, there is a straightforward identification with the networks associated with totally positive matrices of special type, related to the Coxeter double Bruhat cells of [13].
The advantage of our approach is that we have explicit expressions for the cluster variables in terms of any mutated cluster seed parametrized by a Motzkin path m.
The paper is organized as follows. In Section 2, we explain the basic tools from statistical mechanics which we use, the partition functions of hard particles on graphs and the equivalent partition functions of paths on weighted dual graphs.
For illustration, in Section 3, we use this to give the explicit expression for the generating function of the cluster variables of rank 2 cluster algebras corresponding to affine Dynkin diagrams, a problem extensively studied in [24,4,22].
In Section 4, we review our solution [6] of the A r Q-system for the simplest choice of initial variables. This solution uses the partition functions of Section 2 as well as the theorem of [21,14] relating the partition function of non-intersecting paths to determinants of partition functions of paths. We also introduce a new notion in this section, the "compactification" of the graph, which gives a new transfer matrix which is associated with the same partition function. This is a key tool in making the connection with totally positive matrices.
Section 5 generalizes the results of Section 4, and we give expressions for the Q-system solutions in terms of any set of cluster variables in a fundamental domain. We also introduce the notion of "strongly non-intersecting paths" and a generalization of [21,14]. This gives generating functions for the cluster variables in terms of the other seeds in the cluster algebra, and also provides a proof of the positivity conjecture [9]. This section is a quick review of the results of [6].
In Section 6, we extend the graph compactification procedure of Section 4 to the other graphs, corresponding to mutated cluster variables, introduced in Section 5. This yields transfer matrices of size (r + 1) × (r + 1), the resolvent of which is an alternative expression for the generating function for cluster variables. Finally, in Section 7, we use this to give the explicit relation to totally positive matrices [7,13].
We thank M. Gekhtman, S. Fomin, A. Postnikov, N. Reshetikhin and A. Vainshtein for useful discussions. RK's research is funded in part by NSF grant DMS-0802511. RK thanks CEA/Saclay IPhT for their hospitality. PDF's research is partly supported by the European network grant ENIGMA and the ANR grants GIMP and GranMa. PDF thanks the department of Mathematics of the University of Illinois at Urbana-Champaign for hospitality and support, and the department of Mathematics of the University of California Berkeley for hospitality.

Partition functions
2.1. Hard particles on G r .
2.1.1. Vertex-weighted graphs. Let G be a finite graph with N vertices labeled 1, 2, ..., N , and non-oriented edges connecting the vertices. The adjacency matrix A G of the graph G is the N × N matrix with entries A G i,j = 1 if vertex i is connected by an edge to a vertex j. To each vertex i is associated a positive weight y i .

Configurations.
A configuration C of m hard particles on G is a subset of {1, ..., N } containing m elements, such that A G i,j = 0 for all i, j ∈ C. This is called a hard particle configuration, because if we view the elements of C to be the vertices occupied by particles on the graph, the condition A G i,j = 0 for i, j ∈ C enforces the rule that two neighboring sites cannot be occupied at the same time. Each vertex can be occupied by at most one particle.
We denote by C G m the set of all hard particle configurations on G with m particles.  Figure 1. The graph G r , with 2r + 1 vertices labeled i = 1, 2, ..., 2r + 1.
2.1.3. Partition function. The weight of a configuration C is the product of all the weights associated with the elements of C. That is, The partition function Z G m for m hard particles on G is the sum over all configurations C G m of the corresponding weights: 2.1.4. The graph G r . A basic example is the graph G = G r of Figure 1. It has 2r + 1 vertices and 3r − 1 edges, with the (symmetric) adjacency matrix defined by When r = 0, G 0 is reduced to a single vertex labeled 1, while for r = 1, G 1 is a chain of three vertices 1, 2, 3 with the two edges (1, 2) and (2, 3).
Example 2.1. The non-vanishing partition functions Z Gr m for Hard Particles on G r , r = 0, 1 are Recursion relations for the partition function. The transfer matrices Z Gr m satisfy recursion relations in the index r. They are obtained by considering the possible occupancies of the vertices 2r + 1 and 2r: For example, Z Gr 0 = 1 is the partition function of the empty configuration and Z Gr r+1 = r i=0 y 2i+1 for the maximally occupied configuration.  Figure 3. The graphG r with oriented edges drawn in.

2.2.
Transfer matrix on the dual graph. Associated to the graph G r , there is a dual graph G r , as in Figure 2.
It is dual in the sense that G r is the medial graph of G r : each edge of G r corresponds to a vertex of G r , and any two edges of G r share a vertex iff the corresponding vertices of G r are adjacent.
We fix the labeling so that the correspondence is between edges of G r and vertices of G r is: (1) Edge (k, k ′ ) of G r corresponds to the vertex 2k − 1 of G r , where k = 2, 3, ..., r; (2) Edge (k, k + 1) of G r corresponds to the vertex 2k of G r , where k = 1, 2, ..., r; (3) Edge (0, 1) of G r corresponds to the vertex 1 of G r ; (4) Edge (r + 1, r + 2) of G r corresponds to the vertex 2r + 1 of G r .
In matrix form, This matrix is a weighted adjacency matrix for the graph 3 with doubly-oriented edges associated with G r . Each edge of G r corresponds to two oriented edges pointing in opposite directions, with the weights in the transfer matrix corresponding to those oriented edges. The element of the transfer matrix indexed by i, j is the weight corresponding to the edge j → i.
Lemma 2.2. The generating function for hard particle partition functions on G r with a weights ty i per particle at vertex i is with T r as in Equation (2.4).
Proof. Expanding the determinant D r (t) = det(I −T r (−ty)) along the last column, one obtains the recursion relation: Let D r,m denote the coefficient of t m in D r (t). It satisfies the same recursion relation as Equation (2.3) for Z Gr m , with D 0 (t) = 1 + ty 1 and D 1 (t) = 1 + t(y 1 + y 2 + y 3 ) + t 2 y 1 y 3 , in agreement with the initial values of Z Gr (ty), r = 0, 1 in Equation (2.2). Thus, D r,m = Z Gr m for all r, m. Example 2.3. For the case r = 1, G 1 is a chain of 3 vertices 1, 2, 3. The dual G 1 is a chain of three edges connecting four vertices 0, 1, 2, 3, and the transfer matrix is: One checks that det(I − T (−ty)) = 1 + t(y 1 + y 2 + y 3 ) + t 2 y 1 y 3 , in agreement with the partition functions Z G 1 i of Equation (2.2).

2.3.
Hard particles and paths. Let G be a graph with oriented edges. For example, the graph G r of the previous section can be made into an oriented graph, by taking each edge to be a doubly-oriented edge. Then each oriented edge from i to j receives a weight w(i, j), which is the corresponding entry of the transfer matrix T (ty) of Equation (2.4). This may be interpreted as the transfer matrix for paths on G r as follows.
2.3.1. The partition function of paths. A path of length n on an oriented graph G is a sequence of vertices of G, P = (v 0 , v 1 , ..., v n ), such that there exists an arrow from v i to v i+1 for each i. Let P G a,b (n) be the set of all distinct paths of length n, starting at vertex a and ending at vertex b on the graph G.
A path on a graph with weighted edges has a total weight which is the product of the weights w(v i , v i+1 ) associated with the edges traversed in the path.
The partition function Z G a,b (n) for P G a,b (n) is Assuming G is finite, and labeling its vertices i = 1, 2, ..., N , let us introduce the N ×N transfer matrix T with entries T i,j = w(j, i), we have the following simple expression for Z G a,b (n): The matrix T (ty) of (2.4) is then the transfer matrix for paths on G r with weights 1 for edges pointing away from the vertex 0, and ty i for the i-th edge pointing to the origin. The partition function for weighted paths of arbitrary length on G r from the vertex 0 to itself is This relation between hard-particle partition functions and path partition functions may be interpreted as a boson-fermion correspondence, and is a particular case of Viennot's theory of heaps of pieces [25,19]

2.3.3.
Non-Intersecting paths: the LGV formula. We may represent paths of length 2n from vertex 0 to itself on G r as paths on the lattice Z 2 ≥0 (see Figure 4 for an illustration). Such paths start at (0, 0) and end at (2n, 0), and have the following possible steps: (1) To the northeast, (j, k) → (j + 1, k + 1), corresponding to the jth step in the path going from vertex k to vertex k + 1; (2) To the southeast, (j, k) → (j + 1, k − 1), corresponding to the jth step in the path going from vertex k to vertex k − 1; (3) To the east, (j, k) → (j +2, k), corresponding to the steps k → k ′ → k if k ∈ {2, 3, ..., r}.
Paths from the origin to the origin have an even number of steps, by parity.
We will need to consider the partition function of families of α non-intersecting paths on G r , Z e Gr s,e . Here, the fixed starting points are parametrized by s = (s 1 , ..., s α ) and the endpoints by e = (e 1 , .., .e α ).  By non-intersecting paths, we mean paths that do not share any vertex. We have the celebrated Lindström-Gessel-Viennot formula [21,14] (2.13) Z e Gr The determinant has the effect of subtracting the contributions from paths that do intersect. This formula can be proved by expanding the determinant as: One then considers the involution ϕ on families of paths, defined by interchanging the beginnings of the two first paths that share a vertex until the vertex, or by the identity if no two paths in the family intersect. It is clear that when ϕ does not act as the identity it relates two path configurations with opposite weights in the expansion of the determinant, as the two starting points are switched by ϕ, hence these cancel out of the expansion (2.14). We are thus left only with non-intersecting families, all corresponding to σ = Id, hence all with positive weights.
3. Application to rank 2 cluster algebras of affine type 3.1. Rank two cluster algebras. In this section, we use the partition functions introduced in the previous section to the problem of computing the cluster variables of rank two cluster algebras of affine type. This allows us to give explicit, manifestly positive formulas for the variables, proving the positivity of the variables in these cases.
3.1.1. The recursion relations. The rank 2 cluster algebras of affine type [9,24] may be reduced to the following recursion relations for n ∈ Z: where b, c are two positive integers with bc = 4, hence (b, c) = (2, 2), (4,1) or (1,4). The aim is to find an expression for x n , n ∈ Z in terms of some initial data, e.g. (x 0 , x 1 ).
The connection to rank 2 affine Lie algebras is via the Cartan matrix 2 −b −c 2 .
The cases (4, 1) and (1,4) are almost equivalent: If x n (x 0 , x 1 ) is a solution of the (b, c) equation, then x 1−n (x 1 , x 0 ) is the solution of the (c, b) equation. We may thus restrict ourselves to the (1, 4) case.
However, the symmetry x n ↔ x 1−n changes the parity of n. Therefore we need to also consider the dependence of x n in the "odd" initial data (x 1 , x 2 ).
It turns out that the recursion relations (3.1) are all integrable evolutions. This allows us to compute the generating function for x n , n ≥ 0. The result is a manifestly positive (finite) continued fraction. In the light of the results of the previous section, this allows to reinterpret x n as the partition function for weighted paths on certain graphs. This path formulation gives yet another direct combinatorial interpretation for the expression of x n as a positive Laurent polynomial of the initial data, to be compared with the approach of [24,4] using quiver representations and that of [22] using matchings of different kinds of graphs.
3.2. The (2, 2) case: solution and path interpretation. Consider the recursion relation . This is the A 1 case of the renormalized Q-system considered in [5].
Due to the symmetry n ↔ 1 − n of the equation, the solution satisfies so we may restrict our attention to computing x n , for n ≥ 0.

Constants of the motion. Equation (3.2) is integrable.
To see this, we rewrite (3.2) as We conclude that there exists a constant c, independent of n, such that x n−1 + x n+1 = cx n for all n. Using Equation (3.2),

We interpret c as an integral of the motion of Equation (3.2). Equation (3.3) is a two-term recursion relation in n.
Note that c coincides with the partition function Z G 1 1 = y 1 + y 2 + y 3 for one hard particle on the graph G 1 , with weights Note also that the only other non-vanishing hard particle partition functions on G 1 are Z G 1 0 = 1 and Z G 1 2 = y 1 y 3 = 1. 3.2.2. Generating function for x n . Let X(t) = ∞ n=0 t n x n be the generating function for the variables x n with n ≥ 0. Using x n+1 − cx n + x n−1 = 0, we have with y i as in (3.4). This gives x n as a manifestly positive Laurent polynomial of (x 0 , x 1 ). In fact, from which x n is obtained by extracting the coefficient of t n . This agrees with the result of [4]. It follows that the dependence of the variables x n on any other pair (x k , x k+1 ) is also as a positive Laurent polynomial. This is clear from the translational invariance of the system:

3.2.3.
Relation to the partition function of paths. Upon comparing the continued fraction expression (3.5) and Equation (2.12), we see that there is a path interpretation to the variables x n as follows.
The denominator of the fraction X(t) is equal to the partition function Z G 1 (−ty) for hard particles on the graph G 1 introduced in Section 2, with the weights −ty i per particle at vertex i. Therefore, , is equal the partition function for paths on the graph G 1 of Example 2.3, beginning and ending at the vertex 0. The weights are as follows: The weight is equal to 1 for any step away from vertex 0, and and is equal to ty i per step from vertex i to i − 1.
3.3. The (1, 4) case: Solution and relation to paths. We now consider the system: We determine the dependence of the variables x n on two different types of initial conditions: We can eliminate the odd variables and get an equation for the even variables. Let u n = x 2n . Using x 2n−1 = u n u n−1 − 1, the even variables satisfy the recursion relation We conclude that w n is a conserved quantity, that is, it is independent of n. Using (3.11), there exists a constant c such that u n+1 + u n−1 = cu n . We may compute this constant explicitly in terms of the initial conditions in cases 0 and 1 of (3.9), using u 0 = x 0 , u 1 = x 2 and x 0 x 2 = 1 + x 1 : Generating function. The linear recursion relation u n+1 − cu n + u n−1 = 0 implies the following formulas for the generating functions where the parameters are expressed in terms of the initial data as: Note that both sets satisfy the same relation y where i = 0, 1, as they are a related via the substitution x 2 ↔ x 0 , which maps (y Upon expanding the right hand sides of (3.13) and (3.14) in power series of t, we get all the u n 's as explicit positive Laurent polynomials of either initial data (x 0 , x 1 ) and (x 1 , x 2 ). Using we obtain the expressions, valid for all n ≥ 0: where we have used the multinomial coefficients The expressions for the odd variables follow from x 2n+1 = x 2n x 2n+2 − 1. The positivity of these latter expressions is easily checked: Note that the product x 2n x 2n+2 in both Equations (3.17) and (3.18) has a constant term 1 as a Laurent polynomial of (x 0 , x 1 ) and (x 1 , x 2 ) respectively, hence x 2n x 2n+2 − 1 is a positive Laurent polynomial.

Path interpretation.
The continued fraction expressions (3.13) and (3.14) allow for a path interpretation of x 2n as follows. Consider the graph G (1,4) on the left hand side of Figure  5, with two vertices labelled 0, 1 connected by an edge, and connected to themselves via a loop. We assign weights to the oriented edges as follows: We can also associate a path in Z 2 ≥0 to a path on G (1,4) composed of the steps shown in Figure  5.
The corresponding path transfer matrix is: T = t a 1 a 2 1 a 3 . Using Gaussian elimination on I − T as in the previous example, we find that the partition function of paths from the vertex 0 to itself is: Hence, x 2n is (up to a factor of x 0 in case 0 and x 2 in case 1) the partition function for paths of 2n steps on G (1,4) , from and to the vertex 0, with weights (a 1 , a 2 , a 3 ) = (y 1 , y 2 , y 3 ) in case (i) and (a 1 , a 2 , a 3 ) = (z 1 , z 2 , z 3 ) in case (ii), where the weights are as in (3.15).

3.3.4.
The graph G 1,4 as a compactification of the graph G 1 . We will see later that, quite generally, it is possible to "compactify" the graphs G r . The result for r = 1 is precisely the graph G 1,4 . Thus, The case (b, c) = (2, 2) of the previous section may also be interpreted in terms of paths on the graph G (1,4) , but with different weights: where y i are as in equation (3.4).
To see this, note that the continued fraction (3.5) may be rewritten as: Thus, for n ≥ 0, the solution x n+1 of the (2, 2) case is up to a factor x 1 the partition function for paths on G (1,4) , from and to the origin vertex 0, and with a total of n steps of the form 0 → 0, 1 → 1 or 1 → 0, with respective weights y 1 , y 2 , y 3 .

Application to the A r Q-system
In [16,5], we showed that the recursion relations (Q-systems) satisfied by the characters of the Kirillov-Reshetikhin modules of the quantum affine algebras associated with any simple Lie algebra can be described in terms of mutations of a cluster algebra. Solutions to the cluster algebra recursion relations are more general, in that the initial conditions are not specialized, as they are in the original Q-system satisfied by characters of Kirillov-Reshetikhin modules [18].
A particularly simple example of this is the case when the Lie algebra is of type A. Characters of A n KR-modules, which are just Schur functions corresponding to rectangular Young diagrams, are given by the cluster variables upon specialization of the boundary conditions. In [6], we gave the general solution for the cluster variables without specialization of initial conditions. For these variables, we proved the positivity conjecture of Fomin and Zelevinsky by mapping the problem to a partition function of weighted paths on a graph. Let us review the results obtained in [6].
Remark 4.1. The original Q-system, which is the one satisfied by the characters of KRmodules, differs from the system (4.1) not only in that it is specialized to the initial conditions R α,0 = ±1 for all α ∈ I r , but also by a minus sign in the second term on the right. In this discussion, we choose to renormalize the variables for simplicity. It is also possible (see the appendix of [5]) to consider the recursion relation with nontrivial coefficients. In that case both (4.1) and the original Q-system result from a specialization of the coefficients.
We wish to study the solutions of Equation (4.1) for any given initial data. Our standard initial data for the Q-system are the variables x 0 = (R α,0 , R α,1 ) α∈Ir . We may then view Equation (4.1) as a three-term recursion relation in n, which requires two successive values of n (for each α) as initial data. Our first goal is to express all {R α,n } α,n in terms of the initial data x 0 . 4.1.1. Symmetries of the system. We may use Equation (4.1) to get both n ≥ 2 and n ≤ −1 values in terms of x 0 . These are related via the manifest symmetry of the Q-system under

4.2.
Conserved quantities of Q-systems as Hard Particle partition functions. The Q-system turns out to be a discrete integrable system, in that it is possible to find a sufficient number of integrals of the motion, as in the r = 1 case.
First, equation (4.1) may be used to express R α,n (α ≥ 2) as polynomials in {R 1,n }: This is proved by use of the Desnanot-Jacobi identity for the minors of the (α + 1) The boundary condition R r+1,n = 1 (for all n) together with (4.2) implies the equation of motion which determines R 1,n : From Equation (4.1), it is clear that R r+2,n = 0 for all n. Hence there exists a linear recursion relation of the form The fact that c r+1−m do not depend on n follows from the fact that each row in the matrix in the determinant for R r+2,n is just a shift in n of any other row.
The constants c p , p = 1, 2, ..., r are the r integrals of motion of the A r Q-system. They can be expressed explicitly in terms of the R 1,n s as follows: independently of n. These quantities are similar to those found in [23] for the so-called Coxeter-Toda integrable systems. By using simple determinant identities, we show in Theorem 3.5 of [6] that c p satisfy recursion relations which allow us to identify them as the partition functions Z Gr p of p Hard Particles on the graph G r of Figure 1, where the weights given by: This is true for any k: The functions Z Gr p are independent of the choice of k. Thus, unless otherwise stated, y α will stand for y α,0 below. 4.3. Q-system solutions and paths. The linear recursion relation (4.3) allows to compute the generating function R (r) (t) = ∞ n=0 t n R 1,n explicitly. Indeed, R (r) (t)Z Gr (−ty) is a polynomial of degree r, and it is easy to see that R (r) (t)Z Gr (−ty) = R 1,0 Z Gr (0, −ty 2 , ..., −ty 2r+1 ).
Using (2.11), we may interpret R (r) (t)/R 1,0 as the generating function Z e Gr 0,0 (ty) for paths on G r with the weights (4.5), say for k = 0. In other words, R 1,n /R 1,0 is the partition function for weighted paths of 2n steps on G r starting and ending at the origin (or starting at (0, 0) and ending at (2n, 0) in the two-dimensional representation).
As an illustration, we have represented in Figure 6 the six pairs of non-intersecting paths contributing to R 2,3 , solution of the A 2 Q-system.
Thus, we have proved   The variables R α,n which satisfy (4.1), when expressed in terms of the variables x 0 , are equal to (R 1,0 ) α times partition functions for paths on the graph G r , involving only the weights y α of (4.5). These weights are explicit Laurent monomials of the initial data x 0 = (R α,0 , R α,1 ) α∈Ir . This gives an explicit expression for R α,n as Laurent polynomials of the initial data, with non-negative integer coefficients.

4.4.
An alternative path formulation. In the same spirit as Remark 3.3.4, one can show (see below) that the solution R 1,n of the A r Q-system may also be interpreted in terms of paths on a new ("compactified") graph G ′ r of figure 7. This is a graph with r + 1 vertices, labelled 1, 2, ..., r + 1, connected via oriented edges i → i + 1, i + 1 → i i = 1, 2, ..., r and loops i → i, i = 1, 2, ..., r + 1.
This is readily proved by Gaussian elimination.
Comparing this expression to the results of the previous section, we conclude that Lemma 4.4. For n ≥ 0, R 1,n+1 /R 1,1 is the partition function for paths on the weighted graph G ′ r , with a total of n steps along the edges of type i → i or i + 1 → i in G ′ r , starting and ending at vertex 1.
The weights are given in Equation (4.6) with y i as in (4.5) with k = 0. In Section 7 we will relate this result to the total positivity conjecture of Fomin and Zelevinsky and networks.
We may actually write an explicit expression for R 1,n by simply expanding the continued fraction (4.8) as: (4.9) Substituting the values (4.5) for the weights y α ≡ y α,0 , and extracting the coefficient of t n+1 , we get for all n ≥ 0: as explicit positive Laurent polynomials of the initial data. This gives a rank-r generalization of the formula given in [4] for r = 1.

Cluster Algebra formulation: mutations and paths for the A r Q-system
In this section, we show that the solutions {R α,n | α ∈ I r , n ∈ Z} of the Q-system are positive Laurent polynomials when expressed as functions of an arbitrary set initial conditions. This generalizes our result for the initial condition x 0 in the previous section.
The recursion relation (4.1) has a solution once a certain set of initial conditions is specified, but this set need not necessarily be the set x 0 . We will explain below that the most general possible choice of initial conditions is specified by a Motzkin path of length r.
The solutions of (4.1) can be viewed as cluster variables in the A r Q-system cluster algebra defined in [16]. Hence, our proof provides a general confirmation of the conjecture of [9] for this particular cluster algebra: When the cluster variables are expressed as functions of the variables in any other cluster (i.e. an arbitrary set of initial conditions), they are Laurent polynomials with non-negative coefficients.
The results of this sections were explained in detailed in [6], and this section should serve as a summary of the proofs contained therein.
5.1. The Q-system as Cluster Algebra. In [16], it was shown that the A r Q-system solutions {R α,n } may be viewed as a subset of the cluster variables of the A n Q-system cluster algebra. In this language, each cluster is a vector with 2r variables, and the subset of clusters relevant to the Q-system are those which have entries made up entirely of solutions to the Q-system. These clusters are all related by cluster mutations which are one of the relations (4.1).
Because of the form of Equation (4.1), it is easy to see that when considering the clusters corresponding to the Q-system, it is sufficient to consider clusters which are are characterized by a set of r integers (m 1 , ..., m r ), subject to the condition that |m α − m α+1 | ≤ 1. This defines what is known as a Motzkin path.
Definition 5.1. The cluster x m corresponding to this set of integers m = (m 1 , ..., m r ) is the vector of 2r variables {R α,mα , R α,mα+1 } α∈Ir , ordered so that all variables with an even second index appear first.
For example, x 0 corresponds to the Motzkin path m = (0, 0, ..., 0), and x 0 = (R 1,0 , ..., R r,0 , R 1,1 , ..., R r,1 ). For any m, x m is obtained from the fundamental initial seed x 0 by mutations of the cluster algebra. This is just saying that one gets x m by repeated selected applications of the recursion relation (4.1) to x 0 . Each mutation changes only one of the cluster variables. That is, for some α and n, (backward mutation at α).
Alternatively, the mutation changes the Motzkin path which characterizes x m , by changing m → m ± ǫ α , with the plus (minus) sign for a forward (backward) mutation. Here, ǫ α is the vector which is zero except for the entry α, which is equal to 1.
The Laurent property of cluster algebras ensures that every cluster variable is a Laurent polynomial of the cluster variables of any other cluster in the algebra.
The positivity property, proved only in particular cases so far, is that these Laurent polynomials have non-negative integer coefficients. The property was proved in the present case in [6]. It may be stated as follows: Theorem 5.2 ([6]). Each R α,n , when expressed as a function of the seed x m for any Motzkin path m, is a Laurent polynomial of {R α,mα , R α,mα+1 | α ∈ I r }, with non-negative integer coefficients.
We outline the proof below. For clarity let us introduce the following notation. Let F be some cluster variable. Then F can be expressed as a function of x m for any m. The functional form is then denoted by F = F m (x m ). Since F can also be expressed as a function of any other cluster, we can write F m (x m ) = F m ′ (x m ′ ) for any two Motzkin paths m, m ′ . In particular, in the notation of the previous section, we have R (r) (t) = R  . They are to be glued "horizontally" for flat transitions (green edges) and "vertically" for ascending ones (blue edges). The resulting graph Γ m is represented (c) with its vertex (black) and edge (red) labels.

5.2.1.
Construction of the graph Γ m . The graph Γ m is constructed via the following sequence of steps (see Figure 8 for an illustration): (1) Decompose the Motzkin path m into maximal "descending segments" m i of length k i (i = 1, ..., p). These are segments of the form m i = (m α i , m α i +1 , ..., m α i+1 −1 ) with Here, α 1 = 1 and α p+1 − 1 = r. (2) The separation between two consecutive descending segments of the Motzkin path, m i and m i+1 is either "flat" i.e. m α i+1 = m α i+1 −1 or "ascending" i.e m α i+1 = m α i+1 −1 + 1. (3) To each descending segment m i , associate a graph Γ m i , which is the graph G k i with additional, down-pointing edges a → b for all a, b such that There are a total of k i (k i − 1)/2 extra oriented edges. (4) We glue the graphs Γ m i and Γ m i+1 into a graph Γ m i ||Γ m i+1 defined as follows (see Fig.8 for an illustration): (a) If the separation between m i and m i+1 is flat, we identify vertex 0 of Γ m i+1 with vertex k i + 2 of Γ m i , and vertex 1 of Γ m i+1 with vertex k i + 1 of Γ m i , while the connecting edges are identified. (b) If the separation is ascending, we reverse the role of vertices 0 and 1 in the procedure above.
The result of this procedure is the graph Γ m = Γ m 1 ||Γ m 2 || · · · ||Γ mp . Its root is the vertex 0 of Γ m 1 . We label the vertices of the graph Γ m by the integers i with i ∈ {0, ..., } and i ′ with i ∈ {2, ..., }. We do this by labeling the vertices of Γ m from bottom to top, by shifting the labels of the subgraphs Γ m i so that no label is skipped nor repeated.
The edges e pointing towards the root of Γ m are of two types: (i) The "skeleton edges" belonging to some G k i in the above construction; (ii) The extra, down-pointing edges added in the gluing procedure.

5.2.2.
The weights on the graph Γ m . We label the 2r + 1 skeleton edges of type (i) by α = 1, 2, ..., 2r + 1 from bottom to top (see the example in Figure 8), and the weights are denoted by y α (m). Weights assigned to edges pointing away from the root are all set to 1. Alternatively, we may label the "down pointing" skeleton edges by the pairs of vertices i + 1 → i or i ′ → i which they connect. The extra edges of type (ii) are also labeled by the pairs a → b of vertices which they connect. All edge weights may be labeled by the label of the edge.
Finally, for a given Motzkin path m ∈ M r , we define the skeleton weights y α (m), α = 1, 2, ..., 2r + 1 to be: Note that with these definitions the expressions (5. is the generating function for weighted paths on Γ m , with the coefficient of t n being the partition function of walks from vertex 0 to itself on Γ m which have n down-pointing steps. When m = m 0 = 0, this coincides with (2.10).

5.3.
Mutations, paths and continued fraction rearrangements. Our purpose is to write an explicit expression for the functional dependence of the variables R α,n on the seed variable x m , that is, find (R α,n ) m (x m ) for each α, n and a Motzkin path m.
To do this, we will describe how the generating function R (r) (t) = R Suppose m and m ′ are related by such a mutation. We compute the two generating functions of the type (5.6), Z m (t; x m ) and Z m ′ (t; x m ′ ).
In fact, the two matrices, T m and T m ′ differ only locally, so that in computing the two generating functions by row reduction, we find that the calculation differs only in a finite number of steps. Note that generating functions take the form of finite continued fractions with manifestly positive series expansions of t.
We note two simple rearrangement lemmas which can be used to relate finite continued fractions: One checks this by explicit calculation. Let α > 1. Then, using (R 2 ) we can show that Z m (t; x m ) = Z m ′ (t; x m ′ ) if and only if the weights y i ≡ y i (m) and y ′ i ≡ y i (m ′ ) are related via: β = 2α; y 2α−1 y 2α+1 /(y 2α−1 + y 2α ), β = 2α + 1; y 2α+2 y 2α−1 /(y 2α−1 + y 2α ), β = 2α + 2; y β otherwise. (5.9) One checks directly that the expressions (5.3)-(5.4) indeed satisfy the above relations. The boundary case, where α = 1, is treated analogously, but first requires a "rerooting" of the graph to its vertex 1, which is implemented by the application of (R 1 ): Indeed, we simply write Z m (t;  We then rearrange Z ′ m (t; x m ) using (R 2 ) again, and find that Z ′ m (t; x m ) = Z m ′ (t; x m ′ ) if and only if the weights are related via the above equations.
The net result is the following. Given a compound mutation µ m which maps the fundamental Motzkin path m 0 to m = (m α ) α∈Ir , then there are exactly m 1 "rerootings" as described above. This corresponds to rewriting the generating function with Z m (t; x m ) as in Equation (5.6).
This leads to the following main result: We have represented in Figure 9 the graphs Γ m for the Motzkin paths m of the fundamental domain M r for r = 3. 5.4. Q-system solutions as strongly non-intersecting paths. To treat the case of R α,n with α = 1, given a Motzkin path m ∈ M r , we need a path interpretation for the determinant formula for R α,n+m 1 : Here, we have used the result of the previous section to rewrite the formula in terms of the partition function for paths on Γ m , from and to the root, and with n + i + j − α − 1 down steps. As in the standard LGV formula, we interpret this determinant as a certain partition function for paths on Γ m starting from the root at times 0, 2, 4, ..., 2α − 2 and ending at the origin at times 2n, 2n + 2, ..., 2n + 2α − 2.

5.4.1.
Paths on Γ m represented as paths on a square lattice. We draw paths, with allowed steps dictated by the graph Γ m , on a square-lattice in two dimensions. Paths start and end at y-coordinate 0. Moreover, if a path has n "down" steps (steps towards the vertex 0), then its starting and ending point are separated by 2n horizontal steps. That is, a path is from (x, 0) to (x + 2n, 0) where x the starting time and n is the number of down-steps.
Since the horizontal distance between the starting and ending points is fixed by the number of "down" steps, a single step of the form should have a horizontal displacement 2 − h (instead of 1 as in the usual case). That is, on the square lattice it is a segment of the form Some examples are illustrated in Figure 10.
Thus, we identify Z Γm 0,0 (n + i + j − α − 1) = Z Γm s i ,e j with paths on the two-dimensional lattice starting at the point s i = (2i − 2, 0) and ending at the point e j = (2n + 2α − 2j, 0), with the types of steps allowed given by the edges of Γ m in the way explained in the previous paragraph.

Strongly non-intersecting paths.
We now look at families of α paths, corresponding to the determinant in Equation (5.11). Such paths may have crossing on the lattice. As in the case of LGV formula, the determinant cancels out contributions from paths which share a vertex. However, other situations may occur: Two paths may cross without sharing a vertex in our picture.
One can generalize the proof of the LGV formula to take such crossings into account. Using the expansion (2.14), and introducing an involution ϕ on families of paths. This involution interchanges the beginnings of the first two paths which share a vertex or which cross each other, by transforming the crossing segments [P, Q] and [R, S] into non-crossing ones [R, Q] and [P, S]. This effectively interchanges the two paths up to the points P and R respectively, whichever comes first.
As in the usual case, the involution ϕ acts as the identity if no two paths cross, share a vertex, or can be made to cross via such an exchange.
Taking into account the weights of the paths, the intertwining condition (5.2) implies that the flip preserves the absolute value of the weight, but changes its sign, due to the transposition of starting points. So the determinant (5.11) cancels not only the paths that share a vertex or that cross, but also those that come "too close" to one-another, namely that can be made to cross via a flip.
We call the families of paths which are invariant under the involution ϕ strongly nonintersecting paths.
To summarize, we have the following theorem: Theorem 5.4. For any Motzkin path m ∈ M r , the variable R α,n+m 1 (with n + m 1 ≥ α − 1) is equal to (R 1,m 1 ) α times the partition function of α strongly non-intersecting paths with steps and weights determined by Γ m . The starting points are s i = (2i − 2, 0) and the end points are e j = (2n + 2α − 2j, 0), with i, j = 1, ..., α, and the weights are functions of the cluster x m .
In particular, (R α,n+m 1 ) m (x m ) is a Laurent polynomial with non-negative coefficients of the cluster x m .

A new path formulation for the A r Q-system
In Section 5, we constructed a set of transfer matrices T m , associated with paths on the graphs Γ m , which allowed us to interpret R 1,n as generating functions of weighted paths on a graph Γ m , and hence prove their positivity as a function of the seed variables x m .
In Section 4.4, we also showed that for the special case m = m 0 = 0, there is an alternative graph Γ ′ m 0 = G ′ r , and that one can interpret R 1,n as a generating function for paths this alternative "compactified" graph. The graph Γ ′ m 0 has r + 1 vertices, hence the associated transfer matrix is of size r + 1 × r + 1.
We now ask the question, is there a corresponding compactified set of graphs, Γ ′ m , which give a path formulation of R 1,n with weights which given by functions of the seed x m for all Motzkin paths in M r ?
It turns out that it is always possible to find a weighted graph with r + 1 vertices which answers this question positively for each m. This corresponds to a set of transfer matrices of a size equal to the rank of the algebra A r . Therefore this transfer matrix allows us to make a direct connection between our transfer matrix approach and the totally positive matrices of [7].
6.1. Compactified graphs. Consider the collection of graphs Γ m . If we are interested in the generating function of weighted paths on them from the vertex 0 to itself, then we can make various changes in them locally ("compactify" them) without affecting the generating function itself.
We obtain such compactified graphs from Γ m by identifying pairs of neighboring vertices, and, when necessary, adding oriented edges to cancel unwanted terms. There are two possible ways to make such identifications. Before presenting the general case, let us illustrate the two situations in the following subsection.
6.2. Examples of compactification. In fact, the first type of compactification, applied to G r , leads to the alternative graph G ′ r obtained in Section 4.4. Recall that the generating function for paths from 1 to 1 on the graph G r of Figure 3 is related to the generating function for paths from 0 to 0 via the rerooting procedure: Example 6.1. The generating function Z e Gr 1,1 is equal to the generating function of paths from 1 to 1 on the graph obtained from G r via the following procedure ("compactification"): (1) Identifying vertex i ′ with vertex i, whenever both exist, and attaching a loop with weight ty i ′ ,i to the resulting vertex (see Figure 11 (a)). (2) Identifying vertex r + 2 with vertex r + 1, and attaching a loop with weight ty r+2,r+1 to the resulting vertex; (3) Identifying vertex 1 with vertex 0, renaming the resulting vertex 1, and attaching a loop with weight ty 1 = ty 1,0 to this vertex. This is clear, since a path from 1 to 1 through the vertex i ′ must have a segment i → i ′ → i with weight ty i ′ ,i , and if it goes through the vertex r + 2 it must have a segment r + 1 → r + 2 → r + 1 with weight ty r+2,r+1 . Similarly, the loop at 1 accounts for segments of the form 1 → 0 → 1. Note that the resulting graph is G ′ r of Figure 7. Thus, we have the identity of Section 4.4 Z e Gr 1,1 = Z e G ′ r 1,1 . Another example of identification of vertices is the case when the two vertices are adjacent vertices, (i, i + 1), on the spine of Γ (see Figure 11 (b)). Example 6.2. Consider the graph H k associated to an ascending Motzkin path segment of length k (see the example for k = 3 in the lower right hand corner of Figure 9). This is a vertical chain of 2k + 2 vertices, numbered from 0 to 2k + 1 from bottom to top, connected by edges oriented in both directions. The edges i + 1 → i have weights y i+1 and the edges i → i + 1 have weights 1.
Suppose we identify the vertices a, a + 1 in this graph for some a. A path from 0 to 0 with a step a → a + 1 is always paired with a step a + 1 → a, for a net contribution to the weight of the path of y a+1 . We associate a loop with weight y a+1 at the newly formed vertex after the identification of vertices a and a + 1.
However, there are "forbidden" paths on the resulting graph, paths which are not inherited from paths on H r . These are paths which go from a+2 → a−1 without traversing the loop. This would correspond to going from a+2 to a−1 on H r without passing through the edge a+1 → a, which is impossible. We cancel the contribution of these paths by adding an ascending edge a − 1 → a + 2 with weight −1. The effect is precisely to subtract the weights of the forbidden set of paths.
More generally, a succession of identifications of the type in the example above results in the following (see Figure 11 (c)): Lemma 6.3. The generating function of paths from 0 to 0 on the graph H k with vertices 0, ..., 2k+1 is equal to the generating function for paths from 0 to 0 on the following compactified graph H ′ k : (1) Identify the vertices 2i+1 and 2i+2; rename the resulting vertex i+1. (i = 0, ..., k −1).
(2) Attach a loop at the vertex i + 1 with weight w i+1 = y 2i+2 . Other edge weights remain unchanged.
An illustration of the resulting graph H ′ k is given in (c) of Figure 11.
Proof. Consider the set of paths P of the form P 1 P + P 2 P − P 3 , where P i are fixed paths, and P + is a path from h 0 to h 1 consisting of only up steps and loop steps, and P − is a path from h 1 to h 0 consisting only of down steps and loop steps. We furthermore restrict ourselves to paths with the weight(P + )× weight(P − ) fixed to be yw n = w n 1 1 · · · w n k k for some n. Here, y is the product of the weights of the down steps in P − , and w n is the total weight coming from the loops in the path. Let f be the weight of the remaining fixed portions of the path.
Without loss of generality, we can take h 0 = 0 and h 1 = k + 1.
For each such path we can decompose n i = n + i + n − i , where n + i is the number of times the loop with weight w i is traversed in P + , and n − i in P − . Paths which arise from paths on H k must have n − i ≥ 1 (for all i) by definition. We claim that on H ′ k , paths with n − i = 0 are cancelled by paths which pass through the new ascending edges.
The key observation is that a path which has an up step going through the ascending oriented edge i − 1 → i + a + 1 (a ≥ 0) on H ′ k has n + i = n + i+1 = · · · = n i+a = 0. Then the total contribution of the paths in P to the partition function is in fact So the alternating sum has the effect of subtracting the terms with any n − i = 0. A path on the graph H ′ k with a spine vertices skipped (by traversing ascending edges of length > 1) comes with a total sign (−1) x where x = (length of the ascending segments − 1) = a. That is also the sign of the term with n + j 1 = · · · = n + ja = 0 in the summation. Finally, we note that any path can be decomposed into pairs of ascending and descending segments as above, and the proof can be applied iteratively to any path. 6.3. Definition of compactified graphs. On a graph Γ m , we call a skeleton edge horizontal if it connects (a) vertices i and i ′ for some i, (b) vertices 0 and 1, or (c) the top vertex and the one below it. We call an edge vertical otherwise.
Definition 6.4. The compactified graph Γ ′ m with r + 1 vertices is obtained from the graph Γ m via the following compactification procedure: (1) Introduce an order on the vertices of Γ m , so that i < i + 1 and i < i ′ < i + 1. Number them from 1 to 2r + 2 accordingly.   Figure 13 shows the set of compactified graphs corresponding to Figure 9 for the case A 3 . The resulting weighted graph Γ ′ m has r + 1 vertices labelled 1, 2, ..., r + 1, and hence is associated with a transfer matrix T ′ m of size r + 1 × r + 1.
6.4. An alternative construction. An alternative description of the compactified graphs Γ ′ m is the following. We start from the graph Γ ′ m 0 ≡ G ′ r of Figure 7. The loop at vertex i has weight ty 2i−1 and the edge i + 1 → i has weight ty 2i , where y j = y j (m 0 ) are as in Equations (5.3)-(5.4).
Lemma 6.7. The weighted graph Γ ′′ m is identical to the weighted graph Γ ′ m . This is just the result of the definition of Γ m using the decomposition of m, as in Figure  8. Maximal subgraphs the form H k correspond to the maximal ascending segments of the Motzkin path. All other segments correspond to subgraphs with horizontal edges. 6.5. Equality of generating functions. To summarize, the compactified graph Γ ′ m is such that Theorem 6.8. ( In other words: the partition function for weighted paths from vertex 1 to vertex 1 in Γ m is identical to that for weighted paths from vertex 1 to vertex 1 in the compact graph Γ ′ m .

Totally positive matrices and compactified transfer matrices
We now establish the connection between the transfer matrices T ′ m for paths on Γ ′ m and the totally positive matrices of [7] corresponding to double Bruhat cells for pairs of Coxeter elements.
We may express the compact transfer matrices T ′ m of the previous section in terms of the elementary matrices f i , e i , d i for GL r+1 , defined as follows. Let E ij denote the standard elementary matrix of size (r + 1) × (r + 1), with entries (E i,j ) k,ℓ = δ k,i δ ℓ,j .
In [7], Fomin and Zelevinsky introduced a parametrization of totally positive matrices as products of the form i∈I f i r+1 i=1 d i j∈J e j for I, J two suitable sets of indices. This expression allowed to rephrase total positivity in terms of networks. Here we interpret our compact transfer matrices in terms of some of these products.
Recall that each Motzkin path can be decomposed into descending, ascending and flat pieces, as in Section 6.4. We introduce the increasing sequence of integers (a 1 , ..., a 2k ), such that the jth ascending piece of m, A α j ,i j of m starts at m α j = a 2j−1 and ends at m α j +i j −1 = a 2j . Similarly for the sequence of increasing integers (b 1 , ..., b 2p ), which mark the starting and ending points of the descending sequences D α j ,i .
Note that the sequences σ m and τ m consist of increasing and decreasing subsequences of consecutive integers, and that these subsequences and their order are unique.
One can define the decomposition of the transfer matrix T ′ m into a strictly lower-triangular part N m and an upper triangular part B m , so that ) (e j 1 e j 2 · · · e jr ), (7.4) where the parameters in Equation (7.1) are Proof. We give a pictorial proof. It is possible to describe multiplication by an elementary matrix as the addition of an arrow to a graph. In our context, N m encodes the ascending arrows in the graph Γ ′ m , and B m the descending arrows. First, consider the product ..., r), which is simply σ m written in reverse order, consists of alternating increasing and decreasing sequences of consecutive integers. The products of matrices corresponding to increasing subsequences are and products corresponding to decreasing sequences are We start with the graph corresponding to the identity matrix, which is the transfer matrix of the graph consisting of r + 1 disconnected vertices labelled 1, 2, ..., r + 1, each with a loop of
Recall that the segments [a 2i−1 , a 2i ] correspond to the ascending segments of m, themselves associated to the vertical chain-like pieces of Γ m (see Figure 8). Recall that in the identification procedure leading to Γ ′ m (Definition 6.6 and Lemma 6.7), we showed that such chains must receive a web of ascending edges with alternating weights ±1 (see Figure 11 (c)), while all the vertices are connected via ascending edges i → i + 1 with weight 1.
Finally, comparing this with the graph associated to (f i 1 f i 2 · · · f i k ) −1 as described above, we find that the contribution of ascending edges to T ′ m (or equivalently, Γ ′ m ) is identical to The proof of Equation (7.4) is similar, but now concerns the descending edges and the loops of the graph Γ ′ m . The product td 1 d 2 · · · d r+1 is the transfer matrix of a chain of r + 1 disconnected vertices i = 1, 2, ..., r + 1, each with a loop with weight ty 2i−1 . Multiplication on the right by e i creates a descending edge i + 1 → i, with weight ty 2i−1 y 2i y 2i−1 = ty 2i . Again we divide the sequence τ m into increasing subsequences of consecutive integers, (b 2j−1 , b 2j−1 + 1, ..., b 2j ) and decreasing subsequences (b 2j+1 − 1, ..., b 2j + 1). Therefore the product e j 1 e j 2 · · · e jr consists of "ascending" factors and "descending" factors where y b+i,b+j are the weights of Equation (6.1).
Recall that the segments [b 2i−1 , b 2i ] correspond to the descending segments of m, which correspond to networks of descending edges on Γ m with weights (6.1) (see Figure 8). In our construction 6.6 of Γ ′ m , these descending edges have remained unchanged, while each vertex i received a loop with weight ty 2i−1 , i = 1, 2, ..., r+1. This is nothing but the graph associated to t(d 1 d 2 · · · d r+1 )(e j 1 e j 2 · · · e jr ), which therefore encodes the contribution of loops and descending edges to T ′ m , and Equation (7.4) follows. We can now make a direct connection with totally positive matrices encoding the networks associated to the Coxeter double Bruhat cells considered in [13]. Each Motzkin path m ∈ M r corresponds to such an element, the (r + 1) × (r + 1) matrix P m : Definition 7.4. Given a Motzkin path m ∈ M r , define (7.6) P m = (f i 1 f i 2 · · · f ir ) (d 1 d 2 · · · d r+1 ) (e j 1 e j 2 · · · e jr ), where (i 1 i 2 · · · i r ) = σ m and (j 1 j 2 · · · j r ) = τ m are the two sequences of (7.2). The parameters λ j , µ j , ν j are as in Equation (7.5).
(7.7) (I − T ′ m ) −1 = (I − tP m ) −1 (f i 1 f i 2 · · · f ir ) which allows to rewrite the generating function of Theorem 6.8 This yields an interpretation of the solution R 1,n+m 1 +1 to the A r Q-system with initial data x m in terms of the network associated to the totally positive matrix P m , for all n ≥ 0.
Example 7.6. For the fundamental Motzkin path m = m 0 with m α = 0 for all α, we have σ m 0 = τ m 0 = (r, r − 1, ..., 1), and therefore P m 0 = (f r f r−1 · · · f 1 )(d 1 d 2 · · · d r+1 )(e r e r−1 · · · e 1 ). Note that the matrix F = f r f r−1 · · · f 1 has entries F i,j = 1 if i ≥ j, and 0 otherwise. One can check directly that I − tP m 0 = F (I − T ′ m 0 ), with T ′ m 0 given by Equation (4.7). An equivalent formulation uses the explicit decomposition P m = F DE, where F = f i 1 · · · f ir , D = d 1 · · · d r+1 and E = e j 1 · · · e jr : where P ′ m = DEF = F −1 P m F , and the fact that F is a lower uni-triangular matrix, which implies: (I − tT ′ m ) −1 1,1 = (I − tP m ) −1 F 1,1 = (I − tP ′ m ) −1 1,1 . The matrix P ′ m is another way to write a totally positive matrix, and the network graph corresponding to it has a slightly modified form from that of P m . Both of these correspond to electrical networks [7]. For illustration, we represent in Figure 15 the network corresponding to the matrix P m for the Motzkin path m of Example 7.2, represented in Figure 12 (c). The medallions show the three elementary circuit representations for the three types of elementary matrices f i , d i , e i , each receiving the associated weight. The Lindström lemma [21] of network theory states that the minor |P | c 1 ,...,c k r 1 ,...,r k of the matrix P of the network, corresponding to a specific choice rows r 1 , ..., r k and columns c 1 , ..., c k , is the partition function of k non-intersecting (vertex-disjoint) paths starting at points r 1 , ..., r k and ending at points c 1 , ..., c k , and with steps taken only on horizontal lines or along f , d or e type elements. Here we have only considered circuits with entry and exit point 1, after possibly several iterations of the same network (each receiving the weight t), and whose generating function is precisely the resolvent (I −tP ) −1 1,1 .

Conclusion
In this paper, we have made the contact between our earlier study of the solutions of the A r Q-system, expressed in terms of initial data coded via Motzkin paths, and the totally positive matrices for Coxeter double Bruhat cells. We showed in particular how the relevant pairs of Coxeter elements were encoded in the Motzkin paths as well.  Figure 16. The concatenation of n copies of the network coded by P ′ m . The quantity (P ′ m ) n 1,1 is the partition function of electrical wires starting and ending at the two indicated arrows. We also represent below a cylinder formulationà la [13]: the wire must wind n times around the cylinder before exiting.
One would expect the total positivity of the transfer matrices P m or P ′ m to be directly related to the proof of the positivity conjecture in the case of the A r Q-system. Our proof presented in [6] relies on the path formulation of R 1,n and on the formulation of R α,n as the partition function of families of strongly non-intersecting paths. The total positivity of the compactified formulation should provide an alternative proof, using networks rather than paths.
The precise connection between paths on graphs and networks, as illustrated in Section 7 above is subtle. Indeed, the identity between resolvents implies that the partition function for weighted paths from 1 to 1 on Γ m with n descents, (T n m ) 1,1 , is identical to the generating function for circuits on a network made of n identical concatenated networks, each corresponding to the totally positive matrix P ′ m , from connector 1 to connector 1 (see the top of Figure 16). In [13], this concatenation is realized by putting the network on a cylinder and allowing for the circuit to wind n times around it before exiting (see the bottom of Figure 16). Note that we could also work with P m instead, as it is related to P ′ m via cyclic symmetry . More generally, it should be possible to relate our non-intersecting path families to networks with multiple entries and exits, as in the setting of the Lindström lemma.
Another question concerns the cluster algebra attached to the A r Q-system. As stressed in [6], we have only considered a subset of the clusters which arise in the full Q-system cluster algebra, namely those which consist of solutions of the Q-system. There are other cluster mutations, however, which are not recursion relations of the form (4.1). One may ask about the other cluster variables in the algebra. The positivity conjecture should hold for them as well. Preliminary investigations show that the corresponding mutations can still be understood in terms of (finite) continued fraction rearrangements, hence we expect them to also have a network counterpart. These clearly can no longer correspond to Coxeter double Bruhat cells, as those are exhausted by the solutions of the Q-system. Finally, the connection to total positivity should be generalizable to the case of other simple Lie algebras as well. Indeed, on the one hand the Q-systems based on other Lie algebras also have cluster algebra formulations [5], while on the other hand the notion of total positivity has been extended to arbitrary Lie groups [8]. We have evidence that hard particle and path interpretations exist for all Q-systems, and it would be interesting to investigate their relation to the corresponding generalized networks. The integrability of these systems is presumably related to that of the Coxeter-Toda systems of [23]. This will be the subject of forthcoming work.