The Geometry of On-Shell Diagrams

The fundamental role of on-shell diagrams in quantum field theory has been recently recognized. On-shell diagrams, or equivalently bipartite graphs, provide a natural bridge connecting gauge theory to powerful mathematical structures such as the Grassmannian. We perform a detailed investigation of the combinatorial and geometric objects associated to these graphs. We mainly focus on their relation to polytopes and toric geometry, the Grassmannian and its stratification. Our work extends the current understanding of these connections along several important fronts, most notably eliminating restrictions imposed by planarity, positivity, reducibility and edge removability. We illustrate our ideas with several explicit examples and introduce concrete methods that considerably simplify computations. We consider it highly likely that the structures unveiled in this article will arise in the on-shell study of scattering amplitudes beyond the planar limit. Our results can be conversely regarded as an expansion in the understanding of the Grassmannian in terms of bipartite graphs.


Introduction
We are in the midst of what might become a profound reformulation of quantum field theory, one which privileges hidden infinite dimensional symmetries over manifest locality and unitarity [1][2][3][4][5]. The main laboratory for the new ideas is planar N = 4 SYM. This approach has led to a focus on on-shell diagrams, equivalently bipartite graphs, which determine well-defined physical quantities exhibiting all the symmetries of the quantum field theory [6]. On-shell diagrams can be used as building blocks of scattering amplitudes. In addition, they reveal a profound and only recently explored role in physics of mathematical concepts such as cluster algebras, the Grassmannian and matroids. Most probably this is just the tip of an iceberg, with useful insights flowing between the physics and mathematics worlds in both directions. The latest addition to this story is the amplituhedron, a new type of geometric object whose volume gives the scattering amplitudes of the quantum field theory [7]. The main goal of this article is to investigate the geometric structures associated to on-shell diagrams. In particular, our work constitutes a concrete step in reducing several of the assumptions often made in the interplay between bipartite graphs and the Grassmannian: dropping the conditions of reducibility and removable edges often invoked when discussing stratification, planarity of graphs and positivity. This paper also admits an alternative, more formal, reading. It can be regarded as an investigation of the description of the Grassmannian in terms of bipartite graphs, extending it beyond the well-studied planar case.
The on-shell diagram approach to quantum field theories is part of an ambitious program which starts from planar N = 4 SYM and might eventually lead to a new understanding of gravity and even string theory. We expect that the new structures we develop in this article should naturally appear when moving forward to the next stage, into non-planar theories.
This paper is organized as follows. In §2, we review bipartite graphs and related concepts, including bipartite field theories. The Grassmannian and its different possible decompositions are discussed in §3. In §4 we begin the discussion of the parametrization of the Grassmannian in terms of edge weights of bipartite graphs, by means of the boundary measurement. The relevance of the stratification of the Grassmannian for the singularity structure of on-shell diagrams is briefly reviewed in §5. In §6, we present various complementary perspectives and methods for determining the matching and matroid polytopes, equivalently toric geometries, associated to general bipartite graphs. §7 is dedicated to the notions of graph equivalence and reduction. A useful criterion for quantifying the degree of reducibility of a graph is presented in §8. In §9, we introduce a new decomposition of the Grassmannian in terms of bipartite graphs. For planar graphs, this is a new way of obtaining its positroid decomposition. Including non-planar graphs allows us to cover new regions of the Grassmannian, providing what can be regarded as a partial matroid stratification. In §10 we extend the boundary measurement to graphs with an arbitrary number of boundaries. Our tools are applied to explicit non-planar examples in §11. §12 presents some thoughts on the possibility of constructing the matroid stratification by considering multiple graphs, planar and non-planar. We conclude in §13. Three appendices collect auxiliary material.

Overview of Bipartite Graphs and Related Objects
In this section we review basic aspects of bipartite graphs and their combinatorial properties. We describe the notion of perfect matchings, perfect orientations, flows, and define an edge parameterization that will be used in the rest of the paper. We also introduce two relevant physics applications of such graphs: on-shell diagrams for scattering amplitudes in N = 4 SYM, and an infinite class of N = 1 gauge theories.
Bipartite Graphs. A graph is a collection of nodes and of edges connecting them. The graphs we consider have two types of nodes, distinguished by a white or black color. If white nodes are only connected to black nodes and vice-versa, the graph is bipartite. We denote the number of edges connected to a given node as its valence. The framework introduced in this paper deals with general bipartite graphs containing nodes of arbitrary valence.
In many applications, it can often be useful to consider embeddings of the graphs onto Riemann surfaces with boundaries. We shall call planar a graph which can be embedded on the disk without crossing. Instead, those graphs whose embedding involves edge crossings or multiple boundaries are referred to as non-planar.
We divide nodes into two distinct categories: external nodes are defined as those nodes which must lie on a boundary in any embedding of the graph, the remaining nodes are internal. We shall only consider monovalent external nodes.
Once an embedding of the graph on a Riemann surface is specified, one can define faces as those regions on the surface surrounded by edges and/or by boundaries. Faces are also divided in two categories: internal faces are those which are only surrounded by edges, and external faces are those whose perimeter includes at least one boundary.
Perfect Matchings. Perfect matchings are key combinatorial objects of bipartite graphs. A perfect matching is a sub-collection of edges such that every internal node is the endpoint of only one edge, while external nodes may or may not contained in the perfect matching. 1 Usually, there are several ways to select sub-collections of edges with this property, and each of these is a different perfect matching. An example of a bipartite graph and its perfect matchings is provided in Figure 1.
In §2.3 we will show how to find all perfect matchings for a given bipartite graph in a systematic way. Perfect Orientations. A bipartite graph can equally be characterized by its perfect orientations. A perfect orientation is a way of assigning arrows to the edges of a graph in such a way that for 3-valent nodes we have: • White node: 1 incoming and 2 outgoing arrows.
In addition, 2-valent nodes have one incoming and one outgoing arrow. General bipartite graphs with nodes of arbitrary valence v can be constructed in terms of graphs containing only v = 2 and 3 nodes. We refer the reader to [8] for a detailed discussion of how this is achieved. The rules controlling perfect orientations for arbitrary v can thus be derived from those for v = 2, 3. For general graphs, a perfect orientation is such that, for a node with valence v ≥ 3, we have: • White node: 1 incoming and v − 1 outgoing arrows.
It is straightforward to prove this based on the behavior of 2 and 3-valent nodes. For concreteness, consider a v-valent white node. As explained in [8], it can be decomposed into (v − 2) white 3-valent nodes and (v − 3) black 2-valent nodes, as shown in Figure 2. The fact that this decomposition is in general not unique does not affect our conclusions. The white nodes give 2(v − 2) outgoing and (v − 2) ingoing arrows. Out of these, (v − 3)  in-out pairs are contracted along the black nodes, giving the result shown in Figure 3. The reasoning for black nodes is identical up to inversion of arrows. Figure 4 provides an example of a perfect orientation for a bipartite graph on a disk, with 3-valent nodes. Given a perfect orientation, external nodes can be naturally divided into sources and sinks. The number of elements in each of these two sets does not depend on the choice of the perfect orientation and is a characteristic of the graph itself.
Flows. Given a graph and a perfect orientation, it is possible to specify the latter by listing all oriented non self-intersecting paths in it. We refer to such paths as flows and denote them as p µ . Flows may involve more than one disjoint component. These components can connect external nodes or correspond to closed loops. The trivial flow, i.e. the one which does not involve any edge of the graph, is also included.

Relation Between Perfect Orientations, Flows and Perfect Matchings
Perfect orientations are in bijection with perfect matchings. Given a perfect matching, the way to obtain the corresponding perfect orientation is to assign arrows to the edges as follows: • Edges belonging to the perfect matching point from the black node to the white node.
• All other edges point out of white nodes and into black nodes.
Since a perfect matching only touches each internal node once, the above definition automatically satisfies the rules for arrows in a perfect orientation. Conversely, it is possible to obtain the perfect matching from a perfect orientation by selecting the incoming arrow for white nodes and the outgoing arrow for black nodes. There is also a bijection between flows and perfect matchings. In order to find it, we begin by choosing a perfect matching p ref , called the reference perfect matching (or just reference matching for short), and assigning to all of its edges an orientation that points from white nodes to black nodes. We orient the edges of all other perfect matchings in a similar way. Subtracting p ref from all perfect matchings, i.e. reversing the arrows in p ref before combining them, creates a set of oriented paths. These paths necessarily live in the perfect orientation associated to p ref , because all arrows point out of white nodes and into black nodes except for the ones belonging to p ref , which have opposite orientation. These paths are thus precisely the flows in the perfect orientation defined by p ref , i.e. we can think about them as p µ = p µ − p ref .
In summary, for each perfect matching there is an associated perfect orientation. The number of flows in each perfect orientation is equal to the number of perfect matchings, and they are found by subtracting the reference perfect matching from the corresponding perfect matchings.

Oriented Edge Weights
We will often be interested in relating edge weights, which strictly speaking have no associated orientation, to oriented paths. It is thus useful to devise a formalism that consistently deals with such a connection. We will refer to edge weights as X i , where the index i = 1, . . . , E runs over all edges of the graph.
(2.1) Figure 5 shows two perfect matchings p 3 , p 4 and their corresponding oriented perfect matchingsp 3 ,p 4 . We can in fact write any oriented path on the graph as a product or ratio of these new variables: if a segment of the path goes from a white node to a black node, the relevant α i,j contributes to the expression of the path in the numerator; if the segment goes from a black node to a white node, its α i,j contributes to the denominator. In particular, flows can be written in terms of these variables; an example is provided in Figure 6, where the perfect orientation corresponds to the perfect matching p 4 . Here the flow is expressed as α 2,5 α 1,4 α 5,1 α 4,3 .
(2.2) Moreover, in this parameterization all flows can be expressed as ratios p i =p i /p ref , wherep ref is the reference matching defining the underlying perfect orientation. In the example in the figure, the flow is p 3 =p 3 p 4 = α 2,5 α 1,4 α 5,1 α 4,3 . Note that the trivial flow is p ref = 1. This parameterization is very convenient for the study of the connection between bipartite graphs and the Grassmannian, and will be extensively used in the rest of the paper. Figure 5. Example of ordinary perfect matchings p i and oriented perfect matchingsp i . Edges α i,j are oriented from white nodes to the black nodes.

Finding Perfect Matchings
Flows, perfect orientations and perfect matchings contain equivalent combinatorial information about the bipartite graph. Among the three, perfect matchings are those which are obtained most efficiently. This is done using a generalization of Kasteleyn matrix techniques, which will be briefly outlined here. The reader is referred to [8] for a detailed discussion of these techniques. The starting point for finding the perfect matchings is the construction of a weighted adjacency matrix, known as the master Kasteleyn matrix K 0 . When there are multiple edges between two nodes their contributions are added. Denoting internal white and black nodes W i and B i , respectively, and external white and black nodes W e and B e , K 0 takes the form: The zero in the bottom-right corner arises because external nodes are only paired with internal nodes. K 0 is not necessarily square. For any subsets W e,del ⊆ W e and B e,del ⊆ B e of the external nodes, we define the reduced Kasteleyn matrix K (We,del,Be,del) as the matrix resulting from starting from K 0 and deleting the rows in W e,del and the columns in B e,del .
All perfect matchings in the graph are given by the polynomial: where the sum runs over all possible subsets W e,del and B e,del of the external nodes such that the resulting reduced Kasteleyn matrices are square. 3 Every term in this polynomial corresponds to the product of edges in a perfect matching.

