Kasteleyn theorem, geometric signatures and KP-II divisors on planar bipartite networks in the disk

Maximal minors of Kasteleyn sign matrices on planar bipartite graphs in the disk count dimer configurations with prescribed boundary conditions, and the weighted version of such matrices provides a natural parametrization of the totally non--negative part of real Grassmannians (see Refs. [54,43,44,58,7]). In this paper we provide a geometric interpretation of such variant of Kasteleyn theorem: a signature is Kasteleyn if and only if it is geometric in the sense of Ref. [5]. We apply this geometric characterization to explicitly solve the associated system of relations and provide a new proof that the parametrization of positroid cells induced by Kasteleyn weighted matrices coincides with that of Postnikov boundary measurement map. Finally we use Kasteleyn system of relations to associate algebraic geometric data to KP multi-soliton solutions. Indeed the KP wave function solves such system of relations at the nodes of the spectral curve if the dual graph of the latter represents the soliton data. Therefore the construction of the divisor is automatically invariant, and finally it coincides with that in Refs. [4,6] for the present class of graphs.

Kasteleyn [32] and Temperley-Fisher [62] started the study of the dimer model by computing the number of dimer configurations on a rectangular grid. This result was then generalized by Kasteleyn [33] who related the number of perfect matchings on a finite planar graph to the square root of the determinant of a matrix. More recently dimer models on planar bipartite periodic graphs have appeared in mathematical literature because of their relation to combinatorics, algebraic geometry and quantum integrable systems [22,16,17,35,36,29].
Also dimer models on planar bipartite graphs in the disk present interesting features because of their connection to total positivity, toric geometry, theoretical physics and integrable systems [55,59,44,45,8]. A dimer configuration on such a graph G is an almost perfect matching, i.e. a subset of edges such that each internal vertex is used exactly once whereas the boundary vertices may or may not be used. In [55] it was pointed out the existence of a bijection between almost perfect matchings and perfect orientations of G, and toric geometry was used to investigate the topology of totally non-negative Grassmannians. The connection between dimer models on planar bipartite graphs in the disk and totally non-negative Grassmannians was then studied in [44,45].
The variant of Kasteleyn theorem relevant in such setting is the following one [59]: for a planar bipartite graph in the disk with boundary vertices of the same color, there exists a sign matrix such that its maximal minors give the number of almost perfect matchings with prescribed boundary conditions. Moreover, if one assigns positive weights to the edges of the graph, the maximal minors of the weighted version of the sign matrix are the Plücker coordinates of the point in the totally non-negative Grassmannian obtained from Postnikov boundary measurement map [59].
The proof in [59] is topological, whereas in this paper we focus on the explicit representation and the geometric nature of Kasteleyn matrices, since we are interested in their application to integrable systems. We prove that the total signature of a face depends only on the number of edges bounding it, and that they are realized by the geometric signatures introduced in [5] on directed plabic graphs. This geometric representation of Kasteleyn signatures is relevant both to solve Kasteleyn system of relations using the Talaska flows [61] and to provide an alternative proof that the parametrization of positroid cells in terms of the maximal minors of Kasteleyn sign matrices coincides with that of the image of Postnikov boundary measurement map.
Then, we use Kasteleyn system of relations to assign algebraic geometric data to the family of real regular multi-line solutions of the Kadomtsev-Petviashvili (KP) integrable hierarchy introduced in [50,25] and studied in [48,12,14,15,38,2,1,4,6]. At this aim we use the approach to degenerate finite-gap spectral theory proposed in [41] and applied to Toda and KP integrable systems in [43,2,1,4,53,6,11]. We remark that our final goal is the search of effective methods to detropicalize spectral curves and obtain KP solutions fulfilling [21] as done in [3] for soliton data in Gr TP (2,4). Moreover, the inverse problem of constructing soliton KP solutions from real regular spectral data on reducible nodal curves was solved in [1] in a special case (see also [53]), but remains an open problem in general. In [9] they propose an algebraic method based on Dubrovin threefold for the KP equation to study tropicalization of algebraic curves and construct KP soliton solutions from spectral data on reducible nodal curves: therefore it would be relevant to relate the two approaches when reality and regularity conditions hold.
Finally, systems of relations have been introduced in [45] to provide a mathematical framework for the construction of scattering amplitudes in N = 4 SYM theory [10], since such systems explicitly realize the totally non-negative part of any positroid cell via the amalgamation of the little positive Grassmannians, Gr TP (1, 3) and Gr TP (2,3). We are convinced that a geometric approach to the problem may give a new insight to this matter, and that systems of relations may be fruitfully applied also for other problems in mathematical or theoretical physics related to totally non-negative Grassmannians.
Outline of the main results Let G = (B ∪ W, E) be a reduced planar bipartite graph in the disk with boundary vertices of equal color, where B, W are the sets of black, white vertices of the graph respectively, and E is the set of edges. In this paper, we call Kasteleyn an edge signature σ ∶ E ↦ {±1} such that the face signature σ(Ω) fulfills Kasteleyn condition for any finite face Ω: where Ω denotes the number of edges bounding Ω. Then, in Theorem 3.11 we show that the B × W Kasteleyn sign matrix K σ associated to such data fulfills Speyer variant [59] of Kasteleyn theorem: • The maximal minors of K σ indexed by the boundary dimer configurations share the same sign and their absolute value is the number of almost perfect matchings for the given boundary conditions; • If one fixes a Kasteleyn signature as in (1.1) and assigns positive edge weights to the graph, the maximal minors of the weighted Kasteleyn matrix K σ,wt defined in (3.7) are the Plücker coordinates of the point in the totally non-negative Grassmannian given by the boundary measurement map introduced in [54].
Here we choose black boundary vertices on the reduced bipartite graph, and characterize Kasteleyn system of relations associated to a signature fulfilling (1.1) (see Section 4) motivated by Speyer representation of the Kasteleyn weighted matrix (see Formula (3.13)). However, we remark that the equal color of the boundary vertices is just a technical assumption which simplifies both the representation of Kasteleyn matrices and the solutions to the induced system of relations.
For the systems of relations on bipartite graphs we use the representation introduced in [8]. More precisely, for any signature fulfilling (1.1) and for an edge weighting t bw ∶ E ↦ C * we call Kasteleyn is an element in some vector space V assigned to the black vertex b ∈ B; • R w is the linear relation at the white vertex w ∈ W represented by the w-th column of the weighted Kasteleyn matrix K σ,wt : R w (v (k) ) ≡ ∑ b∈B K σ,wt bw v (k) b = 0, where K σ,wt bw = σ(bw)t bw , and bw denotes an edge. Theorem 3.11 implies that the system has maximal rank equal to the number of white vertices, and its kernel is (n − k)-dimensional. In particular, if V = C n−k , the system induces an isomorphism between dual positroid varieties (Theorem 4.4). If V = R n and one fixes natural boundary conditions at (n − k) boundary vertices, then the solution of the linear system at the remaining k boundary vertices provides a representative matrix of the network (G, t bw ) (Theorem 4.5).
We remark that the Kasteleyn signatures introduced in [8] differ from those fulfilling (1.1) at the external faces of the graph. A natural connection to total positivity also holds in their approach and has applications to discrete integrable dynamical systems such as the pentagram map [58], Q-nets [19,13] and discrete Darboux maps [57]. In Section 4.1 we review the main results in [8] and explicitly describe the transformation which relates the two types of Kasteleyn signatures.
Then in Section 5 we provide a geometric construction of Kasteleyn signatures. Indeed we show that Kasteleyn signatures are equivalent to the geometric signatures introduced in [5] for the class of graphs under consideration. In [5] a geometric signature is uniquely and explicitly assigned to the edges of a planar bicolored (plabic) graph using two geometric indices: the local winding number and the intersection number. These indices are ruled by perfect orientations and gauge ray directions which behave as gauge transformations; therefore there exists a unique equivalence class of geometric signatures on G [5]. The explicit relation between the equivalence class of Kasteleyn and that of geometric signatures is given in Theorem 5.20: If G is a reduced bipartite graph, σ a Kasteleyn signature on G satisfying (1.1), and (g) a geometric signature on G as in Definition 5.13, then the Kasteleyn face signature σ(Ω), σ(Ω) = e∈∂Ω σ(e), and the geometric face signature (g) (Ω), are related as follows on each finite face Ω: (Ω) .
Such geometric characterization is then used to explicitly solve Kasteleyn system of relations (v (k) , R w ) using Talaska flows. Flows and conservative flows on directed graphs, originally introduced in [61] to compute the boundary measurement map, were used in [5] to construct the explicit solution to the system of relations for geometric signatures. Therefore they also provide the explicit solution to Kasteleyn system of relations at all internal vertices (Theorem 5.22).
In [5] geometric signatures are defined on the more general class of perfectly oriented plabic graphs such that every edge belongs to at least one directed path starting and ending at the boundary of the disk. We remark that this condition is exactly the one for which the gauge freedom in the definition of the geometric signature is fixed by the gauge transformations at the vertices of the graph. Since plabic graphs are not necessarily bipartite, in the setting of [5,6], ( where n w (Ω) is the number of internal white vertices bounding Ω. We conjecture that signatures on planar non-bipartite graphs in the disk satisfying (1.4) may be also given a statistical mechanical interpretation.
The maximal minors of the Kasteleyn weighted sign matrices are the Plücker coordinates of points in totally non-negative Grassmannians Gr TNN (k, n), and such parametrization is equivalent to that of Postnikov boundary measurement map [59]. In the present setting Theorems 5.20 and 5.22 imply an alternative proof of such equivalence (Corollary 5.23).
Then in Section 6 we apply Kasteleyn system of relations to the spectral problem for the KP-II real regular multi-line solitons. In such setting: • The point [A] represented by the network (G, t bw ) and the real ordered phases K = {κ 1 < ⋯ < κ n } uniquely identify a real regular multi-line soliton solution of the KP-II equation (see [15,38]); • The solution to the direct spectral problem provides a rational curve Γ 0 , with marked points κ 1 , . . . , κ n , P 0 , a spectral coordinate ζ such that ζ −1 (P 0 ) = 0, and a degree k non-special divisor x is a finite set of KP times, has the following property: the vector (ψ(κ 1 , ⃗ x), . . . , ψ(κ n , ⃗ x)) defines un untrivial flow in the plane orthogonal to [A] as the KP times ⃗ x evolve (Lemma 6.1).
As pointed out in [2] the mismatch between the dimension of the soliton variety and that of the divisor data on Γ 0 does not allow to reconstruct the soliton solution from the divisor D S,Γ0 (inverse spectral problem). Then, to complete the KP divisor, we follow the approach in [4,6] based on the degenerate finite gap theory on reducible curves introduced in [41]: we prove that it is possible to fix an initial time ⃗ x 0 and extend the spectral data from (Γ 0 , P 0 , D S,Γ0 (⃗ x 0 )) to (Γ, P 0 , D KP,Γ (⃗ x 0 )), with Γ a reducible M-curve, in such a way that: • The divisor D KP,Γ (⃗ x 0 ) is non-special, and its restriction to Γ 0 is D S,Γ0 (⃗ x 0 ); • D KP,Γ satisfies Dubrovin-Natanzon reality and regularity conditions [21]: there is exactly one divisor point in each oval except in the one containing P 0 .
The key problem is to choose the spectral curve Γ so that the wave function takes equal values at pairs of double points for all KP times. Lemma 6.1 implies that Kasteleyn system of relations gives the answer to such question provided that • The spectral curve Γ has dual graph G and we identify Γ 0 with the boundary of the disk; • At the boundary vertices b j , we choose boundary conditions v x) in Kasteleyn system of relations, and then we assign the solution v at the internal black vertex b to the wave function ψ at the corresponding double points of Γ at time ⃗ x.
The normalized wave function is then extended to the whole Γ {P 0 } meromorphically in the spectral parameter. The reality and regularity property of the divisor on Γ follows from the total non-negativity of the soliton data (Theorem 6.10). Finally the KP divisor on Γ constructed using Kasteleyn system of relations is equivalent to that in [6]. In that paper the geometric system of relation was used on a more general class of graphs. However the present construction is technically simpler, and automatically ensures the independence of the KP divisor on the gauge freedoms of the graph since it is done on undirected networks.

Totally non-negative Grassmannians and almost perfect matchings on planar bipartite graphs in the disk
In this Section we briefly review the properties of totally non-negative Grassmannians necessary in the following Sections and, in particular, their relation to almost perfect matchings on planar bipartite graphs in the disk. We mainly follow [54,45] and [55]. We remark that totally non negative Grassmannians are a special case of the generalization of classical positivity to generalized partial flag varieties by Lusztig [47].
Definition 2.1. Totally non-negative Grassmannian [54]. Let M at TNN k,n denote the set of real k × n matrices of maximal rank k with non-negative maximal minors ∆ I (A). Let GL + k be the group of k × k matrices with positive determinants. Then the totally non-negative Grassmannian Gr TNN (k, n) is In the theory of totally non-negative Grassmannians an important role is played by the positroid stratification. Each cell in this stratification is defined as the intersection of a Gelfand-Serganova stratum [28,27] with the totally non-negative part of the Grassmannian. More precisely: Definition 2.2. Positroid stratification [54]. Let M be a matroid i.e. a collection of k-element ordered subsets I in [n], satisfying the exchange axiom (see, for example [28,27]  The definition means that a positroid M is a realizable matroid represented by k × n real matrices with positive maximal minors when the ordered column set I = {1 ≤ i 1 < ⋯ < i k ≤ n} ∈ M, and zero maximal minors otherwise. Every positroid cell is homeomorphic to an open ball of finite dimension [54]. The combinatorial classification of all non-empty positroid cells was obtained in [54], where in particular the equivalence classes of planar bicolored (plabic) graphs representing positroid cells were classified, and an explicit and relevant minimal parametrization of each positroid cell S TNN M was obtained using reduced plabic networks in the disk.
The class of graphs considered throughout this paper are reduced planar bipartite graphs in the disk on which there exists at least one almost perfect matching; such condition is equivalent to the requirement that the graph possesses a perfect orientation [55]. We recall that a perfect orientation O of a bicolored graph G is a choice of directions of its edges such that each black internal vertex b is incident to exactly one edge directed away from b, and each white internal vertex w is incident to exactly one edge directed towards w. A graph is perfectly orientable if it possesses a perfect orientation. Definition 2.3. Planar bipartite graph in the disk We call planar bipartite graph in the disk an undirected planar graph drawn inside a disk, G = (V, E), with finite vertex set V and finite edge set E, such that: (1) Internal vertices are strictly inside the disk and are either black or white; since they share the same value of the decorated permutation π = (6, 1, 2, 5, 4, 3).
(2) There are n > 0 boundary vertices on the boundary of the disk labeled b 1 , . . . , b n , in clockwise order. Boundary vertices share the same color and have degree one; (3) Each edge in G joins two vertices of different color; (4) G is perfectly orientable. In the following we denote B and W respectively the set of black and of white vertices.
In Figure 1 we show a planar bipartite graph in the disk. Let (G, O) denote the directed graph G with a perfect orientation O. Then the source set I = I(O) ⊂ [n] is the set of i such that b i is a boundary source of (G, O), similarly b j is a boundary sink for all j ∈Ī.
Proposition 2.4. [54] Let G be as in Definition 2.3. Then all of its perfect orientations have source sets of equal cardinality and G is called of type (k, n) if source sets have cardinality k.
Moreover, let M G be the collection of the k-subsets I(O) of its perfect orientations: Then M G is a positroid.
The graph in Figure 1 represents the positroid cell S TNN M ⊂ Gr TNN (3,6) such that I ∈ M if and only if I = {1, 2, 3}. Indeed it is easy to check that there is no perfect orientation only for the source set b 1 , b 2 , b 3 . Definition 2.5. Reduced planar bipartite graph in the disk A graph G as in Definition 2.3 is reduced if moreover (1) Every component of G contains at least one boundary vertex; (2) Every internal vertex of degree 1 is adjacent to a boundary vertex: (3) There is at most one edge sharing a pair of vertices b, w; (4) The number of faces of G is minimal among graphs with the same positroid.
Positroids in Gr TNN (k, n) are in bijection with the following objects [54]: decorated permutations on n letters with k weak excedances and with Le-diagrams of type (k, n).
The decorated permutation π = π(M) may be computed using oriented strands on a reduced bipartite graph G = G(M) [54]: each internal edge intersects transversely two strands at the midpoint, whereas at the boundary edges the strands terminate at the boundary vertex as shown in Figure 2. Then π(i) is the boundary destination of the strand starting at the boundary vertex i. In Figure 3 [left] the reduced graph corresponds to π = (6, 1, 2, 5, 4, 3). The excedances π(1) and π(4) imply that the lexicographically minimal base in the corresponding matroid M is {1, 4}, therefore G represents a positroid cell in Gr TNN (2, 6). A Le-diagram L of type (k, n) is a Young diagram in the k × (n − k) rectangle together with a filling of 0, 1s such that there is no 0 which has a 1 above it in the same column and a 1 to the left in the same row [54]. The total number of 1s is the dimension of the corresponding positroid cell S TNN M [54]. If one labels the southeast border of the Le-diagram L with the numbers 1, 2, . . . , n starting from the northeast corner, then the labels of the vertical edges of the border form the lexicographically minimal base of the positroid M represented by L. In Figure 3 [center] we show an example: the Le-diagram represents a four-dimensional positroid cell in Gr TNN (2, 6) with lexicograhically minimal base {1, 4}.
One may compute π also using Le-diagrams [38]: first one replaces each 1 with an elbow and each 0 with a cross. Then one labels the northeast destination of each pipe with the same label of its southeast starting point. π is then computed as follows: if i labels a vertical edge on the southeast border then π(i) is the label on the same row on the west border; if i labels an horizontal edge on the southeast border then π(i) is the label on the same column on the northern border (see Figure 3 [right]).
The Le-graph Each positroid cell S TNN M is represented by at least one reduced graph [54]. The bipartite Le-graph representing the positroid cell S TNN M is a reduced graph constructed directly from the Le-diagram L = L(S TNN M ) as follows [54]. It is obtained putting a black vertex in the middle of each segment of the southeast border of L; if the border segment is vertical, one also adds a white vertex next to it and a horizontal edge; finally, in the middle of each Le-box filled by 1 one inserts a hook with a white vertex on the left and a black vertex on the right (see Figure 4 [left]). Then, for each box filled by 1, the horizontal half-edge starting at the black vertex is prolonged to the nearest white vertex on the right, and the vertical half-edge starting at the white vertex is prolonged to its nearest black vertex downwards. The boundary of the Young diagram is the boundary of the disk. In Figure 4 [right] we construct the Le-graph for the positroid cell of Figure 3.    Figure 5. The graph, the derangement and the Le-diagram of the positroid cell in Gr TNN (4,6) dual to that in Figure 3.
If π is the derangement representing M, then the derangementπ representing M isπ = π −1 [54]. In Figure 5 we show the effect of the duality transformation of positroids for the cell of Figure 3. The dual cell is four-dimensional in Gr TNN (4, 6) with derangementπ = π −1 = (2, 3, 6, 5, 4, 1). In Figure 1 [right] we show an almost perfect matching. If the boundary vertices are colored black, B − W = n − k and each almost perfect matching uses k boundary vertices. If the boundary vertices are colored white, W − B = k and the set of boundary vertices used in each matching is n − k. If we release the requirement that boundary vertices share the same color, the boundary of each matching of G has size k = #(white vertices) − #(black vertices) + #(black boundary vertices).
In [55] perfect orientations of G are shown to be in bijection with almost perfect matchings in G. Therefore the following statement holds true. In this paper we are interested in networks of graph G with real positive weights assigned either to the edges of G or to its faces. In [54] a natural minimal parametrization of each given positroid cell S TNN M ⊂ Gr TNN (k, n) is obtained in terms of face weights on reduced graphs representing S TNN M . Notation for edges on undirected and on directed graphs If the graph is undirected, the edge e connecting the black vertex b and the white vertex w will be denoted e = bw. If the graph is directed, the edge e starting at the vertex u and ending at the vertex v, will be denoted e = → uv. Terminology for faces A face Ω is internal if its boundary has empty intersection with the boundary of the disk, otherwise it is an external face. There is a unique external face including the boundary segment from b n to b 1 clockwise and we call it the infinite face. All other faces are called finite.
If G possesses g + 1 faces, we label the finite faces Ω i , i ∈ [g], and denote Ω 0 the infinite face. The same labeling rule applies to face weights.   Figure 7[left] for an example).
There is a natural way to pass from the face weights to the edge weights on undirected or directed networks.
The rule for assigning weights on undirected and on directed networks If G is undirected, let us label in clockwise order the vertices bounding a given face Ω, b 1 , w 1 , b 2 , . . . , b l , w l . Then the relation between the face weight f Ω and the edge weights t biwj is with obvious modifications if Ω is an external face (see Figure 6 [center]). If G is directed, the face weight is obtained multiplying the edge weights for the edges bounding Ω and directed anticlockwise, and dividing the edge weights for the edges bounding Ω and directed clockwise (see Figure 6 [right]). These two rules may be easily combined in an explicit transformation between edge weights for undirected and directed graphs with equal face weights: uv has weight t e , then the directed edge e ′ = → vu has weight t e ′ = t −1 e . We illustrate these rules in Figure 7, where we only write edge weights different from 1.
If the face weights are all real and positive (complex non-zero), there is more than one way to assign real positive (complex non-zero) edge weights to the graph following the above rules. We illustrate the weight gauge transformation only in the case of positive weights; in the case of complex non-zero weights it is sufficient to replace everywhere c > 0 with c complex non-zero in the formulas (2.5) and (2.6).
The weight gauge for undirected and for directed networks If the graph is undirected and t e > 0, e ∈ E, is a solution to the system (2.3) at the faces of G, then the following gauge transformation at an internal vertex v gives another solution for any given c > 0: (2.5) t ′ e = ct e , if v bounds e, t e , otherwise. Two reduced networks sharing the same graph for two sets of real positive edge weights represent the same point in the totally non-negative Grassmannian if and only if the edge weights can be obtained by composing transformations (2.5) at the internal vertices of the graph. We remark that on unreduced graphs there is extra gauge freedom [54]. If the graph is directed and we assign a positive number c v to each internal vertex v and the directed edge e = → uv has initial weight t e then the gauge equivalent network has edge weight t ′ e with (2. 6) t ′ e = c u c −1 v t e . Again, two networks on a perfectly orientated reduced graph are equivalent if and only if their edge weights are related by (2.6).
In [54], for any given oriented planar network in the disk, the formal boundary measurement map is defined as where I is the base for the given orientation, the sum is over all directed paths P from the source b i to the sink b j , wt(P ) is the product of the edge weights of P (counting multiplicities if an edge appears more than once in P ), and Wind(P ) is its topological winding index (see [54]). These formal power series sum up to subtraction free rational expressions in the weights [54] and, for directed networks, their explicit expression in function of flows and conservative flows is provided in [61]. Let I be the base inducing the orientation of the network N = (G, O(I), f ) used in the computation of the boundary measurement map. Then (see [54]), for each choice of positive edge weights associated to f , the image of the boundary measurement map is the point [A bmm ] ∈ S TNN M ⊂ Gr TNN (k, n) represented by the boundary measurement matrix A ≡ A bmm such that: • The submatrix A I in the column set I is the identity matrix; • The remaining entries A r j = (−1) σ(ir,j) M ij , r ∈ [k], j ∈Ī, where σ(i r , j) is the number of elements of I strictly between i r and j. The point [A bmm ] ∈ S TNN M is a function of the face weights f , and is independent on both the perfect orientation of G and the weight gauge [54]. Finally, if S TNN M is an irreducible positroid cell, then the reduced row echelon matrix contains neither zero columns nor rows with just the pivot entry different from zero.
In [54] the graphs representing the same positroid M are classified. In this equivalence class a special role is played by reduced graphs. Indeed, if the graph is reduced, the boundary measurement map modulo the weight gauge equivalence is a homeomorphism from R g + to S TNN M , where g is the dimension of the positroid cell represented by G [54].
Postnikov also classifies the network transformations which preserve the value of the boundary measurement map [A bmm ]. Since we use only reduced networks, we just need to define the actions of moves; for the reductions see [54]. The possible moves for undirected bipartite networks are: (1) Contraction/expansion of a vertex Any degree 2 internal vertex not adjacent to a boundary vertex can be deleted and the two adjacent vertices merged (see Figure 8 [left]). With the inverse operation one splits an internal vertex into two vertices and inserts a degree 2 vertex of opposite color assigning unit weight to the new edges. (2) Removal/addition of a boundary-adjacent vertex Any degree 2 internal vertex adjacent to the boundary may be removed, the boundary vertex changes color and the two edges become a single edge as in Figure 8 [center]. With the inverse operation one adds a degree 2 vertex in the middle of a boundary-adjacent edge, changes the color of the boundary vertex and assigns unit weight to the new edge. (3) Square move It is the transformation shown in Figure 8 [right] and is the only untrivial one since face weights are changed. The graph in Figure 3 [left] is equivalent to the Le-graph in Figure 4 via the contraction of bivalent vertices. The corresponding formulas for the same moves on directed bipartite graphs may be easily obtained using (2.4). We remark that by repeated expansions one may always arrive to graphs with vertex degrees no more than 3.
An alternative characterization of the boundary measurement map using almost perfect matchings on bipartite graphs is provided in [45] where its equivalence with the boundary measurement map is proven using the characterization of the latter in terms of flows on directed graphs by Talaska [61] and the bijection between flows and almost perfect matchings proven in [55]. For any k-element subset I ⊂ [n] define the partition function D I as the sum of the monomials for the matchings with boundary I: Plücker coordinates are redundant coordinates because of Plücker relations; and there exists a minimal number of D I l , l ∈ [g], where g equals the dimension of S TNN M , such that all other Plücker coordinates may be expressed as subtraction free rational expressions of the D I l . Such a set of Plücker coordinates forms a totally positive base in the sense of Fomin and Zelevinsky [24]. An explicit totally positive base was constructed in [60] using Le-diagrams, whereas almost perfect matchings on reduced planar bipartite networks are used in [49] (see also [52]) for the same purpose.