On-Shell Diagrams
Recently, a remarkable new formalism based on on-shell diagrams has been developed for N = 4 SYM [6]. This approach naturally relates scattering amplitudes to the Grassmannian. The connection between gauge theory and the Grassmannian has been exhaustively investigated in earlier works, such as [1][2][3][4][5].
On-shell diagrams are constructed by gluing 3-particle MHV (maximally helicity violating) and MHV amplitudes. They are characterized by k, the number of external particles with negative helicity, and n, the total number of external particles. In these diagrams, all lines represent particles whose momentum is on-shell. Integrating over the on-shell phase space of internal particles, with helicity and momentum-conserving delta functions at each vertex, they produce a function of the external kinematical data.
Being constructed in terms of two types of building blocks, on-shell diagram are naturally bi-colored graphs. Indeed, as explained in [8], it is straightforward to relate general on-shell diagrams to bipartite graphs. For this reason, we will simply regard the two classes of objects as synonyms in what follows. Given an on-shell diagram, the possible assignations of helicity flows consistent with the rules for MHV and MHV vertices correspond to perfect orientations.
Bipartite graphs are mapped to elements of the Grassmannian via a map known as the boundary measurement, which we will study in §4 and §10. Hence we have a connection among: Bipartite Graphs/On-Shell Diagrams ⇔ Elements in the Grassmannian Much of this article is devoted to investigating these relations.

Bipartite Field Theories
Bipartite Field Theories (BFTs) are a class of 4d, N = 1 gauge theories whose Lagrangians are defined by bipartite graphs on (bordered) Riemann surfaces [8,9]. 4 BFTs provide an alternative, and sometimes very powerful, perspective on bipartite graphs. The BFT associated to a graph is obtained using the following dictionary: • Face: U (N ) symmetry group. 5 • Edge: chiral multiplet X i,j in the bifundamental representation of the U (N ) i × U (N ) j symmetry groups corresponding to the faces on both sides of the edge. Introducing an orientation around nodes going clockwise around white nodes and counterclockwise around black ones, the fields transform in the fundamental representation of the head of the corresponding arrow and anti-fundamental representation of the tail. Chiral fields associated to external legs, i.e. edges connected to external nodes, are taken to be non-dynamical.
• Node: superpotential term given by the trace of the product of fields corresponding to edges terminating on the node. The superpotential term bears a positive sign for white nodes and negative sign for black nodes. External nodes, by definition, do not map to any superpotential term.
In order to fully specify the BFT, it is also necessary to determine which symmetries are gauged. There are two natural choices [9], which we now explain. 6 Gauging 1. In this case, the U (N ) symmetries associated to internal faces of the graph, namely faces whose perimeter does not involve any boundary, are gauged. It is straightforward to see that bipartiteness guarantees that internal faces are even sided. This implies that they are anomaly free and can be consistently gauged. The remaining symmetry groups are global. We refer to the resulting class of gauge theories as BFT 1 . The theories in this class are quiver gauge theories. Their quivers, including plaquettes representing the superpotential terms, are obtained by dualizing the bipartite graph [8].
A particular sub-class of BFT 1 's has been the subject of intense activity in recent years. These theories are known as brane tilings and correspond to BFTs on a 2-torus without boundaries [14][15][16]. Brane tilings describe the theories on the worldvolume of D3-branes probing toric Calabi-Yau 3-folds and have played a key role in the identification of infinite families of explicit AdS/CFT dual pairs [16,17]. More recently a physical realization in terms of D3 and D7-branes on toric Calabi-Yau 3-folds has been introduced for a more general class of BFTs, which includes graphs with boundaries [18].
Gauging 2. Internal faces are not the only source of symmetries which are automatically anomaly-free. In fact any closed loop in the graph has this property. This leads us to a second class of BFTs, which we denote BFT 2 , in which the symmetries associated to a basis of all closed loops are gauged. Gauging 2 is then an extension of gauging 1, where additional symmetries of the theory are gauged. Loops which cannot be expressed as faces or collection thereof, i.e. loops with a non-trivial homology around the g > 0 Riemann surface, are identified with U (1) gauged symmetries. 7 The difference between BFT 1 and BFT 2 is illustrated in Figure 7.
For graphs on a disk there is no distinction between BFT 1 and BFT 2 . The difference between the two gaugings arises in the presence of multiple boundaries and/or higher genus Riemann surfaces. For applications to on-shell diagrams, the relevant theories are classical Abelian BFTs, in which all symmetries are U (1). 8 In this context it is also natural to focus on BFT 2 's, since the additional gauging makes the resulting theory independent of the underlying Riemann surface [9].

The Grassmannian and its Decompositions
In this section we review basic aspects about the Grassmannian and its stratifications. We refer the interested reader to [19][20][21][22][23] for more comprehensive discussions.

Definition
The Grassmannian Gr k,n (R) is the space of k-dimensional planes in n dimensions that pass through the origin. Elements of Gr k,n (R) are typically represented by k × n matrices where the plane is the span of the k n-dimensional row vectors. The action of GL(k) on the basis vectors leaves the plane invariant, so the Grassmannian is the space of k × n matrices C modulo GL(k). The GL(k) invariance can be used to fix any k columns to form a k × k identity sub-matrix, e.g. for Gr 2,4 we can fix C to the form where the signs have been introduced for later convenience. When mapping bipartite graphs to the Grassmannian, we will see that columns in this matrix correspond to all external nodes and rows correspond to those which are sources in a perfect orientation. From here on, we will always present elements of the Grassmannian in a form that has fixed the GL(k) invariance.

Plücker Coordinates
The degrees of freedom of C can alternatively be expressed by its k × k minors ∆ I , where I is a set with k elements describing which columns participate in the minor; these are known as Plücker coordinates. These minors are invariant under the action of SL(k) and scale by a common factor under GL(k). Since there are n k of these, it induces the Plücker embedding of the Grassmannian Gr k,n → RP ( n k )−1 . The minors are not all independent, they satisfy relations known as the Plücker relations where J 1 is any (k − 1)-element subset of [n], J 2 is any (k + 1)-element subset of [n] and a i is the ith element of J 2 . In each term, a i is removed from J 2 and appended to the right of J 1 . In this embedding, the Grassmannian is simply the subvariety described by the Plücker relations. For the example of Gr 2,4 above, we have and the single relation ∆ 14 ∆ 23 − ∆ 13 ∆ 24 + ∆ 12 ∆ 34 = 0. The totally non-negative Grassmannian is given by those matrices C with all ∆ I ≥ 0.

Schubert Decomposition
There are many ways to decompose the Grassmannian into (possibly overlapping) sets, according to certain properties. Schubert cells 9 Ω I are defined as those C ∈ Gr k,n 9 A cell is homeomorphic to an open ball and must have Euler number 1.
where ∆ I is the first non-zero Plücker coordinate, counted in lexicographic order 10 , i.e. Ω I = {C ∈ Gr k,n | ∆ I is the lexicographically minimal non-zero Plücker coordinate}.
(3.4) For example, because there is no other non-zero Plücker coordinate with smaller lexicographic ordering than I = 12. The cyclically shifted Schubert cell Ω (i) I is defined similarly, but the lexicographic order is cyclically shifted to begin the counting at i, e.g. for the same example in (3.5), C ∈ Ω 12 but also C ∈ Ω (2) 24 because the order is shifted to 2 < 3 < 4 < 1, and since ∆ 23 = 0, the lexicographically smallest (with respect to the shifted order) non-zero ∆ I is now I = 24. Similarly, C ∈ Ω  I the Plücker coordinates lexicographically larger (with respect to the shifted order i) than I are free to be zero or non-zero.
The permuted Schubert cell Ω w I is defined as in (3.4) but with the lexicographic order being with respect to a permuted order w(1) < w(1) < · · · < w(n), where w ∈ S n .

Positroid Stratification
The positroid stratification of the Grassmannian Gr k,n introduced by Postnikov [19] defines each stratum as where I = {I 1 , . . . , I n }, and I i specifies which Plücker coordinates are non-zero, only looking at those which are lexicographically minimal with respect to each shifted cyclic ordering starting at i. Note in particular that the Plücker coordinates lexicographically smaller with respect to each shifted order must be zero, following the definition of the Schubert decomposition. where ∆ 23 = 0 and we do not specify whether ∆ 13 is vanishing or not. Instead, consider the following stratum This stratum contains those matrices for which lexicographically smaller Plücker coordinates with respect to each shifted order are set to zero. For the shifted order i = 1, we note that ∆ 12 = 0 and ∆ 13 = 0 since they are lexicographically smaller than ∆ 14 .
For the shifted order i = 2, ∆ 23 = 0 since it is lexicographically smaller than ∆ 24 . For the shifted order i = 3, we additionally have ∆ 34 = 0 since it is lexicographically smaller than ∆ 14 (along with ∆ 31 and ∆ 32 ). Finally ∆ 41 = 0 is the lexicographically smallest with respect to the shifted order i = 4. So a matrix belonging to this positroid stratum is for instance Since a positroid stratum is in general more restricted than a Schubert cell, the positroid stratification refines the Schubert decomposition.

Matroid Stratification
In order to describe this stratification, we have first to introduce the concept of matroids.
The study of matroids is the analysis of an abstract theory of dependences. We refer the interested reader to [22] for a comprehensive introduction, here we review only some basic aspects. where by e I we denote e I = i∈I e i for any I ∈ M, and {e 1 , . . . , e n } is the standard Euclidean basis of R n . Linear relations among matroid bases translate into linear relations between position vectors of points in the matroid. The construction of matroid polytopes is discussed in detail in §6.

Positroid Cells
Postnikov showed that intersecting the matroid stratification with the totally nonnegative Grassmannian Gr ≥0 k,n gives a cell decomposition of Gr ≥0 k,n [19]. Only one matroid stratum in each positroid stratum has a non-empty intersection with Gr ≥0 k,n , and it is this intersection which is the positroid cell. 11 Equivalently, the positroid cell decomposition of Gr ≥0 k,n can be obtained as the intersection of the positroid stratification with the totally non-negative Grassmannian Gr ≥0 k,n . This cell is the only one for which nonnegative Plücker coordinates are compatible with the Plücker relations.
The positroid cell whose Plücker coordinates are all different from zero (and positive) is the top-dimensional cell, which we refer to as the top-cell. Postnikov showed that the positroid cells are indexed by Γ diagrams and planar bipartite graphs [19].