Kasteleyn matrices on planar bipartite networks in the disk
In this Section, given G, a planar bipartite reduced graph in the disk representing an irreducible positroid cell S TNN M ⊂ Gr TNN (k, n), we introduce a Kasteleyn signature on G: such a signature is an assignment of ±1 to the edges fulfilling (3.1). We then prove that this signature realizes the variant of Kasteleyn theorem in [59]: 1) maximal minors of the B × W Kasteleyn matrix share the same sign and count the number of almost perfect matchings of G with given boundary conditions; 2) equivalence classes of weighted Kasteleyn matrices provide a parametrization of S TNN M . We remark that the transpose of a Kasteleyn matrix is a Kasteleyn matrix of a point in the dual cell S TNN M . Remark 3.1. The reduced property of the graph is a sufficient condition to avoid zero elements in the systems of relations studied throughout the paper. Instead the irreducibility of the positroid cell just simplifies the overall construction.  Figure 9. A Kasteleyn signature for the reduced planar bipartite graph in the disk of Figure   1. Labels of the boundary vertices have been changed to be consistent with the notation of Definition 3.10.
where Ω denotes the number of edges bounding the face Ω, and σ(Ω) is the total signature of the face Ω of G, that is the product over all edges e ∈ ∂Ω of the edge signature σ(e): In Figure 9 we show a Kasteleyn signature for the reduced graph of Figure 1. Remark 3.4. In [8] it is called Kasteleyn a signature which satisfies (3.1) at the internal faces and depends also on the number of boundary vertices at the external faces. We compare the properties of the two signatures in Section 4.1.
Next Proposition is the restatement of a classical Lemma by Kasteleyn [33] in the present setting. If the reduced graph G is move equivalent to the Le-graph via a finite sequence of contraction/expansions at internal vertices and square moves, one can obtain a Kasteleyn signature on G using the transformation of face signatures under the action of the moves illustrated in Figure 10.
The removal/addition of a boundary-adjacent vertex must involve all boundary vertices in order to keep the even parity property of the external faces. If one adds a boundary-adjacent vertex next to each boundary vertex and call e j the edge added to the boundary vertex b j , j ∈ [n]. If σ is the Kasteleyn signature on the initial graph, then the signature σ ′ on the transformed graph such that if e is an edge common to both graphs; is Kasteleyn. We illustrate an example of such move in Figures 11 and 12 [left]. The explicit transformation in the case of removal of boundary-adjacent vertices follows along similar lines. Remark 3.6. In Section 5 we illustrate an alternative method to construct Kasteleyn signatures using the geometric signatures introduced in [5].
There is of course not a unique Kasteleyn signature for a given graph G. As in the case of lattices with periodic boundary conditions [34], a vertex gauge transformation fully characterizes equivalent signatures on plabic graphs in the disk.   In one direction the proof is obvious, in the other direction the proof follows as in [34] identifying the boundary vertices.
A Kasteleyn matrix K σ is associated to any given Kasteleyn signature σ. , we label the white vertices from 1 to W , and the black vertices from 1 to B , so that the boundary vertices share the highest labels of their color and are labeled in increasing order clockwise. Then the B × W Kasteleyn sign matrix K σ associated to such data is If one assigns positive weights to the edges of G, t ∶ E ↦ R + , the weighted Kasteleyn matrix K σ,wt , is In the next Theorem we show that K σ satisfies the variant of Kasteleyn theorem proven in [59]: the maximal minors of K σ indexed by the boundary dimer configurations share the same sign and count the number of almost perfect matchings of G. To fix ideas we choose the black color for the boundary vertices.
Theorem 3.11. The number of almost perfect matchings and the minors of K σ Let G be a planar bipartite graph in the disk with black boundary vertices representing the positroid cell S TNN M ⊂ Gr TNN (k, n). Let N be the number of internal black vertices of G, so that W = N + k. Assume a labeling of vertices such that boundary vertices are labeled clockwise in increasing order b N +1 , . . . , b N +n . Let σ be a Kasteleyn signature on G and K σ be its Kasteleyn sign matrix. For any k element subset I of ∂G, let K I be the submatrix of K σ using all columns, the first N rows and the additional k rows indexed by I. Then (1) For any pair of k-element subsets I, J the determinants of the submatrices K I , K J share the same sign, (2) The absolute value of det(K I ) is ∆(G, I), the number of almost perfect matchings M in G such that ∂M = I, Proof. The proof is a straightforward adaptation of the original Kasteleyn Theorem [33,34] to the present setting. First we check (3.9). Let B i and B I respectively denote the set of internal black vertices of G and that of the boundary vertices indexed by I. By definition where the summation is over all bijections h ∶ W ↦ B i ∪ B I . Since K h(w),w = 0 if and only if there is an edge joining w and h(w), the non zero terms contributing to the determinant correspond exactly to the almost perfect matchings π using the boundary vertices B I . Therefore is the same for all matchings sharing the same boundary vertices. Indeed, if π, π ′ are two such matchings, then their union is a set of simple cycles and double edges and the statement easily follows using Definition 3.2. Next let us prove (3.8). It is sufficient to check the formula in the case J = I {i} ∪ {j}. Let π, π ′ be two almost perfect matchings respectively for the boundary sets I, J. Then π ∪ π ′ is a Temperley-Lieb subgraph, that is the union of simple cycles, double edges and a path from b N +i to b N +j . If j = i + 1, then the statement follows identifying the two boundary vertices so to obtain a cycle with flat curvature. In the case j = i + l, with l > 1, then the boundary vertices b N +i+1 , . . . b N +j−1 are either used by both π and π ′ or not used. Then again identifying b N +i and b N +j we obtain a cycle with flat curvature and the statement follows.
Remark 3.12. Since the sign of the minors changes by exchanging two consecutive rows, in the rest of the paper we assume a labeling of the internal vertices such that det(K I ) ≥ 0 for all k-element subsets. Lemma 3.14. The point [A σ,wt ] is the same for gauge equivalent edge weightings on G. Moreover, if σ ′ is another Kasteleyn signature in the equivalence class for G and the face weights are kept fixed, then , that is for a given graph it is a function of the face weights f . Finally if the networks (G ′ , f ′ ) and (G, f ) are move equivalent, then for any Kasteleyn signature σ on G and σ ′ on G ′ , the points in the Grassmannian constructed using the respective Kasteleyn matrices coincide: . Therefore given the (move equivalence class of the) network (G, f ), there exists a unique point in Π M which we denote such that the Plücker coordinates of its representative matrix A σ,wt are defined in (3.10).
The proof of the above Lemma is trivial taking into account the action of (2.5) on the edge weights, the characterization of gauge equivalent signatures in Proposition 3.9 and the action of the moves on signatures.  .10)). In the previous Section we have recalled that [45]. In [59] it is proven that, if σ is a signature such that Theorem 3.11 holds and t b,w is a positive edge weighting on the graph, then In the following, we simplify notations to Remark 3.16. Alternative proof of Theorem 3.15 using geometric signatures In [5] (see also Section 5), geometric signatures on directed plabic graphs are introduced and it is proven that they induce Postnikov boundary measurement map for any choice of positive face weights. In Theorem 5.20 we explain the relation between geometric and Kasteleyn signatures. Therefore Theorem 3.15 follows also from the relation between these two signatures (see Corollary 5.23).
If one chooses G with black boundary vertices, it is easy to reconstruct a representative k × n matrix of [A] starting from (K σ,wt ) T , the transpose of K σ,wt [59]: applying row operations one can transform (K σ,wt ) T into a matrix in block form  Let us illustrate the construction of K σ,wt and of [A kas ] for the network shown in Figure 11. Figure 11. A choice of Kasteleyn signature and face weights for a network with the reduced graph of Figure 3. The relation between face and edge weights is as in (3.14).
Example 3.19. Let N be the reduced bipartite network in Figure 11 representing a point in the positroid cell in Gr TNN (2, 6) of Figure 3 where the face weights f 1 , . . . , f 4 are assumed positive. A possible minimal positive edge weight parametrization, t 21 , t 11 , t 53 , t 72 , is obtained using (2.3) where all other edges carry unit weights. A Kasteleyn signature satisfying Definition 3.2 is marked with ± on the edges of N in the Figure. The transpose of the weighted Kasteleyn matrix (3.10) is then Upon transforming (K σ,wt ) T into the block form (3.13), is identified by the submatrix A in the SE block; its reduced row echelon form is We remark that, in agreement with Theorem 3.15, A RREF coincides with the matrix in Postnikov construction [54] for the same choice of face weights and the acyclic orientation of G with respect to the lexicographically minimal base {1, 4}.  (1) G is the dual graph to G obtained by changing the color of all vertices of G, boundary vertices included; In Figure 12 we assume that the face weights are real and positive: then the network on the left represents a point in S TNN M ⊂ Gr TNN (2,6) where the cell is the same as in Figure 3, whereas the one on the right represents the dual point in S TNN M ⊂ Gr TNN (4, 6) for the cell of Figure 5.  is the dual positroid cell of Definition 2.6. Finally, if K σ,wt is a weighted Kasteleyn matrix for the network (G, f ) and the Kasteleyn signature σ, then its transpose, (K σ,wt ) T is a Kasteleyn matrix for the dual network (G, 1 f ). In this case, the transformation of K σ,wt into the block form provides a representative matrixĀ of [Ā].
Proof. The transformed graph represents the dual positroid cell Π M , and the face transformation preserves the total non-negativity property. It is also evident that the Kasteleyn weighted matrices of the dual networks are related by transposition (the labeling of the black (respectively white) vertices of G becomes the labeling of the white (respectively black) vertices of G). Therefore where σ is a Kasteleyn signature for G = (B ∪ W, E), and we assume a labeling of the vertices satisfying Definition 3.10 and Remark 3.12. Finally, the transformation of K σ,wt into the block form satisfies (3.18).
This map looks similar to the twist map studied in [52] to relate Postnikov parametrization to the one introduced in [49] using dimer partitions, but this is not so. Indeed in our setting the transformed point Let us apply the duality transformation to the Example of the previous Section.
Using the correspondence det The network in Figure 12[right] represents its dual point in Gr TNN (4, 6) and is obtained changing the color of all vertices and inverting the face weights. By construction (K σ,wt ) T is the Kasteleyn matrix of such dual network. Upon transforming (K σ,wt ) T into the block form,

Kasteleyn systems of relations
In this Section we characterize Kasteleyn systems of relations on planar bipartite graphs in the disk with black boundary vertices, and discuss their properties for the natural choices V = C n−k , R n . Then in Section 6 we use Kasteleyn system for V the space of polynomials in a finite number of variables to solve a spectral problem in KP theory. If V = C n−k , the solution at the boundary vertices embeds a duality transformation between positroid varieties different from the one of Proposition 3.21 since it does not preserve total positivity, whereas in the case V = R n the solution at the boundary vertices allows to reconstruct the point in the positroid cell S TNN M represented by the network when edge weights are positive. In Section 4.1 we compare a different variant of Kasteleyn theorem recently proposed in [8] to the present construction. We use both the representation of systems of relations on bipartite graphs introduced in [8] and that in [45].
is an element in the vector space V assigned to the black vertex b ∈ B; (2) At any given white vertex w ∈ W, the variables v (k) b satisfy the linear relation where K σ,wt bw is the weighted Kasteleyn matrix defined in (3.7).
Since the Kasteleyn matrix has full rank W , the kernel of the linear operator R w has dimension n − k. Therefore a natural choice for the vector space is V = C n−k . Let us denote v is an element in the vector space V assigned to the white vertex w ∈ W, and, at any given black vertex b ∈ B, the variablesv .7). All results in this Section hold with obvious modifications in this case as well after replacing n − k with k.
Next let us classify the solutions to the linear system. Then the (n − k) × n matrixĀ o whose columns are the ordered vectors at the boundary vertices, , is a representative matrix of [A], then Moreover, if u (k) is another solution fulfilling Proposition 4.2 for the given choice of edge weights, then the (n − k) × n matrix (u (1) G is the dual graph to G obtained from it changing the color of all vertices, boundary vertices included; if Ω i is an internal face, if Ω i is an external finite face and 2b Ωi is the number of boundary vertices bounding Ω i ,  We remark that if face weights are positive in the initial network, at least one face weightf ′ i is negative. Therefore the transformation between dual positroid varieties described by (4.3) does not preserve the total non-negativity property since There is a second interpretation for the system of relations of Definition 4.1. Indeed we may freely assign quantities to n − k boundary vertices b j , j ∈Ī, for some I ∈ M(G), and solve the resulting W × W linear system in the W unknowns v where E ir is the i r -th vector of the canonical basis and A[r] is the r-th row of A.
Proof. (4.7) and the fact that v  ∈ R n at all vertices using the relation between Kasteleyn and geometric systems of relations, and the solution to the geometric system of relations in terms of flows and conservative flows proved in [5].   Figure 13).
(1) First we solve system (4.9) using Theorem 4.5 so that v (k) are 6-dimensional row vectors. In such case, we choose a base I ∈ M and assign the canonical basis vectors to v :