Deodhar Decomposition
The Deodhar decomposition is a refinement of the positroid stratification, but in turn it is refined by the matroid stratification, i. Each Deodhar component was shown to be indexed by so-called Go-diagrams [24] and subsequently by (generally non-planar) networks [21], which have a direct mapping to elements of the Grassmannian. The graph that represents a Deodhar component actually is in a specific matroid stratum, but each Deodhar component will have only one representative. As a result, these representatives can be chosen to represent the entire Deodhar component.

Bipartite Graphs and the Grassmannian, a First Encounter
In this section we review the map between planar bipartite graphs and the Grassmannian introduced by Postnikov in [19] and begin its generalization to arbitrary bipartite graphs. Further details of the generalization are developed in §10. This map is known as the boundary measurement, and maps a bipartite graph with k sources and n external vertices to an element of Gr k,n .
The boundary measurement is an important ingredient in the study of on-shell diagrams. As we review in §5, the corresponding integrand is determined by the Grassmannian element associated to the graph.
Given a bipartite graph, the boundary measurement is constructed as follows: 1) Choose an arbitrary perfect orientation of the diagram. This determines a source set. We denote the number of external vertices by n, and the number of sources by k.
2) Construct the n v × n v path matrix M, where n v is the total number of nodes in the graph. Each matrix entry M i,j entry contains the weights of the oriented paths in the perfect orientation connecting node i and node j. An efficient way for constructing M is presented in Appendix A.
3) Construct the k × n dimensional matrix M C . This is a sub-matrix of M in which columns are given by all external nodes and rows correspond to external nodes which are sources of the perfect orientation.

4)
Modify signs in the entries of M C . We will discuss below the reasons for introducing such signs and introduce a systematic prescription for their determination.
The discussion above is completely general and applies to arbitrary bipartite graphs. There are three different kind of entries in M C . The entries which contain paths that go from a source to the same source are always equal to 1. Some entries are 0, representing the fact that sometimes it is impossible to flow from a source to a given external node. In particular, there are no oriented flows between two sources. The paths contributing to entries in M C can be identified with single component flows, which in addition take the form p µ =p µ /p ref for some oriented perfect matchingp µ . 12 The matrix M C is already extremely useful for some applications, which do not require a precise knowledge of the sign assignments that take us to the boundary measurement C. By studying the entries of the matrix, it is possible to determine the connectivity of external nodes. This fact will be heavily used in §6. Similarly, we can use it for determining the number of its degrees of freedom: it is the number of non-zero minors minus the number of relations between k × k minors, minus 1. This is equal to the number of degrees of freedom of C, which is the dimensionality of the associated element of the Grassmannian.

Sign Prescription
We are ready to discuss the sign prescription, to finally map M C → C ∈ Gr k,n . Here we will focus on the case of planar graphs, i.e. graphs on a disk, and follow [19]. The implementation of signs for non-planar graphs will be the topic of §10.
For planar graphs, the signs in the boundary measurement are chosen such that two nice properties are simultaneously achieved: all maximal minors of C are nonnegative for non-negative edge weights and, moreover, these minors are simply sums of products of flows. In addition, we will pick signs such that denominators cannot vanish for strictly positive edge weights. 13 Such potentially vanishing denominators arise when formally summing the geometric series that arise in the presence of closed oriented loops. 14 In order to construct a matrix with definite non negative minors, we have to modify some signs in the entries of M C . The prescription consists in first introducing a sign (−1) s(i,j) to the entry M C i,j , where s(i, j) is the number of sources strictly between i and j, neglecting periodicity. Secondly, one has also to introduce a (−1) factor to every loop. These two modifications conspire in such a way to obtain a matrix C whose minors are all non-negative, and moreover such that its minors remain simple sums of flows. 12 In the presence of loops, entries will in general have the form pi 1−p loop . 13 Here we consider the analytic continuation of the geometric series giving rise to a non-trivial denominator.
14 Another natural choice for which all minors are sums of flows corresponds to not introducing any signs to M C [25]. However non-trivial signs have to be delicately chosen in order to simultaneously achieve the other two properties mentioned in this paragraph.
Example. We now provide an example to illustrate this method. We begin with the diagram displayed in Figure 8, and the perfect orientation associated to the reference matching consisting of edges X 1,2 , X 1,4 . The relevant subset of the path matrix, choosing the clockwise ordering starting at the edge X 2,3 , is (4.1) where the labeling of perfect matchings follows that of Figure 1. Once the signs are introduced, this is associated with the top-cell of Gr 2,4 , since all entries which can be non-zero are generically non-zero. This example has a loop in the perfect orientation, which manifests itself as several terms in the denominator, as explained in Appendix A. The minors of this matrix take on a very simple form: Several remarks are in order. First, all the minors of M C have the form of sums of flows, divided by possible loops, thanks to non-trivial cancellations. Secondly, all minors are non-zero, reflecting the fact that the element of the Grassmannian associated to M C has maximal dimension. Thirdly, some of the minors are negative, for positive edge weights. We finally proceed in modifying the signs of the matrix M C to obtain the element of the totally non negative Grassmannian. The (−1) s(i,j) factor implies that we have to multiply the entry M C 2,1 by (−1). The (−1) factor for loops amounts to replacing p 7 → −p 7 . These two operations map M C into the relevant element of the Grassmannian C ∈ Gr 2,4 : (4. 3) The maximal minors of C ∈ Gr k,n are the Plücker coordinates ∆ I . For the example above, the Plücker coordinates are: which are manifestly positive, for positive edge weights.

Stratification and Singularity Structure of On-Shell Diagrams
In §2.4 we discussed the connection between on-shell diagrams of N = 4 SYM, the Grassmannian, and bipartite graphs. The authors of [6] explained how to construct the integrand associated to a planar on-shell diagram using twistor space variables, in terms of data associated to the bipartite graph. In the previous section we have reviewed how to associate to on-shell diagrams the edge weights α ij and the boundary measurement matrix C(α ij ) ∈ Gr k,n of the Grassmannian. The edge weight parameterization of the Grassmannian is redundant. The independent degrees of freedom are a subset β i of the edge weights of dimension d = F − 1, where F is the number of faces of the graph.
The differential form associated to an on-shell diagram is [6] where (η,λ, λ) are the kinematical variables of the scattered particles, in N = 4 twistor space. The delta functions provide 2n−4 constraints. Hence, depending on the degrees of freedom in the matrix C, i.e. on d, different situations arise. If d = 2n−4 the integral over the differential form is fully localized, and the result is an ordinary function of the external data; this is the so-called leading singularity. If d < 2n − 4 we have more constraints than degrees of freedom β i , so the leftover constraints impose conditions on the external data; this is a singularity. If d > 2n − 4 there are some degrees of freedom left unfixed by the delta functions which can be integrated over. Moreover, in some cases the differential form can be such that some of the dβ i β i integrations factorize, leaving externals log β i factors. This happens when the corresponding graph is reducible. We will discuss the notion of graph reducibility in §7.
Understanding the singularity structure of the differential forms associated to onshell diagrams is of great physical interest. For instance, in the case of planar N = 4 SYM, the study of such singularities is connected to a generalization of the BCFW recursion relation which fully determines the scattering amplitudes to all loop orders [6,26,27].
Given a differential form related to an on-shell diagram, the singularity structure contains the information of the residues at the poles of the differential form, which are generically located at some β i = 0. 15 These singularities correspond to elements in the Grassmannian where the number of degrees of freedom in the matrix C has been reduced, by turning off some β i .
The singularity pattern can be organized in a layered partially ordered set (poset). At the top level we have the original diagram and the associated differential form. At the next level, there are the differential forms obtained at the poles of the original one, with one less degrees of freedom, and so on. This procedure continues until it reaches the trivial configuration with no poles left. We provide graphical realizations of this is §9, e.g. Figure 16.
In terms of the Grassmannian element determining the differential form, the number of degrees of freedom in C is reduced by one when going from one level of the poset to the next one. In terms of the bipartite graph, each step coincides with the removal of so-called removable edges, which are defined as those which yield subgraphs where d → d − 1. The precise notion of removable edges and how to identify them will be discussed in §8.1.
In summary, given a differential form related to an on-shell diagram, its singularity structure can be understood from the corresponding bipartite graph by decomposing the graph into subgraphs by removing only removable edges. This provides a lattice of subgraphs, whose corresponding differential forms are the singularities of the original differential form, organized by number of degrees of freedom.
In the planar case, if the original graph is top-dimensional, this graph decomposition is equivalent to the positroid stratification of the associated Grassmannian. In §11, we will introduce a natural generalization of this decomposition which also applies to the non-planar graphs.

From Bipartite Graphs to Polytopes and Toric Geometry
In this section we will associate bipartite graphs to matching and matroid polytopes, which will play a prominent role in the rest of the paper. 16 Equivalently, these convex polytopes can be interpreted as the toric diagrams defining certain toric, non-compact Calabi-Yau (CY) manifolds which we denote master and moduli spaces for their relation to BFTs. We will present various alternative approaches to these objects: • Classifying matroid elements and their relations (perfect orientations).
• Giving a geometric description of flows (flows).
• As master and moduli spaces of BFTs (perfect matchings).
Interestingly, each viewpoint naturally emphasizes different objects, listed above in parentheses. However, all of them are equivalent, as explained in §2.1. It is important to have multiple perspectives on the same objects, since they are best suited for addressing different questions.
Part of the material presented in this section has previously appeared in the literature, in some cases only for the case of planar graphs [28][29][30]. A key point of this article is that these polytopes are also extremely useful beyond planar graphs.
We will use the explicit example in Figure 9 for illustrating our ideas. This is an on-shell diagram associated to the top dimensional cell of Gr 2,5 . This example is chosen because it exhibits more richness than the simpler Gr 2,4 considered so far. In general, the polytopes we will define live in high dimensional integer lattices. It is thus typically impractical to provide a graphical representation of them. Instead, we will describe them in terms of matrices giving the position vectors of points in them.