Its solution at the boundary vertices
, v  (2) If we use Theorem 4.4, the variables v are 4-dimensional column vectors. We have three relations at the white vertices and A ⋅ (Ā o ) T = 0 with A is as in (4.8).

Weak Kasteleyn signatures and duality relations in positroid varieties.
In this Section we recall the definition and properties of another variant of Kasteleyn Theorem proposed in [8] naturally connected to Postnikov boundary measurement map. In the following, we call weak the Kasteleyn signature introduced in [8]; this terminology is appropriate since the absolute value of the maximal minors of the Kasteleyn matrix of [8] give the number of almost perfect matchings with prescribed boundary conditions; however they do not share the same sign. Finally we complete the proof of Theorem 4.4. the B × W weak Kasteleyn sign matrixKσ associated to such data is If t ∶ E ↦ C * is an edge weighting of G, then the weighted weak Kasteleyn matrixKσ ,wt is   Gr TNN (k, n) and let σ be a Kasteleyn signature on it satisfying Definition 3.2. Assume that the initial graph G has r = N + k white vertices and N + n black vertices. LetG be the bipartite graph obtained from G adding a black boundary-adjacent vertex b N +j next to each boundary vertex, changing the color of the boundary vertices to white, relabeling the boundary vertices w r+j , and assigning unit weight to the added edges e j = b N +j w r+j , j ∈ [n]. The transformed graphG has N + n black vertices and r + n white vertices. Then the signature is a weak Kasteleyn signature onG. Finally any weak Kasteleyn signature onG is equivalent to that defined in (4.12) up to the gauge transformation of Definition 3.8.
Proof. The number of edges and the signatures are the same at each internal face. At the finite external faces the total signatures are the same but the number of edges differ by 2 b Ω .
The relation of weak Kasteleyn signatures to the boundary measurement map has been proven in [8]. In next Theorem we prove a weaker version of such result assuming that the graphs are related as in Proposition 4.10. (G, f ). Let t ∶ G ↦ C * be an edge weighting in the equivalence class represented by f , and lett be the edge weighting onG such thatt e = t e for any edge common to G andG, andt ej = 1, j ∈ [n].
Let σ be a Kasteleyn signature on G andσ be the weak Kasteleyn signature onG fulfilling (4.12). LetK ≡Kσ ,wt be the corresponding weighted weak Kasteleyn matrix. Then, for any k-element subset I = {1 ≤ i 1 < i 2 < ⋅ ⋅ ⋅ < i k ≤ n} the Plücker coordinates of A are Proof. Under the hypotheses, the weak Kasteleyn matrixK for (G,σ) is obtained from the Kasteleyn matrix K for (G, σ) by adding to its right a block containing the identity matrix Therefore, if we use (3.13) to transformK into block form, we get  Next, if one introduces the system of relations for the weak signature, then its kernel provides the point [A] ∈ Π M represented by the given network [8]. (1)ṽ (k) w is an element in the vector space C k assigned to the white vertex w ∈ W; (2) At any given black vertex b ∈ B, the variablesṽ  Then, there exist solutions to the above system such that the vectors at the boundary vertices {ṽ (k) i , i ∈ [n]} span R k , and in such case the k × n matrix A whose columns are the vectorsṽ , at the boundary vertices, . By Theorem 4.13,Ã is orthogonal to A: Next, let N ′ = (G, f ′ ), be the network such that if Ω i is an internal face, (1)G ′ is the dual graph toG obtained by changing the color of all vertices ofG, boundary vertices included; Ωi is the number of boundary vertices bounding the face Ω i and thus it satisfies (4.4).
We illustrate Theorem 4.4 and the duality relations of the two Kasteleyn signatures for the networks in Figure 15. The two networks represent distinct points in the positroid variety Π M ⊂ Gr(2, 6) indexed by the derangement π = (6, 1, 2, 5, 4, 3): indeed they share the same graph, but have different face weights. Assume f i > 0, i ∈ [4]. The graph on the left has face weights f = (f 1 , f 2 , f 3 , f 4 ) and has a weak Kasteleyn signature, whereas on the right graph the face weights (4.19) and the signature is Kasteleyn. We mark in blue the edge weights different from one on the graphs.
The weighted weak Kasteleyn matrix for the network (G, f ) and the weighted Kasteleyn matrix for the network (G, f ′ ) coincide and we denote both of themK,

Applying Theorem 4.13, a matrix for the point [A] ∈ S TNN
Then Theorem 3.17 provides a matrix for the point [A ′ ] ∈ Π M S TNN M ⊂ Gr(2, 6) Gr TNN (2, 6) represented by the network (G, f ′ ):  Signatures on oriented graphs form equivalence classes with respect to the following gauge equivalence transformation. (1) and (2) be two signatures on the perfectly oriented reduced bipartite graph (G, O). We say that the two signatures are equivalent if there exists an index η(u) ∈ {0, 1} at each internal vertex u such that

Definition 4.15. Equivalence between edge signatures Let
if e = → uv is the edge at the boundary sink v, (1) if e = → uv is the edge at the boundary source u.
If a system of relations has full rank for one signature, it has also full rank for any other signature equivalent to it and the solution at the boundary vertices is the same [45].
Next, let us reformulate Kasteleyn system of relations as a Lam system for half-edge variables.  u,e ∈ V be the Lam variables in Definition 4.14 where we use (2.4) to pass to the edge weights on the directed graph: , v = w. Then Lam system of relations for the signature (k) is equivalent to Kasteleyn system of relations for the signature σ using the following correspondence: at any given black vertex b ∈ B and for any edge e at b; at any given white vertex w ∈ W and for any edge e at w. Therefore Theorems 4.4 and 4.5 may be reformulated for Lam system of relations. In particular, if V = R n and we restrict ourselves to equivalence classes of positive edge weights, then the solution to Lam system of relations at the boundary vertices induces Postnikov boundary measurement map.
Corollary 4.17. Invariance of the signature (k) Let be a signature in the equivalence class of (k) on the perfectly oriented graph (G, O). Then Lam system of relations for the signature has full rank for any choice of positive real weights and for any perfect orientation of G.

The geometric nature of Kasteleyn signatures
In this Section we investigate the geometric nature of Kasteleyn signatures by reformulating the results in [5,7] in the setting of perfectly orientable reduced bipartite graphs, and providing the explicit relation between Kasteleyn and geometric signatures (Theorem 5.20). For the wider class of planar bicolored graphs used in [5], formula (5.22) in Theorem 5.20 defines the natural candidate for a Kasteleyn signature. Therefore we conjecture that geometric signatures explicitly realize Kasteleyn signatures for the more general variant of Kasteleyn Theorem in [59], and are therefore naturally connected to dimer models also for the more general class of graphs used in [5].
The main consequence of Theorem 5.20 is Formula (5.24) in Theorem 5.22 which provides the explicit solution of Kasteleyn system of relations in terms of edge flows and conservative flows on the perfectly oriented network.

5.1.
Loop erased walks, edge flows and the geometric construction of vectors on edges. In [5] the components of the edge vectors have been defined through summations over all walks sharing both the initial edge and the final destination to the boundary, and they have been computed explicitly using loop-erased walks [23,46] and flows [61]. Below we recall these results restricting ourselves to reduced planar bipartite networks in the disk with black boundary vertices.
In [5] the many gauge freedoms on the graph are fixed introducing a gauge ray direction. A geometric signature is then assigned to each path in terms of the summation of the local winding number between consecutive edges, and of the number of intersections of its edges with the gauge rays starting at the boundary sources.
Definition 5.1. The gauge ray direction l. A gauge ray direction is an oriented direction l with the following properties: (1) The ray with the direction l starting at a boundary vertex points inside the disk; (2) No internal edge is parallel to this direction; (3) All rays starting at boundary vertices do not contain internal vertices.
The first property may always be satisfied since one may deform the boundary of the disk so that all boundary vertices lie at a common straight interval.
Gauge ray directions were used in [26] to measure the local winding number. The local winding number between a pair of consecutive edges e k , e k+1 measures whether or not the triple (e k , l, e k+1 ) is ordered, and the sign depends on whether such ordering is clockwise or counterclockwise. Next, one counts the intersections of gauge rays with a given path using the rays l ir parallel to l and starting at the boundary source vertices b ir , r ∈ [k], where I = {i 1 < i 2 < ⋯ < i k } is the base of the given perfect orientation (see Figure 16 for an example). In Figure 16 we illustrate the above definitions. It is straightforward to check that int(e 32 ) = 1, int(e 20 ) = int(e 12 ) = −1, wind(e 32 , e 20 ) = −1, wind(e 01 , e 12 ) = 0.
Next we adapt the construction of edge vectors in [5] to the case of bipartite graphs and introduce a system of edge vectors for all edges e with initial vertex colored black. In [5] edge vectors are defined also when the starting vertex is white since the directed graph is not assumed to be bipartite.
Remark 5.4. In the following, we assign the edge vector at e = → bw to its initial black vertex b since there is a unique edge starting at b in a perfectly oriented graph. For this reason we modify the notation of [5] and denote edge vectors E b where b is the initial vertex of the path. If there is no path from b to b j , the j-th component of E b is assigned to be zero.
In particular, by definition, if e = → bb j , with b j boundary sink, then the vector E b is Next, (5.3) is expressed as a summation over equivalence classes of walks using the notion of looperased walk. Loop-erased walks are extensively used in the study of random walks [46] and have been reformulated for directed graphs in [23] to prove the total non-negativity property of the boundary measurement matrix in terms of infinite summations over edge weights.
Definition 5.6. Edge loop-erased walks. Let G = (B ∪ W, E) be a perfectly oriented planar bipartite graph in the disk with black boundary vertices. Let P be a walk given by where V 0 = b ∈ V is the initial black vertex of the edge e. The loop-erased part of P , denoted LE(P ), is defined recursively as follows. If P does not pass any edge twice, then LE(P ) = P . Otherwise, set LE(P ) = LE(P 0 ), where P 0 is obtained from P removing the first loop it makes; more precisely, given all pairs l, s with s > l and e l = e s , one chooses the one with the smallest values of l and s and removes the cycle Remark 5.7. For initial black vertices, the definition of edge-loop erased walk coincides with the definition of loop-erased walk in [23]. If the initial vertex of the walk is white, the above definition does not coincide with that in [23] (see [7]).
With this procedure, to each walk starting at e = (b e , w e ) and ending at the boundary sink b j , one associates a unique edge loop-erased walk LE(P ), where the latter walk is acyclic. Then one formally reshuffles the summation over infinitely many paths starting at b e and ending at b j to a summation over the finite number S of equivalence classes [LE(P s )], each one consisting of all walks sharing the same edge loop-erased walk, LE(P s ), s ∈ [S]. Let us remark that int(P ) − int(LE(P s )) = 0 (mod 2) for any P ∈ [LE(P s )], and, moreover, wind(P ) − wind(LE(P s )) has the same parity as the number of simple cycles of P . Then, (5.3) is equivalent to The definitions of flows and conservative flows in [61] have been conveniently adapted in [7] to provide the explicit expression of the above summations. The conservative flows are collections of non-intersecting simple loops in the directed graph G. In our setting an edge flow F e,bj in F e,bj (G) is either an edge looperased walk P e,bj starting at the edge e and ending at the boundary sink b j or the union of P e,bj with a conservative flow with no common edges with P e,bj .
Definition 5.8. Conservative flow [61]. A collection C of distinct edges on G is called a conservative flow if (1) For each interior vertex V d in G the number of edges of C that arrive at V d is equal to the number of edges of C that leave from V d ; (2) C does not contain edges incident to the boundary. The set of all conservative flows C in G is denoted C(G).
The weight w(C) of the conservative flow C is the product of the weights of all edges in C. Unit weight is assigned to the trivial flow with no edges.
The following definition of edge flow coincides with the definition of flow in [61] if e starts at a boundary source except for winding and intersection numbers. In [7] edge flows are defined also for white vertices. (2) For each interior vertex v ≠ b e1 , the number of edges of F e that arrive at v is equal to the number of edges of F e that leave from v; (3) At b e1 the number of edges of F e that arrive at b e1 is 0; (4) It contains no edge at a boundary source, except possibly e itself. F e,bj (G) denotes the set of all edge flows F starting at the edge e and ending at the boundary sink b j in G. An element F e,bj ∈ F e,bj (G) is the union of an edge loop-erased walk P e,bj with a conservative flow with no common edges with P e,bj (this conservative flow may be the trivial one). The following triple (w(F e,bj ), wind(F e,bj ), int(F e,bj )) is assigned to F e,bj : (1) The weight w(F e,bj ) is the product of the weights of all edges in F e,bj .
(2) The generalized winding number wind(F e,bj ) is the winding number of its loop-erased part: (5.6) wind(F e,bj ) = wind(P e,bj ); (3) The intersection number int(F e,bj ) is the intersection number of its loop-erased part: (5.7) int(F e,bj ) = int(P e,bj ).
Remark 5.10. In [7] it is proven the following relation between Postnikov topological winding number of a path Wind(P ) from the boundary source b ir and the boundary sink b j , and its generalized winding number wind(P ): Wind(P ) + σ(i r , j) = wind(P ) + int(P ), mod 2, where σ(i r , j) is the number of boundary sources strictly between b ir and b j . In [7], Theorem 3.2 in [61] is adapted to prove that the components of E b defined in (5.3) are rational expressions in the weights with subtraction-free denominator and an explicit expression for them is provided in terms of edge flows and conservative flows. Then (E b ) j , the j-th component of the vector E b in (5.5) with e = → bw, is a rational expression in the edge weights with subtraction-free denominator: where notations are as in Definitions 5.8 and 5.9. Moreover, if F e,bj (G) = ∅, then (E b ) j = 0.
In particular, if the graph is acyclically oriented, then the denominator in (5.8) equals 1, and the sum wind(F ) + int(F ) is the same for all F ∈ F e,bj (G). Therefore in such case the j-th component of E b is an untrivial polynomial in the edge weights with coefficients sharing equal signs if F e,bj (G) = ∅.
Finally, if b is the boundary source b ir , then (5.8) becomes where M ij is the entry of Postnikov boundary measurement map with respect to the base I defined in (2.7), and σ(i r , j) is the number of elements of I strictly between i r and j. Therefore, if we assign the j-th canonical vectors E j to the boundary sinks b j , j ∈Ī, the edge vectors at the boundary source are , j ∈Ī, are the entries of the boundary measurement matrix A representing [A], and E ir is the i r -th canonical basis vector.
Remark 5.12. If the graph is reducible, it may happen that (E b ) j = 0 even if F e,bj (G) = ∅ [5].