Polytopes from Matroids
Here we introduce the polytopes we want to study and a first perspective on them.
Matching Polytope. The first polytope we will construct encodes the map between edges and perfect matchings. Given a bipartite graph with E edges X i , i = 1, . . . , E and c perfect matchings p µ , µ = 1, . . . , c, we define the (E × c)-dimensional perfect matching matrix P as follows: This matrix can be interpreted as defining the matching polytope, in which there is a distinct point for every perfect matching, with a position vector in Z E given by the corresponding column vector [8,28]. 17 Let us construct the matching polytope for the explicit example at hand. The graph in Figure 9 has 14 perfect matchings, which can be determined using (2.4). They are shown in Figure 10. The perfect matching matrix thus becomes:  Figure 9.
Generically, the matching polytope lives in a lower dimensional subspace of Z E . This fact can be made explicit by row-reducing P , which for (6.2) results in the following matrix: It is straightforward to verify that the points defined by the previous matrix actually live in a 6d hyperplane at unit distance from the origin, and hence one of the dimensions in (6.3) can be projected out. It is thus possible to neglect one dimension, by e.g. discarding a row in G. From now on we refer to the dimension of the matching polytope as the dimension of the hyperplane on which the points lie; in the example above this is 6 dimensions. Thus, for planar graphs the dimensionality of the matching polytope is equal to the total number of faces minus one, i.e. F − 1. The dimensionality and how it generalizes to non-planar graphs are best understood in terms of flows in a perfect orientation. This will be discussed in §6.2.1.
Matroid Polytope. The matroid polytope was introduced in §3.5 to encode the elements of a matroid and their relations. The source sets I µ , µ = 1, . . . c, of perfect orientations in a planar graph are in one-to-one correspondence with elements of a matroid. A central theme of the current paper is the extension of notions such as the matroid polytope to non-planar graphs. Additional details of such generalizations will be given in later sections. The discussion in this section will thus continue under the assumption of completely general bipartite graphs, i.e. our matroid polytopes should be regarded as the ones usually defined for planar graphs.
Matroid bases are in one-to-one correspondence with source sets of perfect orientations. Given the external nodes n (e) i , i = 1, . . . , n and source sets I µ of perfect orientations, the matroid polytope is defined as follows: where column vectors give the positions of points in the polytope. At this point, it is important to emphasize a phenomenon which will later reappear in multiple incarna-tions. In general, different perfect orientations can share the same source set, which in turn implies they are mapped to the same point in the matching polytope. The precise sense in which such perfect orientations imply multiple "contributions" to a given matroid element will be clarified in §6.2.3 in terms of Plücker coordinates.
Similarly to the matching polytope, the matroid polytope lies in a hyperplane at unit distance from the origin, i.e. it has F e − 1 independent dimensions. Interestingly, since the dimensionality of the matroid polytope is only controlled by external nodes, it remains equal to F e − 1 in the non-planar case. We present a further discussion of this point in §6.2.2.
Returning to our explicit example, Figure 11 gives the 14 perfect orientations associated to the perfect matchings in Figure 10. We denote o µ the perfect orientation corresponding to a perfect matching p µ . There are 10 possible source sets in this case, i.e. 10 matroid elements, and (6.4) becomes: This example explicitly shows how source sets can be shared by more than one perfect orientation. For example {14} corresponds to both p 2 and p 3 . Similarly, {35} and {13} arise from multiple perfect orientations. It is convenient to introduce a more compact version of this matrix, which only provides the positions of points in the matroid polytope and the multiplicities of perfect orientations contributing to each of them. For (6.5), we have: where the last row indicates the multiplicities of perfect orientations. The polytope lives on a 4d hyperplane.

Polytopes from Flows
Here we introduce a second route to matching and matroid polytopes, based on a geometric description of flows. The thoughts in this section are a continuation of the ones introduced in [9] and related ideas, albeit emphasizing slightly different issues, can be found in [30]. Similar descriptions of flows have appeared earlier in the literature, see e.g. [29]. The first step in order to discuss flows is to pick an underlying perfect orientation. Alternative choices of the reference perfect orientation lead to trivial modifications of the polytopes.
For the example at hand, let us focus on the perfect orientation o 1 , which we reproduce in Figure 12. Figure 13 shows all flows in it. As previously discussed, flows can be open, closed or a combination of disjoint components.

Matching Polytopes: a Fully Refined Description of Flows
Flows in a perfect orientation can be fully specified by expanding them in terms of a basis. For graphs on a disk, a convenient basis is given by the loops circling clockwise around faces, both internal and external. It is indeed useful to distinguish between the two types of faces. We call the internal faces w i , i = 1, . . . , F i , and the external ones x j , j = 1, . . . , F e , with F i + F e = F . These variables are subject to the constraint This implies that one of them is actually redundant which, without loss of generality, we can take it to be one of the external faces. This is the manifestation, in the language of flows, of the extra coordinate we discussed in the previous section. Flows p µ are thus mapped to points in an (F − 1)-dimensional space with integer coordinates, according to: Since these coordinates allow a full identification between flows, each of them is mapped to a distinct point. The resulting polytope is indeed the matching polytope. For the flows in Figure 13, the points in the polytope can be summarized as the column vectors of the following matrix: This result coincides with (6.3). Bipartite graphs with higher genus and zero or multiple boundary components can be treated similarly. In such cases, the basis of cycles needs to be appropriately extended as follows [9]: • Higher genus: include α i and β i , i = 1, . . . , g pairs of fundamental cycles for a genus g Riemann surface.
• Boundaries: for B ≥ 1 boundaries, it is necessary to include paths B − 1 independent paths connecting the different boundary components.
For clarity, the discussion that follows is centered on the case of the disk. Extending it to general graphs along the lines just mentioned is straightforward.

Matroid Polytope: Keeping Partial Information About Paths
For certain questions, having a full specification of flows, such as the one given in §6.2.1, is more than it is necessary. For example, in order to determine which entries in the boundary measurement are non-vanishing, knowledge of which external nodes are connected by a given flow is sufficient. 18 The detailed trajectories of flows along the bulk of the graph are unimportant. It is sufficient to identify the edges through which they enter and exit the graph. In terms of the loop coordinates defined in §6.2.1, this is fully determined by keeping only those coordinates associated to the F e − 1 independent external faces. For planar graphs we drop the coordinates associated to internal faces. In more general cases, we also discard those coordinates associated to paths between different boundary components and fundamental cycles on higher genus Riemann surfaces. Let us consider the Gr 2,5 example. Keeping the b j,µ coordinates and discarding the two a i,µ associated to the internal faces, (6.8) reduces as follows: where the π i are the vertices obtained by only keeping the b coordinates. This is precisely the matroid polytope given in (6.6), after projecting out a redundant dimension.
Flows provide an alternative perspective on the emergence of the non-trivial multiplicities for points in the matroid polytope. Such multiplicities arise because paths that coincide on external legs but differ in the interior of the graph are projected down to the same point after eliminating the extra coordinates.
A corollary of the discussion in this section is that the matroid polytope encodes the connectivity between external legs in a perfect orientation, i.e. it specifies which entries in the boundary measurement are non-zero.

Perfect Matchings and Plücker Coordinates
In §6.1 we observed that different perfect matchings can give rise to perfect orientations with the same source set and hence provide multiple "contributions" to a given matroid element. This phenomenon manifests as non-trivial multiplicities for points in the matroid polytope. We are now ready to explain in what sense these objects contribute to the same matroid element in more detail.
Matroid elements {i 1 . . . i k } are in one-to-one correspondence with Plücker coordinates ∆ i 1 ...i k which, in turn, are given by minors of the boundary measurement matrix. All flows associated to a given point in the matroid polytope contribute to the same entries in the boundary measurement matrix. As a result, every perfect matching is mapped to a specific Plücker coordinate [19,[28][29][30]. In summary, each point in the matroid polytope is associated with a single Plücker coordinate, but may get contributions from multiple perfect matchings.
For the example in this section, (6.5) implies the following relation between perfect matchings and Plücker coordinates: p 1 p 2 p 3 p 4 p 5 p 6 p 7 p 8 p 9 p 10 p 11 p 12 p 13 p 14

Polytopes from BFTs
Interpreting bipartite graphs in terms of the corresponding BFTs, the matching and matroid polytopes become two very natural geometries for a quantum field theorist.
With the goal of obtaining these geometries, we focus on classical Abelian BFTs. By this we mean BFTs in which all symmetry groups are U (1) and gauge couplings are fixed and finite, with no quantum RG running. 19 Our discussion will be brief, and we refer the reader to [8,9] for a detailed presentation.

The Matching Polytope from the Master Space
The master space of 4d N = 1 is defined as the space of solutions to vanishing F-term equations [31]. The special structure of BFT superpotentials, which are determined by bipartite graphs, reduces the determination of the master space to a combinatorial problem. F-terms automatically vanish with the following change of variables where X i are the scalar components of chiral multiplets associated to edges, p µ are new fields that are in one-to-one correspondence with perfect matchings and P is the perfect matching matrix defined in (6.1). 20 Perfect matchings can thus be interpreted as GLSM fields parametrizing the master space. The master space of a BFT is toric CY manifold whose toric diagram is the matching polytope [8]. The positions of perfect matchings in the matching polytope encode linear relations between the p µ variables associated to F-term equations. 19 A full investigation of the quantum behavior of BFTs with general ranks is certainly a wellmotivated and interesting problem, but it is beyond the focus of this article. 20 It is important to emphasize the difference between (6.10) and the definition of oriented perfect matchings introduced in §2.2, which are given byp µ = i α Piµ i . While edge weights are naturally interpreted as products of perfect matchings for solving F-term equations, oriented perfect matchings should be thought as the product of oriented edge weights. In both cases, the object controlling the map is the P matrix. Avoiding inconsistencies associated with this subtle difference was one of the main reasons for introducing the concepts of oriented perfect matchings and edge weights.

The Matroid Polytope from the Moduli Space
The moduli space of the BFT is obtained from its master space, by further demanding vanishing of D-terms. In order to do so, it is necessary assign charges under all U (1) gauge groups to the p µ fields. These charges are deduced from those of the edge fields via the map (6.10). For every U (1) (α) factor of the gauge group and every edge chiral multiplet X i associated to an edge, we have: This set of equations can be used to determine an assignation of Q (α) (p µ ) charges.
Since the system is not invertible, the resulting charges are generically not uniquely determined. The moduli space is however independent of the chosen solution. It is obtained by projecting the master space on the space of gauge invariants. The moduli space is also a toric CY manifold and its toric diagram is obtained from the one of the master space by projecting it onto the null space of the matrix of gauge charges of the perfect matchings.
The previous discussion holds in general. However, the specific toric CY obtained as a result depends on whether the BFT is defined with gauging 1 or 2. When computed in gauging 2, the toric diagram of the moduli space is the matroid polytope [9]. 21 Making contact with the discussion in §6.2 in terms of a geometric description of flows, eliminating a coordinate is physically achieved by gauging the corresponding U (1) symmetry group in the BFT context. Gauging 2, the maximal gauging, corresponds to keeping only the b i,µ coordinates.

A Fast Algorithm for Finding the Matroid Polytope
Here we introduce a practical implementation of the ideas in previous sections leading to an efficient algorithm for the determination of the matroid polytope of a bipartite graph.
There exists a one-to-one correspondence between external faces and external legs in a bipartite graph. This correspondence underlies the identification of flow connectivity in terms of external faces of §6.2.1. Without loss of generality, in the case of a single boundary, every external face can be traded by the external leg separating it from the consecutive external face when going around the boundary clockwise. It is straightforward to extend this map to graphs with multiple boundaries.
In analogy to the matching polytope, this correspondence implies the matroid polytope is given by a reduced perfect matching matrix, with columns given by perfect matchings but rows only associated to external legs. Denoting external edges by X (e) i and perfect matchings by p µ , we have: This method for determining matroid polytopes is almost identical and trivially related to the one given by (6.4), based on perfect orientations. In our opinion, (6.12) is even simpler to implement computationally, since it is written directly in terms of perfect matchings, which can be straightforwardly found via reduced Kasteleyn matrices.

Graph Equivalence and Reduction
In this section we introduce the notions of graph equivalence and reducibility, which concern the possibility of using different graphs for describing the same element in the Grassmannian.
Equivalence. Two graphs are equivalent if they have the same matroid polytope, modulo SL transformations and multiplicities. Following §6, equivalent graphs cover the same regions of the Grassmannian. They lead to the same set of generically nonzero entries in the boundary measurement, and to the same set of non-zero Plücker coordinates. This notion of equivalence is also well-motivated in the BFT interpretation, since it implies that the corresponding theories have the same moduli space. 22 Integrating out 2-valent nodes, square moves and bubble reductions lead to equivalent theories. We refer the reader to [8] for a detailed description of these graph transformations. In some cases, edge removal can also lead to equivalent theories. In the specific case of planar bipartite graphs, there is a one-to-one correspondence between equivalence classes of graphs and positroid cells of the Grassmannian. 22 In the non-Abelian case the equality of moduli spaces is a necessary condition for two theories to be Seiberg dual [32][33][34][35][36][37]. Strictly speaking, the duality does not exist for Abelian theories, to which we restrict in this paper, since the theories are not asymptotically free. The matching of moduli spaces is however a well-defined mathematical question regarding natural geometric objects in the field theory.
Reducibility. A graph is reduced or irreducible if it has the minimum number of independent closed paths within a given equivalence class. 23 Being defined up to equivalence transformations, reduced graphs are clearly not unique. More practically, a graph is reducible if it is possible to remove edges without changing its matroid polytope, modulo multiplicities. 24 There are various alternative interpretations of graph reducibility. From the perspective of §6.2 we see that, given a perfect orientation, reducibility translates into redundant connectivity between external legs of a graph. A graph is reducible if it is possible to remove edges, which results in the disruption of some oriented paths, such that every originally connected pair of external nodes remains so after the removal. Following §6.2.3, reducibility can also be thought of as the ability to eliminate edges of the graph while keeping contributions to all Plücker coordinates, i.e. without setting any of them to zero.
Roughly speaking, reduced graphs possess the minimal amount of structure necessary for describing the elements in the Grassmannian associated to the corresponding equivalence class.

Quantifying Graph Reducibility
Heuristically, the more flows connecting external nodes that exist, the more likely connectivity is preserved after removing an edge. In other words, the degree of reducibility of a graph is correlated with the multiplicities of perfect matchings associated to the same points in the matroid polytope. These multiplicities can thus be used as indicators of (relative) reducibility. 25 It is important to emphasize that multiplicities greater than one do not imply that a graph is reducible. An efficient method for addressing this question will be introduced in §8.1.
In order to illustrate these ideas, let us consider the graph in Figure 15, which is related to Figure 9 by reduction. The matroid polytope is given by the following matrix: This polytope coincides with the one given by (6.9), but the new graph has 20 perfect matchings and multiplicities are hence increased. As explained, this is a manifestation of the redundant connectivity associated to reducibility. Similar examples were presented in [8].

An Efficient Approach to Reducibility
Determining whether a bipartite graph is reduced is an important question for various applications. For planar graphs, there is a combinatorial diagnostic for reducibility based on zig-zag paths (see e.g. [6] and references therein). Determining zig-zags and their properties can however be rather impractical. Furthermore, whether and how this method generalizes to non-planar graphs is currently unknown. In this section we introduce an alternative test for reducibility with two salient features: it is straightforward to implement and it applies to both planar and non-planar graphs. The discussion in §7 makes it clear that the matroid polytope is the central player for determining graph equivalence and hence reducibility, which can be formulated as follows: A graph is irreducible if it is impossible to remove any edge without deleting points in the matroid polytope, i.e. without at least one perfect matching surviving for each of them.
This approach, originally advocated in [8], leads to a practical procedure for determining whether a graph is irreducible.

1)
Define E α to be the set of edges that are present in all perfect matchings corresponding to a point α in the matroid polytope, α = 1, . . . , n p .
2) Combine them to form the set of edges that cannot be deleted E und = ∪ α E α . In particular, E und contains all edges in perfect matchings associated to multiplicity one points in the matroid polytope.
Then, graph is reduced if and only if E und is equal to the set E tot of all edges in the graph. If E und E tot , removing any single edge in E tot − E und results in a reduction of the graph. Notice however that, in general, it is not possible to simultaneously remove more than one edge E tot − E und without eliminating points from the matroid polytope.