5.2.
The geometric signature and the geometric system of relations. In this Section we recall the geometric formulation of a signature and of its full rank system of relations following [5], and reformulate it in a form suitable for comparison with Kasteleyn system of relations. Using the notations of Figure  17, we remark that a path with initial edge → b 3 w necessarily passes either through the vertex b 1 or b 2 (for simplicity we assume w trivalent). Then, by definition, the vectors E bi , i ∈ [3], satisfy the following geometric relation at the white vertex w: If b 3 is a boundary source, we write the above formula as (5.12) to stress the analogy between (5.10) and the solution to Kasteleyn system of relations in Theorem 4.5.
Following [5], we introduce the following signature on the edges, where notations are consistent with Figure 18. if v is a boundary sink and e 1 ends at u.
In Figure 19 we compute the geometric signature on the edges of the directed graph of Figure 16. In [5] geometric signatures are defined in the more general case of plabic graphs in the disk with no reference to the color of the boundary vertices.
In [5] it is investigated the dependence of the geometric signature on the many gauge freedoms of the graph.
Theorem 5.14. The effect of the graph transformations on (g) [5] Let G be a reduced planar bipartite graph in the disk. Then the following elementary transformations: change of orientation along a cycle, change of orientation along a simple directed path P from the boundary source b i to the boundary sink b j , change of gauge ray direction or internal vertex position change (which locally modifies winding and intersection numbers) act on the geometric signature as gauge equivalence transformations in the sense of Definition 4.15.
Therefore the equivalence class of (g) , the geometric signature of Definition 5.13, depends only on the graph. Let us denote (g) (Ω) the total contribution of (g) at the edges e bounding the face Ω:  Therefore there exists a unique geometric signature (g) on G modulo the gauge equivalence described in Definition 4.15.
The solution to Lam system of relations for the geometric signature provides a representation of the edge vectors E b equivalent to that in Theorem 5.11 and induces Postnikov boundary measurement map for the class of graphs studied in [5]. Below we restate such Theorem in the present setting.  b,e denotes the solution of Lam system of relation for the same signature (g) and identical boundary conditions at the boundary sinks, then the solutions of the two systems coincide at the boundary sources i r ∈ I: We end this Section illustrating Theorem 5.16 for the example in Figure 19.
Example 5.18. The network in Figure 19 is oriented with respect to the base I = {3, 5} and equivalent to the undirected network of Figure 11 and Example 3.19. Lam system of relations for the geometric signature of Definition 5.13 takes the following form:  Figure 19. The geometric signature of Definition(5.13) for the directed graph of Figure 16.
The directed network represents the same point in Gr(2, 6) of Figure 11.
If we assign the canonical basis vectors to the half-edges at the boundary sinks z is Postnikov boundary measurement matrix for the directed network in Figure 19 with respect to the base I = {3, 5}. If we compare this solution to that of Kasteleyn system of relations for the equivalent undirected network (see Example 4.8 (1)), for the same boundary conditions at the boundary vertices j ∈Ī, v b0,e20 , and at the boundary vertices b5,e53 . In Theorem 5.22 we indeed show that the above relations hold in general.