Matrix Implementation
The previous procedure can be nicely implemented in matrix language. Let us consider the perfect matching matrix P in terms of which, as seen in (6.10), edge removal is very transparent. When an edge X i is deleted, the perfect matchings p µ for which P iµ = 1 disappear.
Our main goal is to identify which edges, if any, can be deleted while keeping at least one perfect matching per point in the matroid polytope. For this purpose, it is natural to define a new matrix P, by multiplying the entries of P associated to each point π α in the matroid polytope as follows: This results in a new m × n p matrix P, where m is the number of edges, as it is for P , and n p is the number of distinct points in the matroid polytope. A vanishing entry P iα = 0 implies that removal of the edge X i preserves the point α in the matroid polytope, albeit not necessarily its multiplicity. Similarly P iα = 1 signifies that the removal of X i kills all perfect matchings at point π α . The construction of P is very efficient given P and immediately displays the reducibility of a graph: if P has a row of zeroes, the graph is reducible since it is possible to remove the corresponding edge while preserving all points in the matroid polytope.
Let us illustrate this construction for the example in Figure 15, for which we obtain π 1 π 2 π 3 π 4 π 5 π 6 π 7 π 8 π 9 π 10 p 1 p 2 p 3 p 4 p 5 p 6 p 7 p 8 p 9 p 10 p where we have grouped the columns associated to perfect matchings that sit on the same point of the matroid polytope. The horizontal line separates internal edges from external legs. 26 Using (8.2), we obtain: π 1 π 2 π 3 π 4 π 5 π 6 π 7 π 8 π 9 π 10 X 1, This matrix contains rows of zeroes, so we conclude the graph is reducible. X 1,8 or X 3,2 can be removed without eliminating points from the matroid polytope.
Finally, we remark that P is also useful for finding those edges which, in the language of [6], are removable edges. Removable edges are defined as those which, starting from a reduced graph, yield a reduced graph after being removed. 27 In order to identify removable edges, we first generate a new perfect matching matrix P from P , by removing the corresponding row k and every column µ for which P kµ = 1. Next, we construct the corresponding P matrix. Removable edges are those whose P does not display reducibility. This procedure applies to general, not necessarily planar, graphs.

Stratification: New Regions and New Methods
We have already had a glimpse that the connection between the Grassmannian and bipartite graphs provides interesting avenues for decomposing the former using the latter. In §5 we discussed a decomposition of planar bipartite graphs which is of physical interest due to its connections to the singularity structure of scattering amplitudes. It can be summarized as follows: 1) Start from a reduced graph.

2) Sequentially delete removable edges.
From a mathematical viewpoint such decomposition is interesting because, for planar graphs, it corresponds to the positroid stratification of the totally non-negative Grassmannian. Recall that the positroid stratification can also be regarded as the intersection between the matroid stratification and the totally non-negative Grassmannian. More generically, as we discuss in §9.1.4, for arbitrary graphs the decomposition considered in this section can be regarded as a partial matroid decomposition, which we shall call the combinatorial decomposition.
It is reasonable to only focus on reduced graphs, since it avoids the redundancies in the description of the Grassmannian associated to reducible graphs. It is natural to extend the decomposition defined by the two steps above to arbitrary reduced bipartite graphs and to investigate its implications. This will allows us to go beyond the positive regions of the Grassmannian, which are specific to the planar case. In analogy with the reasoning of §5, it is reasonable to expect that this decomposition is a natural candidate for capturing the singularity structure of on-shell diagrams beyond the planar limit.
The combinatorial decomposition can be nicely visualized in terms of a poset, in which every node corresponds to a reduced graph and arrows indicate the deletion of a removable edge. For planar graphs, every site in the poset corresponds to a positroid stratum, represented by a specific matroid stratum. Figure 16 presents the simple example of the positroid decomposition of the top-cell of Gr 2,4 , obtained by this procedure. 28 In the following, we will first apply our ideas to planar graphs, which are wellknown to experts. In coming sections we will also consider the non-planar case, which deserves a detailed study of its own, since it remains relatively unexplored. In practice, it is useful to exploit the algorithm in §8.1 for identifying removable edges.

Combinatorial Decomposition Via Polytopes
In this section we introduce an alternative implementation of the combinatorial decomposition. It exploits the matroid and matching polytopes, making the connection to the Grassmannian more transparent. In addition, it does not rely on reducibility or removability.

Step 1: Edge Removal
The first step of the process corresponds to removing every possible edge of the graph, one at a time. The process terminates when the surviving graph coincides with a perfect matching of the original one, i.e. to a vertex in the matching polytope. Notice that any edge can be removed, i.e. there is no restriction to removable edges. The graphs generated by this procedure and their relations can be organized into an Eulerian poset, which is different from the poset discussed in the previous section.
Interestingly, for planar graphs, removing edges is equivalent to constructing the face lattice 29 of the matching polytope [28]. In the next sections we argue and provide evidence that this is also valid for non-planar bipartite graphs. Let us explain in more detail the structure of the poset for the matching polytope. Consider a matching polytope of dimension d matching . Its boundary has dimension equal to (d matching − 1) and is a union of facets. Each facet is defined as the intersection of the boundary with a (d matching −1)-dimensional hyperplane. In turn, each of these facets has a (d matching −2)dimensional boundary, which can also be decomposed into faces, and so on. The face lattice of the matching polytope is generated by iterating the boundary operator until reaching 0-dimensional faces.
In this approach, faces are directly determined from the positions of points in the matching polytope. Computer applications constructing the set of faces for arbitrary polytopes are publicly available, see e.g. Polymake [38]. Contrary to the method based on removing edges, a single bipartite graph is only used at the initial step, for determining the matching polytope. Let us consider the planar graph associated to the top-cell of Gr 2,4 , which is shown in Figure 4. The matching polytope has seven different points corresponding to its perfect matchings and is given by the following perfect matching matrix This matrix defines a 4d polytope. This becomes clearer by row-reducing it, after which we obtain Let us briefly discuss the relation between edge removal and lower dimensional faces of the matching polytope. Recall that removing an edge X i results in eliminating the perfect matchings p µ for which the corresponding entry P iµ is equal to 1. In this example, we obtain eight different subgraphs at the first level, corresponding to eight 3d faces. We then continue removing additional edges, successively obtaining lower dimensional faces until reaching the vertices of the matching polytope, which correspond to the 7 perfect matchings. The resulting face lattice is shown in Figure 18. The previous discussion was phrased in terms of edge deletions. As we explained, the face lattice can be determined directly, without referring to edge removals.

Step 2: Identification
The final step in the combinatorial decomposition involves identifying perfect matchings associated to the same point in the matroid polytope, equivalently to the same Plücker coordinate. This results in the identification, or more precisely merging, of nodes in the poset for the face lattice of the matching polytope we constructed in the previous section.
The identification of perfect matchings can give rise to two qualitatively different types of identifications. We refer to them as horizontal and vertical identifications, following their effect on points on the poset. They are defined as follows: • Horizontal identifications: they merge nodes in the poset that sit at the same level. Their effect on the matching polytope is to identify different faces without affecting their dimensionalities.
• Vertical identifications: from the viewpoint of the poset, they merge nodes at different levels. They identify different points in a given face of the matching polytope and result in a lower dimensional one. Figure 17 shows simple examples of each class of identification at the level of the matching polytope. Generically, more than two perfect matchings can be simultaneously involved in identifications. This approach to decomposition makes certain general properties of the final poset obtained after identifications rather clear. In particular: • The number of levels is equal to the dimensions of the matching polytope of a reduced graph in the equivalence class of the starting point plus one. This number is invariant under graph equivalence, and does not depend on the initial graph being reduced.
• The number of sites in the lowest level of the poset is equal to the number of points in the matroid polytope.
Returning to the Gr 2,4 example, the matroid polytope in this case is given by: p 1 p 2 p 3 p 4 p 5 p 6 p 7 X 2,3 1 0 1 1 0 0 0 X 2,5 1 0 1 0 1 0 0 X 4,5 1 1 0 0 1 0 0 3) The 7 perfect matchings are mapped to 6 points, with p 6 and p 7 becoming coincident. Figure 18 shows the face lattice for the matching polytope. Colored nodes need to be merged with some of the white ones, following the identification of p 6 and p 7 : green and blue nodes are subject to horizontal and vertical identifications, respectively. White nodes correspond to the nodes in Figure 16. It is straightforward to verify that the entire structure of Figure 16, i.e. including its arrows, is recovered by the identifications.

Reducible Starting Points
It is important to stress that the combinatorial decomposition does not require irreducibility at any step. Not only restricting to removable edges, i.e. to reduced graphs at intermediate steps, is not necessary, but the starting point does not need to be a reduced graph. As we explained in §8, the redundancy in reducible graphs is accounted for by the identification of perfect matchings according to the matroid polytope. To see how things work in an explicit example, let us consider the reducible graph in Figure 19 which is equivalent to the single square box graph studied in the previous sections, and corresponds to the top-dimensional cell of Gr 2,4 . This graph has 10 perfect matchings, a relatively small increase with respect to the 7 perfect matchings of the single box graph. However, there is an explosion in the number of possibilities for removing edges. The corresponding poset is shown in Figure  29 of Appendix B.
The matching polytope is 5d. The difference in dimensions with respect to an equivalent reduced graph, which has a 4d matching polytope as in (9.2), is equal to the number of additional faces. This implies that, before identifications, the face lattice has an additional level.
The matroid polytope coincides with the one for the reduced graph given by (9.3), but with larger multiplicities. Perfect matchings are identified as follows:  Figure 18. Face lattice of the matching polytope for the graph in Figure 4. At each point, we indicate the corresponding graph and the surviving perfect matchings. When p 6 and p 7 are identified, green and blue nodes in the poset are subject to horizontal and vertical identifications, respectively.
from which we determine the horizontal and vertical identifications shown in Figure  29. These identifications lead to a vast reduction of the poset. The result contains only the white sites in Figure 29 and agrees, once again, with Figure 16.

Relation to the Matroid Stratification
In the previous section we introduced the combinatorial decomposition of a bipartite diagram and discuss different implementations. Here we consider another natural decomposition we can relate to a bipartite graph, which is the matroid stratification of the associated Grassmannian element, and comment on their relations. The boundary measurement provides the necessary map between a graph and the Grassmannian. For planar graphs, we obtain the non-negative Grassmannian from non-negative edge weights. Explicit details of its generalization to non-planar graphs are given in §10. In both cases perfect matchings can be mapped to Plücker coordinates by referring to the source set specified by them, as already reviewed in §6. Multiple perfect matchings can correspond to the same Plücker coordinate, which is associated to a point of the matroid polytope. This prescription results in a map ∆ I ↔ {p I i }, (9.5) where i runs over the multiplicity of the corresponding vertex in the matroid polytope. The map identifies the non-vanishing Plücker coordinates of the element of the Grassmannian associated to a bipartite graph. Next, we can follow §3.5 and construct the matroid stratification of this element of the Grassmannian. For instance, let us return to the square box diagram in Figure 4 and Figure 1 for the top-cell of Gr 2,4 . With the methods in §6, we can easily obtain: It is now possible to produce the matroid stratification, which is given by:  (9.8) in order to recognize the dimension of each matroid stratum and to arrange it at the correct level.
We are now in a position to discuss the relation between the combinatorial decomposition and the matroid stratification. Components in the combinatorial decomposition are matroid strata, i.e. they are defined by specifying sets of non-vanishing Plücker coordinates. However, generically not all matroid strata can be generated by removing edges from a fixed starting graph. The combinatorial decomposition can thus be regarded as a partial matroid decomposition. In §12, we speculate on possible ways to achieve the complete matroid stratification in terms of bipartite graphs.
In practical terms, the combinatorial decomposition is given by the intersection between the matroid stratification and the lattice generated by all possible edge removals. For planar graphs, this reduction can be alternatively obtained by intersecting the matroid stratification with the totally non-negative Grassmannian, as explained in §3. 6. The matroid interpretation of the polytope implementation in §9.1 for the combinatorial decomposition is clear. The first step restricts the space of strata to those which are reachable by removing edges. The second step eliminates the redundancy in the description of these strata arising from equivalent graphs.

Boundary Measurement for Non-Planar Graphs
In this section we extend the definition of the boundary measurement beyond the planar case. This is a crucial element necessary for extending the map between general bipartite graphs and the Grassmannian. The boundary measurement has been already defined for planar graphs [19] and the annulus [39]. Here we generalize it to the case of graphs on the plane with an arbitrary number of boundaries. Figure 21.a shows an example with two boundaries. Figure 21.b illustrates how crossing external legs can be traded by additional boundaries.
A desirable property of a well-behaved boundary measurement is that the matroid polytope derived from the graph should coincide with the one for the corresponding Grassmannian element. This in particular implies that the boundary measurement should realize the map between Plücker coordinates and perfect matchings already mentioned in §6.2.3.
As we show in the next subsections, our generalization of the boundary measurement to multiple boundaries obeys this property and, moreover, nicely contains as subcases the boundary measurement for graphs on the disk and the annulus.
It is important to note that in the non-planar case the Plücker coordinates are no longer positive definite, given positive edge weights, as will be shown explicitly in the following examples. Thus, the image of the map is no longer restricted to the positive part of the Grassmannian.  Figure 20. Positroid stratification of Gr 2,4 . Each graph maps to a matroid stratum whose matroid is indicated in dark green. The positroid stratum containing the matroid stratum is shown in light green. We see that all positroid strata are present, and no two graphs are in the same positroid stratum.

Boundary Measurement for the Annulus
Initiating our discussion of multiple boundaries, in this subsection we shall review a method by Gekhtman, Shapiro and Vainshtein [39] that maps graphs on the annulus to elements of the Grassmannian. Every perfect matching gives rise to a perfect orientation. As in the planar case, we construct a matrix C whose rows correspond to sources of the perfect orientation and columns correspond to all external nodes. In analogy with what discussed in §4, C is constructed by selecting certain entries of the more general path matrix. Each matrix entry in C may be composed of several terms, reflecting the fact that there may be multiple ways to flow along the perfect orientation from a given source to a given sink. For non-planar graphs the boundary measurement needs to deal with two subtle points: • The ordering of external edges follows a specific prescription when there are multiple boundaries.
• The signs assigned to the matrix entries require a careful treatment.
For the annulus, tackling these issues demands the introduction of a cut connecting the two boundaries, shown as a green dotted line in Figure 21.
Regarding the first point, the canonical ordering on the annulus is to start from the cut and go clockwise around the outer boundary, followed by counterclockwise counting from the cut around the inner boundary. 30 In the next subsection we will introduce a generalization for graphs with an arbitrary number of boundaries.
To address the second point, signs in the matrix C have two distinct origins. The first type of signs is the same as that present in the planar case; these are overall signs which all terms in a given matrix entry C ij are subject to. As in the planar case, the overall sign of each entry is (−1) s(i,j) , where s(i, j) is the number of sources strictly between i and j, neglecting periodicity.
The second type of sign comes from the rotation number of the actual path connecting a source and a sink. In order to find the sign for each path it is necessary to first complete the path to form a closed loop. The prescription for closing the loop is as follows: • If the source and the sink are both on the same boundary, the path is closed by adding a segment from the sink to the source which runs clockwise along the boundary.
• If the source and the sink are on different boundaries, the path is closed by adding a segment that runs clockwise from the sink to the cut, traverses along the cut to the other boundary, and runs clockwise along this boundary until reaching the source.
The sign of a path P is given by (−1) r(P )+1 , where r(P ) is the rotation number of the closed path [39], which can be easily calculated by splitting it at each self-intersection. This gives a number of closed loops that have clockwise or counterclockwise orientation. The rotation number is given by the difference of the number of clockwise loops with the number of counterclockwise loops. Note that this sign automatically accounts for the sign (−1) introduced for a path which runs over a loop in a perfect orientation, reviewed in §4.
The cut essentially measures the non-planarity of a path, by counting how many times it goes around the non-trivial direction of the annulus. For this reason, it is heuristically clear that the results cannot depend on the choice of cut. This is shown to be the case in [39]. Example 1. We shall illustrate the method using the example in Figure 21.a, which is shown in more detail in Figure Figure 22. A non-planar graph for a top-dimensional region of Gr 3,5 . The cut is indicated by a green dotted line. Arrows show the perfect orientation associated to the perfect matching p 1 , which contains edges X 1,3 , X 1,6 , X 2,3 X 5,4 and X 5,6 .
The perfect matchings for this case are given by: (10.1) -52 -We take as reference perfect matching p 1 , which leads to the perfect orientation displayed in the figure, and hence the source set {2, 3, 5}. Thus, C takes the form where generically non-zero entries have been marked with an asterisk, and the signs (−1) s(i,j) have been inserted. We now proceed to introduce relative signs for the matrix entries. Computing the path matrix, we see that there are precisely two paths between source 2 and sink 1: α 1,5 α 5,4 α 5,6 and α 2,1 α 4,1 α 6,1 α 1,3 α 1,6 α 5,4 α 5,6 . In both cases the closed loop is formed as described above, and since this forms a single circle, there are no additional signs.
It is a non-trivial fact that the Plücker coordinates of (10.3) can be written as sums of perfect matchings (or more precisely flows given by the ratio between perfect matchings and the reference matching), whose source set is precisely the set of columns involved in the Plücker coordinate in question. For example, ∆ 123 is given by a sum of contributions from perfect matchings whose flows have source set {1, 2, 3}. In fact, it is a requirement of a well-behaved boundary measurement that its Plücker coordinates have this property. 31 This is because we identify Plücker coordinates ∆ I with elements I ∈ M of a matroid, which in turn are identified with points of the matroid polytope arising from the graph. These points are formed by the union of perfect matchings which share the same source set I.
The Plücker coordinates are: Multiplying all Plücker coordinates by the oriented reference matchingp 1 we obtain the desired map between Plücker coordinates and perfect matchings. It is straightforward to check that all perfect matchings contributing to a Plücker coordinate have the correct source set.
As an additional check, we will now show that the removable edges found using the technique expounded at the end of §8.1 are the correct ones, i.e. are those that only kill one Plücker coordinate each, thus decreasing the dimension by 1. The predicted removable edges are X 1,3 , X 3,6 , X 1,5 , X 2,1 , X 4,1 and X 6,2 . Removing them results in:
Example 2. For the example shown in Figure 21.b we have the perfect matchings: (10.5) Choosing as reference perfect matching p 2 , the boundary measurement maps the graph to the Grassmannian element which gives rise to the following Plücker coordinates: Note that contrary to the planar diagram of Gr 2,4 studied in §4, here the Plücker coordinates are no longer positive definite for positive edge weights.