Geometric signatures are Kasteleyn.
From the characterization of Kasteleyn signatures on reduced bipartite graphs presented in this paper and Theorem 5.19 in [5] there follows the equivalence between geometric and Kasteleyn signatures(Theorem 5.20). Therefore explicit solutions of Kasteleyn systems of relations are expressed in terms of flows (Theorem 5.22). In particular, the equivalence between Postnikov parametrization of positroid cells via the boundary measurement map and Speyer parametrization via maximal minors of Kasteleyn weighted matrices (see [59] and Theorem 3.15) follows also from the geometric characterization of Kasteleyn signatures (Corollary 5.23).
Theorem 5.19. The total geometric signature at faces [5] Let G be a planar bicolored graph representing the irreducible positroid cell S TNN M ⊂ Gr TNN (k, n), and such that, upon fixing a perfect orientation, for any edge of G there is a directed path from boundary to boundary containing it. Let (g) be a geometric signature of G. Let (g) (Ω) = ∑ e∈∂Ω (g) (e) be the geometric signature of the face Ω, and let n w (Ω) denote the number of internal white vertices bounding Ω. Then if Ω is a finite face; if Ω is the infinite face.
If G is reduced bipartite with black boundary vertices, where Ω is the number of edges bounding the face Ω. Therefore for any given geometric signature (g) (e) on the reduced bipartite graph G, (−1) Then σ is a Kasteleyn signature on G if and only if is a geometric signature on G. Moreover in such case, for any finite face Ω, its Kasteleyn signature, σ(Ω) = ∏ e∈∂Ω σ(e), and its geometric signature (Ω) = ∑ e∈∂Ω (e), are related as follows: We conjecture that a signature satisfying (5.23) realizes the variant of Kasteleyn theorem for planar nonbipartite graphs in the disk in [59], i.e. pfaffians of the minors of the sign matrix count the number of dimer configurations in the graph involving all internal vertices exactly once with prescribed boundary conditions. We plan to discuss this issue in a different paper.
Finally the following relation holds between geometric and Kasteleyn systems of relation on a given network. Let t bw ∶ E ↦ R + be an edge weighting on the undirected graph G representing N . Let t → uv ∶ E ↦ R + be the corresponding edge weighting on the directed graph (G, O(I)) fulfilling (2.4) Let (z b,e , z w,e ) and (z bj ,e = v j ∈ R n , then the solution of the system at the black vertices is expressed in terms of edge and conservative flows on the perfectly oriented network (G, O(I), t → uv ) as in (5.15): In particular, if v j = E j ∈ R n , j ∈Ī, are the canonical basis vectors then, at the boundary sources

Construction of real regular KP divisors using Kasteleyn system of relations
The KP hierarchy is the most relevant integrable hierarchy [18,20,30,51,56], and contains as special reductions other relevant integrable hierarchies such as the Korteweg de Vries (KdV) and Boussinesq ones. In this Section we use Kasteleyn system of relations to construct real regular KP divisors on rational degenerations of M-curves for KP-II real regular multi-line soliton solutions. The present construction on undirected bipartite graphs has two main advantages: first it unveils the reason why the graph is dual to the spectral curve, second the invariance of the KP divisor is for free. Naturally, the relation between Kasteleyn and geometric signatures implies that, upon fixing the network representing the soliton data, the present construction provides the same algebraic geometric data as in [6] where directed graphs and geometric signatures were used. We remark that the class of graphs used in [6] is more ample than the present one: therefore, if Conjecture 5.21 holds true, a direct invariant construction fo the KP divisor would hold also in the more general case.
The real regular multi-line KP solitons studied in [50,48,12,14,15,37,38,1,2,3,4,6] are a family of solutions to the KP-II equation [31] (−4u t + 6uu x + u xxx ) x + 3u yy = 0, which is the first non trivial member of the KP hierarchy [63]. Before continuing, we recall that there exists another representation of this equation, called KP-I equation. In the following, we always refer to the KP-II representation since the behavior of the real solutions of the two equations is different [21]. Moreover, we use the notation ⃗ x to denote a finite sequence of KP times x j where the first three are the independent variables appearing in the KP-II equation: Real regular multi-line KP solitons correspond to a well defined reduction of the Sato Grassmannian [56], and they are parametrized by pairs (K, [A]), where K is a set of n ordered phases  Gr TNN (k, n). In particular a KP-II multi-line soliton solution is real and regular for all real times (x, y, t) if and only if its data are in the totally non-negative part of a real Grassmannian [37]. Moreover the combinatorics of totally non-negative Grassmannians has been successfully used in [15,38] to classify the asymptotic behavior (tropical limit) of this class of KP-II solutions.
The real regular multi-line KP-II soliton solutions are also degenerate finite-gap KP solutions. Krichever [39,40] showed that finite-gap KP solutions correspond to non special divisors on arbitrary algebraic curves. Dubrovin and Natanzon [21] then proved that real regular KP-II finite gap solutions correspond to non-special divisors on smooth M-curves satisfying natural reality and regularity conditions: the degree of the divisor equals the genus of the curve, the essential singularity of the KP wave function belongs to one of the ovals (called infinite) and all other ovals (called finite) contain exactly one divisor point. In [42] Krichever developed, in particular, the direct scattering transform for the real regular parabolic operators associated with the KP spectral problem and proved that the corresponding spectral curves are always M -curves, and the divisor points are located in the ovals as in [21]. In [2,4,6] it was proven that the real regular multi-line KP-II soliton solutions are degenerate finite-gap real regular KP-II solutions by providing an explicit construction of their algebraic geometric data on rational degenerations of M-curves, and by showing that they satisfy the reality and regularity conditions settled in [21].
In the direct spectral problem real regular KP-II multi-line soliton solutions are parametrized by divisors on rational curves. To the solution represented by (K, [A]) there is associated [48]: (1) A rational spectral curve Γ 0 , with a marked point P 0 (essential singularity of the wave function), and a coordinate ζ such that ζ −1 (P 0 ) = 0; (2) k simple poles D S,Γ0 ≡ D S,Γ0 (⃗ x 0 ) = {P (S) r , r ∈ [k]}, whose ζ-coordinates are real and bounded, The following two normalizations for the KP wave function are commonly used in literature: in the Sato normalization the wave functionψ(P, ⃗ x) has degree k pole divisor at P 0 and zero divisor D S,Γ0 (⃗ x), whereas in Krichever normalization the wave functionψ(P, ⃗ x) has degree k pole divisor D such that there is a time ⃗ x 0 and D = D S,Γ0 (⃗ x 0 ). Therefore one may pass from one normalization to the other through the following relationψ On Γ 0 the divisor is defined through a Sato dressing transformation of the vacuum wave function [56]. For this reason D S,Γ0 was called the Sato divisor in [2]. For the special class of multi-line solitons, such transformation is represented by a linear differential operator , are analytic in the KP-times ⃗ t, fulfil Sato equations, and are such that the kernel of D are k linearly independent solutions to the heat hierarchy of the following form The multi-line KP soliton solution then takes the form Then the Sato divisor at time ⃗ x on Γ 0 is the k-tuple In the same local coordinates the Sato wave function takes the form In the following we use Krichever normalization and an auxiliary third normalization: ψ(ζ, ⃗ x) = ζ kψ (ζ, ⃗ x), so that Therefore (6.5) that is the vector (ψ(κ 1 , ⃗ x), . . . , ψ(κ n , ⃗ x)) defines a flow in the plane orthogonal to [A] as times ⃗ x evolve. Then, in view of (4.3), such vector is a natural boundary condition for Kasteleyn systems of relations on any network (G, t b,w ) representing [A].
The relevance of Lemma 6.1 becomes manifest in connection with the solution to the inverse spectral problem, which consists in the reconstruction of the KP-II soliton solution from its divisor on the spectral curve at a fixed time ⃗ x 0 . Indeed, the mismatch between the dimension of Gr TNN (k, n) and that of the variety of Sato divisors implies that generically the Sato divisor is not sufficient to determine the corresponding KP-II solution.
In [2,4,6] a completion of the Sato algebraic-geometric data has been proposed based on the degenerate finite gap theory on reducible curves introduced in [41]. More precisely: (1) In [2,4] the dual graph of the reducible spectral curve Γ is the Le-graph representing the soliton data, Γ 0 is identified with the boundary of the disk, and the divisor on Γ is constructed through a recursion. In [6], a larger class of networks representing the given soliton solution is used and the real regular divisor is constructed using Lam system of relations [45] for the geometric signatures introduced in [5]; (2) In [4,6], the reality and regularity properties of the KP-II divisor settled in [21] follow from the combinatorics of Gr TNN (k, n), whereas in [2] classical total positivity was used for soliton data in Gr TP (k, n); (3) The independence of the divisor from the gauge freedoms of the chosen network (perfect orientation, gauge ray direction, weight gauge, gauge freedom of the position of internal vertices) follows from the transformation properties of geometric signatures and was proven in [6]. In the present setting, the comparison between Theorem 4.4 and Lemma 6.1 makes evident that it is just natural to choose a reducible spectral curve whose dual graph represents the soliton data [A] and use Kasteleyn system of relations to extend ψ to such augmented curve. Moreover, the invariance of the KP divisor is automatically guaranteed by the properties of Kasteleyn system of relations on undirected graphs.
The reducible spectral curve Γ: Given the soliton data (K, [A]), [A] ∈ S TNN M ⊂ Gr TNN (k, n), one fixes G, a reduced planar bipartite graph in the disk with black boundary vertices representing S TNN M . To obtain a universal curve, we assume that internal vertices are either bivalent or trivalent. As in [4,6], Γ is then the reducible curve with dual graph G: Γ 0 is the rational component represented by the boundary of the disk, the boundary vertices b j correspond to the phases κ j , j ∈ [n], the internal vertices are rational components, the edges are the double points at which the rational components of Γ are connected, whereas the faces are the ovals of the M-curve (see Table 1 and Figure 20). x. Lemma 6.1 suggests a natural way to extendψ to the double points of Γ, by fixing a Kasteleyn signature on G, defining v (k) bj (⃗ x) ≡ ψ(κ j , ⃗ x) at the boundary vertices, and assigning the solution to Kasteleyn system of relations of Definition (4.1) to the corresponding double points in Γ. Then the relations at the internal white vertices set the degree of the meromorphic extension of the normalized wave function on the corresponding rational components of Γ and fully characterize its divisor structure. Such solution has the following properties: is an untrivial analytic function in ⃗ x, where we assume that only a finite number of times vary; (2) There exists ⃗ x 0 such that v   x at any given internal black vertex b: . Finally if σ ′ is another Kasteleyn signature on (G, t bw ), then its Kasteleyn system of relations (u Proof. The existence, uniqueness and analyticity of (v (k) b (⃗ x), R w ) follow from Lemma 6.1 and Theorem 4.4. Let E b = (E b,1 , . . . E b,n ) ∈ R n , b ∈ B, be the solution of Kasteleyn system of relations described in Theorem 4.5, and let c(⃗ x) = (c 1 (⃗ x), . . . , c n−k (⃗ x)) be as in Lemma 6.1. Then v where we have used (6.6), ≺ ⋅, ⋅ ≻ denotes the usual inner product in R n−k , andĀ o is the matrix orthogonal to A in (4.3). By Theorem 5.22, there exist a base I ∈ M and a non-zero vector α b = (α b,1 , . . . , α b,n−k ) such that E b = ∑ j∈Ī α b,j E j , where E j is the j-th canonical basis vector in R n . Then the right hand side of (6.10) is not identically zero for any given internal vertex b ∈ B. Therefore, for any choice of the soliton data there exists ⃗ x 0 such that v is an untrivial analytic function in ⃗ x and its value is independent of the choice of Kasteleyn signature on Γ and of the edge weighting in the equivalence class of the network.   b (⃗ x) to the normalized KP wave functionψ at the corresponding double points of the spectral curve Γ whose dual graph is G: (1) If the edge e j joins the boundary vertex b j to the vertex w, we denote Q j the point in Γ w glued to κ j and we assign the value ψ(κ j , ⃗ x) to the KP-II wave function at Q j at time ⃗ x: (6.11) ψ(Q j , ⃗ x) ≡ ψ(κ j , ⃗ x), and the valueψ(κ j , ⃗ x) to the normalized KP-II wave function at Q j at time ⃗ x: (6.12)ψ(Q j , ⃗ x) ≡ψ(κ j , ⃗ x).
(2) If Γ w , Γ b are the rational components corresponding to the vertices w, b joined by the edge e b , we denote Q b ∈ Γ w , P b ∈ Γ b the points where we glue these components; and we assign the value v (k) b (⃗ x) to the KP-II wave function at both P b and Q b at the time ⃗ x: and the valuev (6.14)ψ(P b , ⃗ x) ≡ψ(Q b , ⃗ x) =v (1) we extend it to a constant function with respect to the spectral parameter on each rational component corresponding either to a black vertex or to a bivalent white vertex; (2) we extend it to a degree one meromorphic function in the spectral parameter on each rational component Γ w corresponding to a trivalent white vertex w.
By construction we obtain the desired KP divisor which is contained in the union of the ovals and is given by the union of the Sato divisor and of the pole divisor at the components Γ w . More precisely:  Figure 21. The correspondence between faces at the white vertex w (left) and ovals bounded by Γw (right) under the assumption that the curve is constructed reflecting the graph w.r.t. a vertical ray. Objects paired by the duality relation between the graph and the curve share the same color: vertices correspond to rational components, edges to double points, faces to ovals. k (⃗ x 0 )}; (2) The g −k poles P w l ≡ P w l (⃗ x 0 ) ∈ Γ w l uniquely identified by the condition that, in the local coordinate defined above ζ(P w l ) = γ w l (⃗ x 0 ), where w l , l ∈ [g − k], are the trivalent white vertices of G and γ w l is as in (6.16 Figure 22. The four possible configurations of real regular KP divisors on the reducible rational curve whose dual graph is in Figure 20, for the generic soliton data (K, [A]) of Example 6.11 (see also Figure 13). Double points are represented by dashed lines and divisor points by stars; we mark the local coordinates at the marked points of Γw 1 and Γw 2 in red. x) = (ζ 2 − w 1 (⃗ x)ζ − w 2 (⃗ x)) exp(ζx + ζ 2 y + ζ 3 t + ⋯).
In [6], the construction of the KP-II wave function at the double points of the curve whose dual graph is G is performed solving Lam system of relations for the geometric signature I imposing the boundary conditions z The un-normalized KP wave function is defined as follows for all b ∈ B: . From Theorem 5.22 it follows that the normalized wave function ψ(P, ⃗ x) = ψ (g) (P, ⃗ x) ψ (g) (P, ⃗ x 0 ) constructed in [6] coincides with the one defined in Construction 6.5, and necessarily the KP-II divisors are the same.
Proposition 6.12. The normalized wave functionψ(P, ⃗ x) and the KP-II divisor D KP,Γ in Construction 6.5 and Definition 6.7 coincide with those defined in [6] using Lam system of relations for the geometric signatures on Γ(G) for any given soliton data (K, [A]) and reference time ⃗ x 0 .