Boundary Measurement Beyond the Annulus
In this section we introduce a boundary measurement for graphs on the plane with an arbitrary number of boundaries. The new map reduces to the previously known cases when restricted to the disk or the annulus. As previously mentioned, the map must be insensitive to graphical equivalences and its minors must be identifiable with linear combinations of perfect matchings. 32 Additionally, for diagrams on the disk we require that all minors are manifestly non-negative, for positive edge weights. As we saw in the previous subsection, the success of the boundary measurement is crucially reliant on a delicate assignment of signs to entries in the path matrix. When going from the disk to the annulus, the difficulties of introducing an additional boundary were twofold: first, the ordering of external nodes was sensitively fixed according to the prescription in [39]; secondly, it was necessary to complete the path (possibly using the cut) and form a loop in order to count additional loops which are not naturally present in the chosen perfect orientation.
Introducing more boundaries has similar difficulties. The ordering of the external nodes for a generic number of boundaries can be fixed in a way which is reminiscent of going around cuts in complex analysis. The algorithm is as follows: • Start at a cut on one of the boundaries. We will preferably choose the outer one.
• Follow the boundary in a clockwise fashion, until reaching a cut.
• Follow it to the next boundary, without crossing over it.
• Follow the next boundary until reaching another cut.
• Follow the cut to the next boundary, once again without crossing it, and continue in this fashion until reaching the starting point.
For the disk and annulus, this procedure fixes a clockwise ordering for the external boundary, followed by a counter-clockwise ordering for the internal boundary, in agreement with the previous section. The assignment of signs in the matrix C works similarly to our discussion for the annulus: there is the usual overall sign (−1) s(i,j) to the entry C ij , where s(i, j) counts the number of sources strictly between i and j, neglecting periodicity. There is also a 32 Whether such a map is unique is an interesting question, beyond the scope of this article. sign related to the loops which compose the path. In order to compute it, we close the path by going from the sink clockwise around the corresponding boundary, and then following the necessary cuts and boundaries, always going clockwise, until reaching the source. The sign is then (−1) r(P )+1 , where r(P ) is the rotation number of this closed path, obtained by counting the number of clockwise loops minus the number of counterclockwise loops, as already explained in the previous section.
For computational convenience, there is a significantly faster way to compute these second type of signs, which does not involve drawing and analyzing the path. Each time a path runs across a cut, it picks up a minus sign iff it is going between two boundaries that can only be reached using this cut. Each entry in C is specified by its source and sink; it is easy then to identify which cuts are going to be actively used in this matrix entry. Thus, each matrix entry activates sign flips for only those edges that run across the relevant cuts. In addition to these signs, it is necessary to add signs to closed loops that are present in the perfect orientation. From a computational standpoint, it is then only necessary to provide information on how nodes are distributed over the different boundaries, which cuts are activated by each pair of boundaries, and which edges are crossed by the respective cuts.
Example: 3 Boundaries. To illustrate the method above let us consider the example in Figure 24. This is a reduced graph with three boundaries. This is the minimum number of boundaries for this graph, i.e. it is impossible to reduce it by flipping external legs. We will later investigate the effect of redistributing external edges over boundaries.
The ordering of external nodes is determined by starting at the upper cut on the outer boundary and proceeding according to the algorithm above. This is shown in Figure 25.
This diagram has 88 perfect matchings. For amusement, and to show it is straightforward to explicitly deal with such large graphs using our tools, we provide the perfect matching matrix in Appendix C.
The reference perfect matching was chosen to be p 1 , which gives rise to the perfect orientation in Figure 24. This example exhibits an interesting phenomenon: the perfect orientation contains a closed oriented loop α 6,3 α 9,3 α 3,7 α 3,10 = p 3 . 33 When this happens, path connecting two nodes can circle an arbitrary number of times around the internal loop. The sum of contributions to entries in the path matrix thus takes the form of a geometric  Figure 24. A graph with 3 boundaries. The perfect orientation shown corresponds to the oriented perfect matching p 1 , which contains edges X 1,4 , X 3,7 , X 3,10 , X 6,4 , X 6,7 , X 8,2 and X 8,10 . series, leading to non-trivial denominators containing the loop (see Appendix A). The piece of the path matrix contributing to the boundary measurement takes the form where the (1 − p 3 ) −1 factors arise due to the infinite number of paths involving the closed loop. Signs are introduced in three steps: first to overall entries according to (−1) s(i,j) , then to loops that are present in the perfect orientation, in this case p 3 , and finally to the edges that cross the cuts, in the relevant entries. 34 After introducing the first two types of signs, the matrix becomes For the third type of signs there are two cuts, the one to the left c L which reaches between the outer boundary and the left-most boundary, and the one to the right c R which reaches between the outer boundary and the right-most boundary. To go from the right-most and the left-most boundary it is necessary to use both cuts. The relevant cuts for each entry are summarized in the following matrix The action of the cuts are c L : {α 7,2 , α 2,9 } → {−α 7,2 , −α 2,9 } and c R : α 4,10 → −α 4,10 . Applying the action to the path matrix, we finally obtain the desired element of the Grassmannian: At first sight, (10.12) does not include contributions from all perfect matchings. For example, p 25 does not appear anywhere. This is a result of the fact that the flow p 1 associated to the reference perfect matching we chose, has the same sources and sinks as the flow p 3 , which corresponds to a different perfect matching. Equivalently, p 1 and p 3 correspond to the same point in the matroid polytope. In order to accurately obtain the map between Plücker coordinates and perfect matchings it is necessary to multiply (10.12) byp 1 +p 3 , after which we obtain: All perfect matchings nicely appear now. It is straightforward to verify that all perfect matchings indeed have the source sets associated to the corresponding Plücker coordinate.
Example: 4 Boundaries. To illustrate our methods, let us consider the example with 4 boundaries shown in Figure 26. This is basically a formal exercise, mainly intended to see once again the general techniques at work, since, as the alert reader might easily realize, the new example only differs from Figure 24 by changing the distribution of external nodes over boundaries. Such reorganization can be regarded as an elaborate generalization of external leg crossing. Having noticed the relation to the previous example, our discussion will be briefer.  Figure 24 by redistributing external nodes over boundaries. As before, we pick a perfect orientation given by the perfect matching p 1 , which contains the edges X 1,4 , X 3,7 , X 3,10 , X 6,4 , X 6,7 , X 8,2 and X 8, 10 . (10.15) Before closing, let us briefly discuss the effect of two operations that can affect the ordering of external nodes: modification of cuts and redistribution of external nodes over boundaries, including the possibility of creating new ones. Changing cuts has no net effect: once the labels of Plücker coordinates have been permuted to the original order, one finds the same map between minors and perfect matchings. Changing the actual distribution of external nodes over boundaries by flipping external legs produces a new map, in which the relative signs of the perfect matchings are different.
For planar graphs the latter operation has a simultaneously strong and irrelevant effect. Such a change in general implies the loss of positivity. The decomposition of the flipped diagram will not be the positroid stratification, because each irreducible subgraph will not correspond to a different positroid. However, it would be positroidlike: apart from the matroid labels of each irreducible subgraph, the poset for the non-planar case would be identical to that of the positroid stratification. In fact, permuting the labels of the matroid strata will reproduce the positroid stratification. This is further discussed in §12, where the case of Gr 2,4 is shown explicitly.

Combinatorial Decomposition of Non-Planar Graphs
In this section we will apply the techniques introduced in §9 to non-planar diagrams. We present in detail a few examples and construct their decomposition. As we will show in these examples, the combinatorial decomposition of non-planar on-shell diagrams does not correspond to the positroid stratification of the Grassmannian, but is still a subset of the matroid stratification. §12 collects some ideas about how the full matroid stratification might be achieved by combining different graphs.

Example 1: Graph on the Annulus
We begin by illustrating our techniques with the example displayed in Figure 22. This example has 15 perfect matchings. The matching polytope is given by (10.1) and is 6-dimensional. The matroid polytope is and has dimension 4. This example has 10 non-vanishing Plücker coordinates, and the following Plücker relations: of which only 3 are independent. The face lattice of the matching polytope contains 412 elements of various dimensions; it is therefore very impractical to draw the full poset. Below we present the first level in detail, subsequent levels follow analogously.
In the table above we show the surviving perfect matchings after removing the corresponding edge in the graph, and after the identifications in (11.4). We also show the non-vanishing Plücker coordinates for each subgraph.
As a consequence of the identifications, the faces in the lower half of the table are of dimension lower than 5 and get identified with other lower-dimensional ones, i.e. they are subject to vertical identifications. This can be deduced by counting the surviving Plücker coordinates and relevant Plücker relations (11.2). Hence X 1,6 , X 6,1 , X 2,3 , X 5,4 , X 5,6 , X 3,2 and X 6,4 are not removable edges. For the remaining 6 boundaries there is no horizontal identification at this level, so the 6 removable edges are X 1,3 , X 3,6 , X 1,5 , X 2,1 , X 4,1 and X 6,2 . The removal of any of these edges yields a 5-dimensional element of the Grassmannian. Each of these corresponds to a differential form which is a singularity in the sense explained in §5. Moreover, each of the boundaries also corresponds to a matroid stratum with 9 elements each, where the elements are given by the indices of the Plücker coordinates in (11.5).
Full Combinatorial Decomposition. To represent the boundaries of the entire poset, we group the elements in each level of the poset by how many perfect matchings they have, thus presenting the information of each level by pairs of numbers, where the first specifies the number of faces of a certain type and the second specifies the type.
For example, 14 [6] means there are 14 faces, each containing 6 perfect matchings. This information is presented in Table 1.   that these tables agree with the detailed analysis of the first level presented before. As a further check, using the methods introduced in §8 and applying the identification (11.4) it is straightforward to check that Table 2 is consistent with the poset obtained by deleting only removable edges.

Example 2: Graph with 3 Boundaries
To further illustrate the computational power of these techniques, we treat the example presented in Figure 24, which has 88 perfect matchings. The matching polytope has in total 74670 faces, which after identification reduces to 8585 faces. The face lattice information, before and after identification, is presented in the table below. d Faces of matching polytope Matroids

Non-Eulerian Posets
The face lattice of a convex polytope is a graded poset. Moreover this poset is Eulerian, which means that the number of elements of even dimension is one more than the number of elements of odd dimension, i.e. B is the number of faces of the polytope of dimension i. 35 As a check that the face lattice of the matching polytope for non-planar graphs can be obtained through successive edge removal, we evaluate the Eulerian number in the two previous examples: Example 2: While the positroid stratification was shown to be Eulerian [40], for non-planar cases the combinatorial decomposition is in general not Eulerian. This can be seen for example by computing the Eulerian number for the two examples above: Example 1: The appearance of non-Eulerian posets should not be surprising. Due to the identifications involved in the combinatorial decomposition, the resulting poset might not describe the face lattice of a geometric polytope.

Matroid Stratification from Multiple Graphs
As already explained in §9.1.4, the combinatorial decomposition yields a subset of the matroid stratification: only certain strata appear in the decomposition. It is then natural to ask whether it is possible to extend it such that it produces the full matroid stratification. This leads us to the following reasonable conjecture: • Conjecture: The full matroid stratification can be obtained by simultaneously considering the combinatorial decomposition of multiple bipartite graphs associated to Grassmannian elements with a maximal number of degrees of freedom. Some of these graphs are non-planar. The matroid stratification is given by the union of the resulting strata.
This proposal follows from the definition of the matroid stratification in §3.5. Analogously to the positroid stratification, where we take the common refinement of n cyclically permuted Schubert cells, hence n cyclic permutations, the matroid stratification is in general the refinement over all n! permutations. Here we remind that every permutation specifies a lexicographic order that characterizes the Schubert cell, analogously to §3.3. The distribution of external nodes over boundaries gives rise, following the discussion in §10, to different orderings, which we map to these permutations.
In essence, to access all the permutations and hence all the matroids, we have to consider permutations which cannot be obtained by cyclic rotations of 1, 2, . . . , n, which are the only ones that can be realized on planar graphs. The other permutations can be obtained only by introducing new boundaries, thus making the graphs non-planar.
To illustrate this idea, let us consider the decomposition of the diagram in Figure  21.b which, after introducing an additional boundary and the corresponding cut, is the same as the square box but with ordering 1243. The decomposition is obtained through the procedure explained in §9 and is shown in Figure 27, where the matroid label is given in dark green and the positroid label is in light green. The matroid labels are identical to those of Figure 16, but with 3 and 4 interchanged, as mentioned at the end of §10.2. The fact that we no longer have the positroid stratification is confirmed by the fact that the positroid stratum {C ∈ Gr 2,4 | ∆ 12 = 0, ∆ 23 = 0, ∆ 34 = 0, ∆ 14 = 0} has multiple representatives, and some positroid strata are missing, e.g. {C ∈ Gr 2,4 | ∆ 12 = 0, ∆ 24 = 0, ∆ 34 = 0, ∆ 14 = 0}. However, we note that the decomposition just obtained is precisely the same as that of §3.4 but where each component is the simultaneous refinement of 4 cyclically permuted Schubert cells with respect to the lexicographic order specified by the permutation 1243.
In the decomposition of the non-planar graph, the matroid strata that were missing from the decomposition of the planar case with ordering 1234, marked in red in (9.7), are now present. Hence we conclude that the union of the matroid strata of the decomposition in Figure 16 and Figure 27 gives the entire matroid stratification, at  least at the combinatorial level. We provide in Figure 28 a depiction of how the two decompositions together form the entire matroid stratification. The matroid strata are marked by a green circle, where the matroid labels have been included underneath. Generally, including all n! permutations of external edges modulo cyclicity will include all matroid strata, but in practice it can be sufficient to consider fewer permutations.  Let us explain why this is the case and show how to determine the diagrams required for the matroid stratification in the case of Gr 2,4 , whose matroid contains the 6 bases 12, 13, 14, 23, 24 and 34. We begin by only discussing the problem in terms of permutations and lexicographic orders, and explain how the graphs fit into this picture at a secondary stage.

{13}
Each permutation of 1, 2, 3, 4 specifies a lexicographic order, to which we can associate a Schubert cell analogously to the definition in §3.3. The positroid stratification uses n permutations, related to each other by cyclic shifts, and the corresponding Schubert cells, and is then specified by n entries. To put a label in each entry, we select the lexicographically minimal non-zero element with respect to the permutation in question. For example, the permutation 2413 will select the matroid element (24), if present, otherwise select (21), if present, etc.
The matroid stratification generically uses n! permutations. However, in order to find all the strata, it is sufficient to refine over the set of Schubert cells such that for each base there exists a Schubert cell whose lexicographic order has that base as minimal element. Thus, to specify all matroids in the example at hand, we will need 6 permutations, each permutation having a different lexicographically minimal order of the form: 12XX, 13XX, 14XX, 23XX, 24XX, 34XX, (12.1) where XX may be any order of the remaining two digits, e.g. it does not matter whether we choose 1342 or 1324. For example, the first lexicographic order will always find the matroid base 12, regardless of the presence or absence of other bases; the second one will always find 13 regardless of the other matroid bases, and so on. Strictly speaking the order of the first two digits is also irrelevant, since either order specifies the same matroid element. In this way, each matroid base, if present, will appear in one of the six entries associated to the different lexicographic orders. A set of 6 permutations as in (12.1) are sufficient for labeling all matroids with the correct matroid labels. Graphs fit into this picture as follows. Each graph specifies an ordering, dictated by the arrangement of the external edges. Because of cyclicity of the starting point, the graph actually specifies n orderings, related to each other by cyclic shifts. In this example, the planar graph has the ordering 1234, which specifies the permutations 1234, 2341, 3412, 4123, (12.2) which simply differ in which edge of the graph we call "1". We see that such a graph contains 4 of the required lexicographic orders. 36 We are however still missing a permutation of the form 13XX and one of the form 24XX. If we introduce a second graph with the ordering 1243, we obtain the permutations 1243, 2431, 4312, 3124, (12.3) which contain the lexicographic orders given by 3124 and 2431 as desired, and two more which were already covered by the previous graph. Thus, we see that the two graphs with ordering 1234 and 1243 are sufficient to cover all lexicographic orders and corresponding Schubert cells which are required to specify the matroids. We then argue that their decomposition will cover the combinatoric structure of the entire matroid stratification.
As a check at the first level, we indeed see that the decomposition of the two diagrams does indeed overlap in the matroids obtained by removing 12 or removing 34, which are precisely the lexicographically minimal sets of those permutations which in 36 We remind once more that it does not matter whether it is 4123 or 1423: either way the lexicographically minimal element will be the one corresponding to the Plücker coordinate ∆ 14 .
the arguments above were covered by both orders 1234 and 1243, and by 3412 and 4312, respectively. Likewise, at the first level the decompositions do not overlap precisely on the matroid labels which are lexicographically minimal to those permutations which do not overlap for the two orderings. This is also true at the second level, where {12, 13, 24, 34} is missing 14 and 23, which are precisely those which are not lexicographically minimal of any permutation in equation (12.3). Also, {12, 14, 23, 34} is missing 13 and 24, which are precisely those which are not lexicographically minimal of any permutation in equation (12.2).
It is reasonable to expect that it might be possible to find which graphs are necessary to cover the entire matroid stratification by simply listing the set of all possible matroid elements, a set of permutations for which these elements are the lexicographically minimal subsets, and finding graphs whose ordering can achieve these permutations. We leave a detailed study of this interesting possibility for future investigation.

Conclusions
We presented a detailed investigation of the geometric and combinatorial structures, such as the Grassmannian and toric Calabi-Yaus, which are ingrained in quantum field theory at a fundamental level. Such objects become manifest when formulating gauge theories in terms of on-shell diagrams, equivalently bipartite graphs. We extended these correspondences along various directions, most notably by the inclusion of nonplanarity. In our opinion, the new structures we uncovered are natural candidates to arise in scattering amplitudes beyond the planar limit. This is certainly one of the most interesting questions in this area worth pursuing in the future.
As part of our investigation, we introduced a new combinatorial decomposition of the Grassmannian, which reduces to its positroid stratification for planar graphs. We explained how this decomposition can be directly obtained from the matching and matroid polytopes. We also extended the boundary measurement, which maps bipartite graphs to the Grassmannian, to graphs with an arbitrary number of boundaries. We discussed a quantitative measurement of graph reducibility and introduced several efficient algorithms for computing the boundary measurement, and for constructing the matroid and matching polytopes.
Our work suggests that general bipartite graphs, i.e. including non-planar ones, can lead to a more refined description of the Grassmannian. It would be extremely interesting to continue investigating, along the lines of §12, how they can be exploited for the matroid stratification of the Grassmannian.
Finally, it would also be interesting to determine whether our ideas are relevant for the most recent geometric understanding of scattering amplitudes based on the amplituhedron.

A The Path Matrix
In this appendix we describe an efficient algorithm to extract the paths for a given perfect orientation of a bipartite diagram, planar or non-planar. This is an important step of the boundary measurement which maps bipartite graphs to elements of the Grassmannian. The path matrix M is an n v × n v matrix, where n v is the number of vertices in the diagram. Given a perfect orientation, each entry M ab contains the sum of edge weights for all oriented paths connecting vertices a and b. We shall now show how this matrix can be obtained using the Kasteleyn matrix.
The perfect orientation is determined in terms of a reference perfect matching p ref as explained in §2.1. We now construct two matrices as follows: we define K r as the Kasteleyn matrix where we have set to zero the edge weights X i,j ∈ p ref and replaced all other X i,j → α i,j ; we defineK r as the Kasteleyn matrix where we have set to zero all the edge weights not belonging to p ref , and sent X i,j → 1/α i,j for the edge weights X i,j ∈ p ref . We then arrange the following n v × n v matrix: where n w and n b is the number of white and black nodes, respectively. The path matrix is M = C −1 .
The entries M ab are generally sums of ratios of edge weights α i,j , where the denominator contains those α i,j inp ref which are relevant to the path. We remind the reader that an edge in the numerator signifies that the direction of that edge is from the white node to the black node, an edge in the denominator signifies the opposite direction.
Sometimes a path from a vertex a to a vertex b contains a loop. This results in an infinite number of paths from a to b, which differ in the number of times the path runs over the loop. The entry M ab will thus contain the infinite sum of paths: (1 − loop) −1 = 1 + loop + (loop) 2 + . . . .
Let us consider the non-planar bipartite graph associated with Gr 3,5 , displayed in Figure 22. The Kasteleyn matrix is X 6,2 X 2,1 X 1,6 0 0 X 3,6 X 1,3 0 X 6,1 0 0 0 X 4,1 X 1,5 X 5,4 -76 -Let us consider the perfect orientation in Figure 22. The two auxiliary matrices become The path matrix is   Figure 29 shows the face lattice of the matching polytope for the reducible graph in Figure 19. We list the surviving perfect matchings for every point in the poset. Due to space limitations, we do not provide the corresponding bipartite graphs. Green and blue dots are merged with white ones under horizontal and vertical identifications, respectively. The identifications are determined by (9.4).  Figure 19. At each point, we indicate the surviving perfect matchings. Following the identifications in (9.4), green and blue nodes in the poset are subject to horizontal and vertical identifications, respectively.