Non-Planar On-Shell Diagrams

We initiate a systematic study of non-planar on-shell diagrams in N=4 SYM and develop powerful technology for doing so. We introduce canonical variables generalizing face variables, which make the dlog form of the on-shell form explicit. We make significant progress towards a general classification of arbitrary on-shell diagrams by means of two classes of combinatorial objects: generalized matching and matroid polytopes. We propose a boundary measurement that connects general on-shell diagrams to the Grassmannian. Our proposal exhibits two important and non-trivial properties: positivity in the planar case and it matches the combinatorial description of the diagrams in terms of generalized matroid polytopes. Interestingly, non-planar diagrams exhibit novel phenomena, such as the emergence of constraints on Plucker coordinates beyond Plucker relations when deleting edges, which are neatly captured by the generalized matching and matroid polytopes. This behavior is tied to the existence of a new type of poles in the on-shell form at which combinations of Plucker coordinates vanish. Finally, we introduce a prescription, applicable beyond the MHV case, for writing the on-shell form as a function of minors directly from the graph.

At this point, there are very clear directions in which this program can be extended: considering quantum field theories in other dimensions or reduced supersymmetry and going beyond the planar limit of N = 4 SYM. This article is devoted to the latter, more concretely to non-planar on-shell diagrams. Although there has been important progress in the study of non-planar amplitudes in N = 4 SYM [32][33][34][35][36], they are far less understood than amplitudes in the planar sector. Recently, building on the observation based on on-shell diagrams that the loop integrand in planar amplitudes has only logarithmic singularities and no poles at infinity, it has been conjectured that nonplanar amplitudes share the same property [37]. Further evidence supporting this conjecture was provided in [38].
On-shell diagrams are extremely useful for studying scattering amplitudes. In particular, in the planar limit, the all-loop integrand in N = 4 SYM can be expressed in terms of on-shell diagrams. Currently there is no well-defined notion of loop integrands for the amplitudes beyond the planar limit, however non-planar on-shell diagrams are still certainly worth studying since, to say the least, they provide a description for the leading singularities of loop amplitudes. 1 This direction recently began to be explored in [39], 2 primarily in the case of MHV leading singularities. In this paper, we initiate a systematic study of general non-planar on-shell diagrams in N = 4 SYM and develop powerful technology for doing so. We further explore their physical applications. General on-shell diagrams are constructed by gluing elementary MHV and MHV three-point on-shell amplitudes together. Since every three-point amplitude also carries a color factor, so does the on-shell diagram built from them. While important, this color factor will be omitted from now on in our discussions.
We begin this article with a brief review of planar on-shell diagrams and of some basic bipartite technology in §2. Before studying non-planar on-shell diagrams in full generality, we discuss in §3 a concrete scenario in which non-planar on-shell diagrams appear and are relevant: the computation of tree-level amplitudes using non-adjacent BCFW shifts. In the following sections, we introduce powerful technology for a systematic understanding of the general non-planar case. Below we list some of the main concepts we will present.
§4 introduces canonical variables for non-planar graphs generalizing face variables, which have proved extremely useful in the planar case. Among other things, these variables allow a straightforward determination of the degrees of freedom in a graph and automatically make the d log structure of the on-shell form manifest. We also discuss a systematic procedure for determining such canonical variables, based on embedding on-shell diagrams into bordered Riemann surfaces. Physical results are, of course, independent of the choice of such an embedding.
In §5, we present two combinatorial objects, the generalized matching and matroid polytopes, which provide a general characterization of non-planar on-shell graphs and are extremely useful in extending the notion of graph equivalence and reductions to the non-planar case. As for planar graphs, these two concepts can be exploited to reduce the infinite plethora of possible on-shell diagrams to a finite number of important ones. The canonical variables of §4, also give rise to a straightforward procedure for constructing these polytopes.
On-shell diagrams are mapped into the Grassmannian via the boundary measurement. In §6, we propose a boundary measurement for completely general on-shell diagrams. So far, the boundary measurement was only known for graphs admitting a genus-zero embedding. Needless to say, the boundary measurement is an essential ingredient for developing a comprehensive theory of non-planar on-shell diagrams. A crucial ingredient in our construction is a delicate choice of signs, which achieves two important goals. First, the signs are necessary for positivity in the case of planar graphs and its generalization for non-planar ones. Second, our sign prescription beautifully leads to the combinatorial description based on generalized matroid polytopes.
While going from an on-shell diagram to the corresponding on-shell form in terms of face variables is straightforward, it is however much more challenging to directly obtain its expression in terms of minors. In §7, we generalize the prescription introduced in [39] beyond the MHV case, which allows us to directly write the on-shell form of reduced diagrams as a function of minors starting from the graph. We compare the results of this proposal with those obtained using the boundary measurement, finding perfect agreement. An interesting new feature of non-planar on-shell diagrams we uncover is the possibility of a new kind of pole in the on-shell form, not given by the vanishing of the Plücker coordinates.
In §8, we present a comprehensive discussion of equivalences and reductions of non-planar graphs. We provide a systematic approach for beginning to address these issues based on generalized matching and matroid polytopes. Interestingly, non-planar graphs can exhibit new phenomena, such as non-unique reductions and the appearance of new constraints between Plücker coordinates that are beyond Plücker relations, to which we will refer as non-Plücker constraints for short. The latter is directly tied to the emergence of the new type of poles found in §7. Throughout the article, we collect several explicit examples illustrating our ideas.

Planar On-Shell Diagrams and Bipartite Technology
In this section we quickly review some basic concepts regarding on-shell diagrams and tools for studying bipartite graphs.

On-Shell Diagrams and On-Shell Forms
N k−2 MHV leading singularities with n external states in planar N = 4 SYM are given by contour integrals over the Grassmannian Gr k,n [20]. Gr k,n is the space of k-dimensional planes in C n passing through the origin, so points in it can be represented by k × n matrices C modulo GL(k). We thus have (1 · · · k)(2 · · · k + 1) · · · (n · · · k − 1) , (2.1) where Γ k,n stands for the contour, namely a prescription for which particular combination of k ×k consecutive minors of the matrix C must be set to zero in order to compute the residues, and W a encode the kinematical data in terms of supertwistors.
Here and in what follows, (i 1 , . . . , i k ) denotes the minor corresponding to columns i 1 , . . . , i k . The emergence of the Grassmannian in the context of scattering amplitudes was fully understood with the introduction of the on-shell diagram formalism [25], which is valid beyond leading singularities. In this section, we briefly review the main properties of planar on-shell diagrams, with the aim to introduce the basic concepts that will be generalized in coming sections to the non-planar case. For a detailed presentation, we refer the reader to the original work [25].
On-shell diagrams are graphs constructed by connecting vertices which represent three-point amplitudes along edges that represent on-shell momenta. 3 There are two types of (non-vanishing) three-point amplitudes, A MHV 3 and A MHV 3 , which are represented by black and white vertices, respectively. Nodes are glued together via the integration over the on-shell phase space of the (super) momentum associated to the edge shared by two vertices. 4 In the Grassmannian formulation, A MHV 3 is given by an integral over Gr 2,3 while A MHV 3 corresponds to an integral over Gr 1,3 . As vertices are glued together, they give rise to a larger Grassmannian Gr k,n . For a trivalent on-shell diagram with n B internal black nodes, n W internal white nodes and n I internal edges, the value of k is given by k = 2n B + n W − n I . (2. 2) The number of degrees of freedom d of a general on-shell diagram is obtained by starting from the edge weights and subtracting the GL(1) gauge redundancy associated to every internal node. This means that for a diagram with E edges and N internal nodes, we have The previous expression is completely general. For a planar on-shell diagram with F faces, this is equal to d = F − 1. This means that all edge weights can be expressed in terms of F − 1 independent ones. Another useful parametrization of an on-shell diagram is in terms of face variables f i , i = 1, . . . , F , which are subject to the constraint F i=1 f i = 1. They are given by the product of all edge weights around a face (closed or open) and, for concreteness, they can be taken to be oriented clockwise. Face variables constitute a GL(1) invariant way of parametrizing the degrees of freedom of the graph. In §4, we will generalize them to non-planar diagrams and discuss how the counting of degrees of freedom is modified.
Generalizing (2.1), every on-shell diagram, either planar or non-planar, is associated to a differential form δ 4|4 (C αa W a ) , (2.4) where the first product is taken over all internal nodes. We will refer to the form excluding the δ-functions as the on-shell form Ω corresponding to a given on-shell diagram. The full on-shell form associated to a d-dimensional planar on-shell diagram in terms of edge or face variables is of the "d log" form [25] Expressing the on-shell form in terms of edge weights requires using the GL(1) redundancies to identify d independent variables. This task is bypassed when using face variables. In the next section, we will develop the generalization of face variables for non-planar graphs. When the dimension of the graph coincides with the dimension of Gr k,n , i.e., d = k(n − k), the on-shell form is said to be top-dimensional and (2.5) becomes equivalent to (2.1) after including the δ-functions. If the dimension of the graph is larger than the dimension of Gr k,n , the graph may be reduced, as discussed at length in §8, into a graph of dimension d ≤ k(n − k). If the dimension of the graph is smaller than the dimension of Gr k,n , (2.5) arises as certain residue of (2.1); the residue is taken around the vanishing of those minors which disappear once those graphical degrees of freedom have been turned off.

Equivalence Moves and Reductions
On-shell diagrams form equivalence classes and can be connected by reductions. Equivalent on-shell diagrams are related by a sequence of the following equivalence moves: 5 Merger. Connected internal nodes of the same color can be merged. A multi-leg black (white) vertex means that all λ's (λ's) connected to it are proportional. Alternatively, whenever two internal nodes of the same color are connected by an edge, we can introduce a 2-valent node of the opposite color between them. Any on-shell diagram can be made bipartite by using these operations. Throughout the rest of the article, we will thus focus almost exclusively on bipartite graphs. 6 Mergers can be used in both directions, to either increase or decrease the valency of nodes. Figure 1. In a merger move, two connected internal nodes of the same color are condensed. When two internal nodes of the same color are connected by an edge, we can also introduce a 2-valent node of the opposite color between them.
Square Move. On-shell diagrams are also equivalent under the move shown in Figure  2. We will assume that the square undergoing the move can in fact be any closed loop involving four edges in the graph. In addition to the equivalence moves discussed above, there is an interesting operation that reduces the number of faces in the graph.
Bubble Reduction. A two-sided face is replaced by a single edge, reducing the number of faces in the graph by one. Bubble reduction reduces the number of degrees of freedom in the diagram by one while preserving the region of the Grassmannian parametrized by it.
More generally, reductions can alternatively be achieved by removing edges. The determination of equivalences and reductions becomes more involved when considering non-planar graphs. For example, a novel feature of non-planar diagrams is that some reductions cannot be achieved by bubble reductions. We will revisit these questions in §5 and §8.

Bipartite Graph Technology and the Boundary Measurement
Let us now discuss a few additional concepts that are extremely useful in the analysis of bipartite graphs, both planar and non-planar.
A perfect matching p is a subset of the edges in the graph, such that every internal node is the endpoint of exactly one edge in p and external nodes belong to one or no edge in p. Given a bipartite graph, there is a powerful procedure for obtaining its perfect matchings based on generalized Kasteleyn matrices, certain adjacency matrices of the graph [42].
It is possible to assign orientations to edges in order to produce a perfect orientation. A perfect orientation is such that each white vertex has a single incoming arrow and each black vertex has a single outgoing arrow. Perfect orientations are in one-to-one correspondence with perfect matchings: the single edge with a special orientation at each internal node is precisely the corresponding edge contained in the perfect matching [42,43].
Given a perfect orientation, external nodes are divided into sources and sinks, as shown in the example in Figure 4. We will now explain how bipartite graphs parametrize Gr k,n . In this map, k is the number of sources and n is the total number of external nodes in any perfect orientation. This provides us with an alternative way for deriving (2.2) for general graphs. We now have all the necessary ingredients for constructing the boundary measurement, which maps edge weights on the on-shell diagram to a k × n matrix C in Gr k,n [43]. More rigorously, the boundary measurement is constructed in terms of oriented edge weights; a thorough discussion of this issue appears in [44]. The entries of the matrix C are given by where i runs over the sources, j runs over all external nodes and Γ is an oriented path from i to j. For two sources i 1 and i 2 , this definition results in Here X e indicates edge weights oriented along the perfect orientation. In what follows, we will adopt the convention in which oriented edge weights go from white to black nodes.
As a result, some edge weights will appear in the numerator or denominator of the previous expressions depending on whether their orientation coincides or opposes that of the corresponding path, respectively. Finally, (−1) s Γ is a crucial sign depending on the details of each path. We postpone its discussion to §6, where we will introduce the boundary measurement for arbitrary graphs, generalizing all cases considered so far in the literature. In order to illustrate these ideas, let us consider the simple example shown in Figure 5. In terms of edge and face variables, the boundary measurement for this graph becomes: As explained above, using the GL(1) gauge symmetries associated to the the internal nodes, the edge variables in the previous expression can be expressed in terms of d = 4 independent ones.

Non-Planar On-Shell Diagrams and Non-Adjacent BCFW Shifts
Before embarking into a fully general investigation of non-planar on-shell diagrams in the coming sections, we would like to collect a few thoughts about a concrete scenario in which non-planar on-shell diagrams appear and are important: the computation of tree-level amplitudes in N = 4 SYM via non-adjacent BCFW shifts [45]. It is a well known fact that there is a one-to-one correspondence between the quadruple cut of a two-mass-hard box and a BCFW diagram with adjacent shifts [46], as shown in Figure 6. In fact, this is how the BCFW recursion relations for treelevel amplitudes were originally derived in [47]. As emphasized in the figure, one can further recursively express the tree-level amplitudes entering the two massive corners of the box in terms of two-mass-hard boxes, obtaining a representation of the BCFW diagram with adjacent BCFW shifts in terms of on-shell diagrams.  Figure 6. A one-to-one correspondence between a BCFW diagram with an adjacent shift and a two-mass-hard box. The tree-level amplitudes in the two massive corners can be further expanded into two-mass-hard boxes until reaching an on-shell diagram representation of the BCFW diagram.
Since tree-level amplitudes can also be expressed in terms of BCFW diagrams with non-adjacent shifts, it is natural to wonder whether there is a corresponding on-shell diagram representation. Indeed, such a representation exists and the resulting objects are precisely non-planar on-shell diagrams. Similarly to what happens for BCFW diagrams with adjacent shifts, there is a one-to-one correspondence between a BCFW diagram with non-adjacent shifts and a non-planar two-mass-hard box, as shown in Figure 7. Once again, the tree-level amplitudes in the two massive corners can be further expanded into two-mass-hard boxes, either planar or non-planar. Doing this recursively, we can express any BCFW diagram with non-adjacent shifts in terms of non-planar on-shell diagrams.  Figure 7. A one-to-one correspondence between a BCFW diagram with non-adjacent shifts and a non-planar two-mass-hard box. The tree-level amplitudes at two massive corners can be further expanded into either non-planar or planar two-mass-hard boxes until reaching an on-shell diagram representation of the BCFW diagram.
It is possible to represent a given amplitude in terms of different on-shell diagrams obtained via different BCFW shifts. This procedure thus generates interesting identities between on-shell diagrams. We present an example of such an identity in Figure 8, where we provide two alternative expressions for the tree-level five-point MHV amplitude A MHV 5 . One of the expressions involves two non-planar diagrams and the other one involves a single planar diagram. Furthermore, it is known that there are additional relations between BCFW diagrams with non-adjacent shifts due to the so-called bonus relations [48][49][50]; it would be interesting to explore their application to non-planar on-shell diagrams. Finally, it would be interesting to investigate how general the construction of non-planar on-shell diagrams in terms of non-adjacent BCFW shifts can be.

Generalized Face Variables
In the coming three sections, we will develop new tools for systematically studying non-planar on-shell diagrams. Although many of these ideas have already appeared in the literature in various forms [44,51], their presentation as a comprehensive set of tools for dealing with non-planar on-shell diagrams is new.
In this section we begin by introducing canonical variables capturing the degrees of freedom of arbitrary graphs. These variables have the nice property of being invariant under the GL(1) gauge symmetries associated to all internal nodes, hence being a generalization of the face variables for planar graphs.

Embedding Into a Riemann Surface
A useful auxiliary step for identifying generalized face variables is embedding the onshell diagram into a bordered Riemann surface. While only the connectivity of an onshell diagram matters, we would like to emphasize that considering such an embedding is very convenient. Given a graph, the choice of embedding is not unique. However we will later see that, as expected, physical results are independent of it.
It is interesting to notice that a choice of embedding is already implicit in the usual discussion of planar diagrams. Indeed, face variables are not an intrinsic property of planar graphs, but arise when imagining them to be embedded on a disk. Similarly, the discussion of zig-zag paths, which are tightly related to the concept of permutations, also depends on assuming planar graphs are embedded on a disk. In fact, as we will see in explicit examples, other embeddings are possible, they lead to different variables, but the final answers remain the same.
In the coming sections, we will present several explicit examples of graph embeddings and their applications.

Canonical Variables for Non-Planar Diagrams: Generalized Faces
Generalizing the result for planar graphs, the boundary measurement for generic onshell diagrams can be constructed in terms of oriented paths in an underlying perfect orientation. Physical answers are independent of the particular choice of perfect orientation. It is convenient to describe such paths in terms of a basis, and this can be done by constructing the generalized face variables introduced in this section. Here we will briefly review the ideas introduced in [51]. The first step, as discussed in §4.1, is to embed the graph into a bordered Riemann surface. Once this is done, we can associate to the the diagram F faces, B boundaries and a genus g. These ingredients are sufficient to construct the basis, as follows: • Faces: A variable f i , i = 1, . . . , F , is introduced for every path going clockwise around a face, either internal or external. Face variables satisfy Hence, one of the face variables can always be expressed in terms of the others. For graphs with boundaries, which are the relevant ones for scattering amplitudes, a useful convention is to discard one of the external faces.
• Cuts between boundaries: For B > 1, it is necessary to introduce B − 1 paths, which we call b a , a = 1, . . . , B − 1, stretching between different boundary components. The particular choice of these B − 1 paths, i.e. how we chose the pairs of boundaries to be connected by them, is unimportant. We will often refer to them as cuts. 7 • Fundamental cycles: For genus g we need to consider α m and β m pairs of variables, m = 1, . . . g, associated to the fundamental cycles in the underlying Riemann surface.
The paths b a , α µ and β µ are expressed as products of oriented edge weights in the same way as for f i . 8 Furthermore, they are not unique and can be deformed. These precisely contain all of the degrees of freedom d of a general on-shell diagram, which is simply determined by There is a simple way of understanding the origin of this expression. Notice that for an on-shell diagram with E edges and N internal nodes, we have d = E − N . Now, let us consider an embedding of the diagram with Euler characteristic χ and such that the diagram gives rise to F faces. Since χ = F − E + N , we obtain the compact expression which agrees with (4.1). 7 These cuts have nothing to do with the familiar notion of cutting propagators. We hope the reader is not confused by our choice of terminology. 8 It is important to note that the definition of these variables, which correspond to oriented paths, does not require an underlying perfect orientation. In fact, the orientation of edges in these paths typically does not agree with the one in any perfect orientation.

The dlog Form
An important feature of on-shell diagrams is the d log form of the on-shell form, which arises automatically when using generalized face variables, without the need for solving for the GL(1) redundancies associated to internal nodes when using edge variables. 9 For planar diagrams, it is simply given by For arbitrary diagrams, this expression beautifully generalizes to when using generalized faces variables. The general form in (4.4) is an embeddingindependent statement, since ultimately it is only the connectivity of the graph which is of importance. Appendix A illustrates embedding independence in a very simple example: a box diagram embedded on a disk and on an annulus. By flipping an external leg, we lose the internal face but give rise to an additional boundary, which in turn produces a new cut. The independent set of generalized face variables would then go from The on-shell form, in both sets of variables, becomes If instead of using generalized face variables we are interested in expressing the on-shell form in terms of minors of C, which is only possible for reduced graphs, it takes the generic form where the non-trivial factor F accounts for the non-planarity of the on-shell diagram. Explicit examples with non-trivial F factors will be presented in §7.

A Genus-One, B = 2 Example
In order to understand how generalized face variables work, it is enlightening to study an explicit example. Let us consider the on-shell diagram embedded on a torus with two boundaries shown in Figure 9. This diagram does not admit any g = 0 embedding. Moreover, it is reduced, as can be verified using the tools we will present in §8.   This diagram is particularly interesting, since it exhibits the two new types of variables we introduced: cuts and fundamental cycles. Since the diagram is embedded into a torus, there is a pair of variables α and β corresponding to its fundamental directions. In addition, there is a cut b connecting the two boundaries. Figure 10 shows a possible set of these variables. As we mentioned earlier, the choice of these paths is not unique. In terms of edges, they are given by  In addition, the ordinary faces are The faces satisfy 7 i=1 f i = 1 so, without loss of generality, we can discard f 7 . Interestingly, this example also serves to illustrate some non-trivial feature. Face f 1 overlaps with itself over two edges, X 1,1 and Y 1,1 . This implies that when we circle f 1 completely in the clockwise orientation, we transverse each of these edges twice, each time in opposite directions. As a result, the contributions of both edges to f 1 cancel out.
It is possible to gauge fix the GL(1) redundancies of the 6 internal nodes by setting to 1 one edge for each of them. One consistent way of picking these edges corresponds to setting 10 X 7,6 = X 3,6 = X 4,5 = X 4,2 = X 1,3 = X 1,7 = 1. (4.9) The remaining edges are X 1,1 , X 1,4 , X 2,1 , X 2,5 , X 3,2 , X 5,1 , X 6,1 , X 7,3 , Y 1,1 . We thus conclude that this on-shell diagram has d = 9 degrees of freedom. Following §4, this counting of course agrees with the one based on generalized face variables; we have: 7 faces (6 of which are independent), an α and a β cycle from being on a torus and B − 1 = 1 cut. After this gauge fixing, the independent generalized face variables become If desired, this map can be inverted, obtaining Let us now translate the boundary measurement from the edge variables in (4.10) to generalized face variables. It becomes where, in the middle line, the first factor comes from the Jacobian of the variable transformation and the second factor comes from the product of edge variables. We see that the on-shell form takes the general form in (4.4). In other words, generalized variables can be used to directly write the on-shell form in d log form without having to work through the GL(1) gauge fixing that is necessary for arriving at (4.10). It is also easy to verify that the d log form of the on-shell form is independent of the explicit choice of generalized face variables. For example, we could trade α for another path α also wrapping the torus along the horizontal direction, such as the one shown in Figure 11. Once again, the Jacobian of the change of variables is such that the d log form is preserved. We will investigate additional aspects of this example in §5.4.1 and §6.3.

Combinatorial Characterization of Non-Planar Diagrams: Generalized Matching and Matroid Polytopes
Finding a combinatorial classification of non-planar on-shell diagrams is a question of crucial importance. In this section we introduce two combinatorial objects, the generalized matching and matroid polytopes, which allow us to make substantial progress towards this goal. They are the natural generalizations of the matching and matroid polytopes that appear in the study of planar diagrams [43,52,53]. In fact, these objects have been extensively discussed, together with their application to the classification of non-planar diagrams, in [42,44,51,54,55]. In order to avoid unnecessary repetition, our presentation will be succinct, referring the interested reader to [42,44,51,55] for details.
We begin with a constructive definition of the polytopes in the next section and then summarize their more salient features for our purposes.

Constructing the Polytopes
There are multiple ways of constructing the generalized matching and matroid polytopes associated to a given on-shell diagram [44,51]. Here we review two of them. The first one is based on the connection between edges and perfect matchings in the graph. The second method is based on generalized face variables.

Matching Polytope
• Method 1. As we already mentioned, given an on-shell diagram, all its perfect matchings can be easily found using generalized Kasteleyn matrices. To find the matching polytope, we construct the (E × c)-dimensional perfect matching matrix P : where X i , i = 1, . . . , E, are the edges and p µ , µ = 1, . . . , c, are the perfect matchings of the diagram. This matrix defines the matching polytope as follows: there is a point for every perfect matching, with a position vector in Z E given by the corresponding column vector. Generically, the dimensionality of the matching polytope is lower than E. This can be made manifest by e.g. row reducing the matrix P . 11 Indeed, the dimensionality of the matching polytope is equal to the number of degrees of freedom of the on-shell diagram. This fact becomes more manifest when considering the alternative method for its determination that we present below.
• Method 2. At this point it is useful to introduce the concept of flow. Given an on-shell diagram and a perfect orientation on it, its flows correspond to all oriented non self-intersecting paths in it. Flows can involve more than one disjoint component. Furthermore, these components can connect external nodes or correspond to closed loops. The trivial flow, i.e. the one which does not involve any edge in the graph, is also included. Every flow p µ is in one-to-one correspondence with a perfect matching p µ and is obtained by subtracting from p µ the reference perfect matching p ref that specifies the perfect orientation. Generalized face variables form a basis in which we can express any oriented path in the graph and, in particular, we can use them to express flows. As for perfect matchings, every flow p µ maps to a point in the matching polytope. Its coordinates are simply given by the vector of powers of the generalized face variables required to specify p µ : Since every flow has a unique description in terms of generalized face variables, it becomes clear that every one of them (and hence every perfect matching) gives rise to a unique point in the matching polytope.

Matroid Polytope
The matroid polytope is a projection of the matching polytope that only preserves information on how flows connect to external legs of the graph. Below we explain how to attain this when working in terms of edge variables or generalized face variables.
• Method 1. Let us consider a diagram with F e external legs. Calling this number F e is motivated by the fact that it is equal to the number of external faces. The matrix whose columns encode the position vectors for points in the matroid polytope is simply obtained by starting from the perfect matching matrix P in (5.1) and keeping only the rows corresponding to external legs. It turns out that the points generated by this procedure lie on a hyperplane, so one of the rows can be further eliminated, leading to an F e − 1 dimensional polytope [44].
• Method 2. The projection onto information regarding external legs can similarly be achieved in terms of generalized face variables. To do so, we eliminate all coordinates associated to internal faces, cuts and α m and β m cycles, preserving only those coming from external faces. Furthermore, since the product of all ordinary faces equals to 1, one of the external faces can be discarded. The projection from flows to the matroid polytope hence takes the form: where F e is the total number of external faces and, without loss of generality, we have ordered faces such that the first F e − 1 are external.
Typically, different points in the matching polytope are identified when projected down to the matroid polytope. More concretely, perfect matchings that coincide on external legs are identified under this projection. Equivalently, the same happens for flows differing only by internal paths. It is thus clear that points in the matroid polytope can correspond to multiple perfect matchings/flows. In fact, this has an important physical interpretation. As mentioned earlier, points in the matroid polytope are in oneto-one correspondence with Plücker coordinates. The Plücker coordinates are in turn expressed as linear combinations of flows with coefficients ±1 through the boundary measurement. The flows associated to the same point in the matroid polytope are precisely all the contributions to the corresponding Plücker coordinate [44]. The index of a given Plücker coordinate, i.e. the set of corresponding columns in the matrix C, is equal to the common source set of the flows contributing to it. We will expand on these topics in §6, where we introduce a boundary measurement for arbitrary on-shell diagrams.

Graph Characterization: Region Matching and Reductions
There are an infinite number of on-shell diagrams. It is thus desirable to come up with a classification of them, i.e. to endow this plethora of diagrams with some structure and order. Specifically, diagrams can be organized into equivalence classes and related by simplifying operations denoted reductions, all of which are defined in terms of the operations discussed in §2. The spectrum of possibilities becomes far richer when considering non-planar diagrams. Determining whether two diagrams are equivalent by explicitly constructing a sequence of moves connecting them or establishing the reducibility of a diagram can be challenging tasks, even when dealing with relatively small diagrams. It is hence important to develop global tools for answering such questions directly from the graph. Methods for achieving this exist for planar diagrams, see [25] and references therein. In this section we will take important steps towards developing a systematic and combinatorial approach, based on the generalized matching and matroid polytopes, to the classification of general on-shell diagrams, including non-planar ones. For this purpose, it is convenient to define: • Region matching: This term indicates the case in which the regions of the Grassmannian parametrized by different on-shell diagrams coincide. Two necessary conditions in order for two on-shell diagrams to be equivalent are region matching and having the same number of degrees of freedom.
• Reduction: An on-shell diagram B is a reduction of an on-shell diagram A, if it is obtained from A by deleting edges and it covers the same region of the Grassmanian as A.
Notice that the definition of reduction given above contains, but is more general than, bubble reduction. A few words of caution are in order when implementing these definitions. For planar diagrams, the region of the Grassmannian covered by the graph is fully determined by specifying the non-vanishing Plücker coordinates. This is however more subtle in the non-planar case, since constraints between Plücker coordinates beyond Plücker relations might exist, as we discuss in detail in §8.
The idea of reduction leads to the concept of reduced graph: • Reduced graph: A graph is reduced if it is impossible to remove edges from it while covering the same region of the Grassmannian. 12 The importance of reduced graphs stems from the fact that there are a finite number of them for every scattering process and they contain all information required for addressing certain questions, e.g. determining leading singularities.

Combinatorial Implementation in Terms of Polytopes
The characterization of on-shell diagrams outlined above has a powerful implementation in terms of matching and matroid polytopes. This application for general graphs was introduced in [42] and further explored in [44,51,55]. In this approach, the necessary map between edges and perfect matchings is determined by the matching polytope. Given the correspondence between Plücker coordinates and points in the matroid polytope, the previous definitions admit the following combinatorial translations in the absence of additional constraints on Plücker coordinates: 13 • Equivalence: Two on-shell diagrams parameterize the same region of the Grassmannian if they have the same matroid polytope.
• Reduction: An on-shell diagram B is a reduction of an on-shell diagram A if it is obtained from A by deleting edges and it has the same matroid polytope of A. Similarly, • Reduced graph: A graph is reduced if it is impossible to remove edges from it while preserving the matroid polytope and not generating additional non-Plücker constraints.
This definition can be exploited as a concrete and algorithmic procedure for checking the reducibility of arbitrary on-shell diagrams. We will return to this problem in §8.2.
Interestingly, as discussed at length in [44] and reviewed in §5.1, every point in the matroid polytope has an associated multiplicity of perfect matchings/flows. Heuristically, reducibility is accompanied by large multiplicities, which reflect a redundancy of oriented paths between external nodes in a perfect orientation contributing to the boundary measurement. A graph is reducible if edges can be deleted without bringing any multiplicity below one, assuming no new constraints are generated in the process. If the removal of an edge causes a point in the matroid polytope to disappear, the corresponding Plücker coordinate is set to zero.
Even for planar graphs, matching and matroid polytopes provide the most comprehensive known characterization of on-shell diagrams. For example, unlike the classification of planar graphs based on permutations [25], this approach does not require the graphs to be reduced.
More generally, matroid and matching polytopes are useful tools for investigating the effect of deleting edges, i.e. even in cases in which their removal do not correspond to a reduction. We will consider a detailed example in §8 and refer the reader to [42,44,51,54,55] for many more.
Finally, let us mention that non-planar diagrams exhibit new features, such as the already mentioned appearance of non-Plücker constraints and non-unique reductions [39,51].

Examples
Here we present some explicit examples in order to illustrate the construction of the matroid and matching polytopes and on how to use them for characterizing on-shell diagrams. Since not all readers are familiar with this type of objects, our discussion will be rather meticulous. We refer the reader to [42,44,51] for several additional examples worked out in exquisite detail.

Polytopes for a Genus-One, B = 2 Diagram
Let us consider again the on-shell diagram in Figure 9, which admits an embedding with genus one and two boundaries. This diagram has 34 perfect matchings, which we have determined using the generalized Kasteleyn matrix techniques introduced in [42]. They can be encoded into the P matrix defined in (5.1), which is given by  0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 Every column in this matrix corresponds to a perfect matching. We have organized its rows so that the last six of them correspond to the external legs.
As explained in §5.1, the P matrix defines the matching polytope. Concretely, every perfect matching corresponds to a distinct point in the matching polytope, whose position in Z 15 is given by the corresponding column. Here 15 is the number of edges in the graph. The matching polytope lives, however, in a lower dimensional subspace of Z 15 , which can be easily determined by row-reducing P . Doing so, we obtain: The sum of all rows in the P red matrix is always the vector (1, . . . , 1) [44], so it is possible to drop one of them without losing any information, arriving at a 9-dimensional polytope. This dimensionality nicely agrees with the counting of degrees of freedom presented in §5.1.
Let us now construct the matroid polytope. A simple approach consists of starting from the P matrix in (5.4) and keeping only the rows corresponding to external legs. We thus obtain The column vectors in G give the positions of the points in the matroid polytope in Z 6 . We notice that several columns are repeated, which means that, as explained in §5.1, more than one point in the matching polytope can be projected down to the same point in the matroid polytope. An even more compact way of describing the matroid polytope is to construct a new matrixG in which we eliminate the repetition of columns. In this case, we get The bold face numbers in the last row indicate the numbers of points in the matching polytope that get projected to every point in the matching polytope. For example, the first column corresponds to 6 perfect matchings: p 1 , p 7 , p 12 , p 16 , p 33 , p 34 . We see that the 34 points of the matching polytope project down to 20 points in the matroid polytope. All the perfect matchings associated to a given point in the matroid polytope represent contributions to the same Plücker coordinate. We will see this more explicitly in §6.3.
To conclude, let us mention that following our discussion in §5.1, it is also possible to construct the matching and matroid polytopes presented above using the generalized face variables we presented in §4.3. We leave this as a straightforward exercise for the interested reader.

Polytopes and Region Matching
Let us now illustrate how matching and matroid polytopes are used for determining region matching of on-shell diagrams, hence serving as a practical tool for identifying potential equivalences. To do so, let us consider the on-shell diagram shown in Figure  12, which is shown embedded on a torus with three boundaries.   Figure 12. A reduced on-shell diagram embedded into a torus with three boundaries. This graph cannot be embedded on any surface with g = 0. Faces are labeled in green, external nodes in black and edges in red. The labels in this graph are unrelated to those in Figure 9.
The matching and matroid polytopes for this diagram can be constructed following the same procedure outlined for the previous section. We will thus be briefer in our discussion and present only the most relevant results.
As before, we begin by determining the perfect matching matrix P . This diagram has 19 edges and 42 perfect matchings, which can be determined using generalized Kasteleyn matrices. The matrix P is hence 19 × 42-dimensional. Just like for the previous example, the matching polytope is 9-dimensional, i.e. this diagram also has d = 9 degrees of freedom. The degrees of freedom can be alternatively counted using generalized face variables or calculated as 19 edges−10 internal nodes= 9. The matching polytope now has 42 points, one for each perfect matching.
The matroid polytope is constructed by keeping only those rows associated to the external legs. The 42 points in the matching polytope are projected down to 20 points in the matroid polytope, which is encoded in the following matrix 5 0 0 0 0 0 0 1 1 0 1 1 0 1 1 1 1 0 0 1 1  X 6,5 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1  X 6,4 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0  5 3 3 2 3 3 1 1 2 2 1 2 2 2 1 1 2 2 2 where the last row indicates the number of perfect matchings associated to each point of the matroid polytope. Modulo these multiplicities, this matrix is identical to the one in (5.7)! In hindsight, we organized the external legs in (5.8) such that they are in the same order as the corresponding ones (5.7). Failure to do so would have resulted in a permutation of the rows. In that case, comparison between the rows of the two matrices would have determined how to identify the external legs of both diagrams. In summary, our analysis indicates that the diagrams in Figure 9 and Figure 12 have the same number of degrees of freedom and the same matroid polytope, i.e. they cover the same region of the Grassmannian. In fact, both diagrams are indeed equivalent; we created this example by starting from the diagram in Figure 9 and performing a "square move" on the α loop shown in Figure 10.
Even this simple example illustrates how difficult it can be to find the sequence of moves connecting two equivalent non-planar graphs and the importance of having a global criterion for characterizing diagrams. This is precisely what matching and matroid polytopes achieve in a systematic way.

Boundary Measurement for Arbitrary On-Shell Diagrams
The purpose of this section is to propose a boundary measurement that is valid for arbitrary on-shell diagrams. The boundary measurement maps edge weights in the diagram to the Grassmannian Gr k,n . Its generalization is thus an imperative step for developing the theory of non-planar on-shell diagrams.
Such a map was originally introduced for on-shell diagrams on the disk in [43], extended to the annulus in [56] and finally generalized to genus-zero and an arbitrary number of boundaries in [44]. Below, we will generalize the boundary measurement to allow for diagrams with arbitrary genus embeddings. Strictly speaking, the boundary measurement is independent of the embedding. However, as in previous sections, considering an explicit embedding will turn out to be a useful tool. More importantly, we can regard on-shell diagrams that do not admit a genus-zero embedding as inherently demanding a higher genus treatment.

General Strategy
As reviewed in §2, the first step is to pick a perfect orientation of the diagram. Reproducing (2.6) here for convenience, for n external nodes and k sources in the perfect orientation, the corresponding matrix C in Gr k,n takes the general form where i runs over the sources, j runs over all external nodes and Γ is a flow in the perfect orientation going from i to j. Moreover, recall that flows are in one-to-one correspondence with perfect matchings. The GL(k) gauge symmetry of Gr k,n is fixed in this matrix: there is k × k identity sub-matrix associated to the source nodes. For the proposed boundary measurement to blend into the general approach to on-shell diagrams we introduced in earlier sections, it should satisfy two properties. First, planar graphs must parametrize cells in the positive Grassmannian, i.e. positive edge weights should give rise to positive Plücker coordinates. More generally, we want the boundary measurement to agree with our characterization of on-shell diagrams based on generalized matroid polytopes. In this approach, every point in the matroid polytope corresponds to a Plücker coordinate and is associated to a collection of flows (equivalently perfect matchings). For this to happen, we want the Plücker coordinates arising from the boundary measurement to be sums of the flows associated to the corresponding point in the matroid polytope. Here and in what follows we use sum of flows as an abbreviation for linear combinations of flows with coefficients ±1. Notice that while according to (6.1) the entries in C are linear combinations of flows, the fact that Plücker coordinates, i.e. the determinants of its k × k sub-matrices, are sums of very specific sets of flows is a highly non-trivial property. The latter is the main challenge when generalizing the boundary measurement to arbitrary on-shell diagrams.

Signs
In order to complete the definition of the boundary measurement, it is necessary to provide a prescription for determining the (−1) s Γ sign multiplying every flow in (6.1).
At this point, it is useful to consider an embedding of the graph. As explained in §4.2, for B boundaries we need to consider B − 1 cuts connecting them. This leads to an ordering of external nodes, determined as follows. Starting from an arbitrary external node, we follow the boundaries and cuts of the graph as done in complex analysis, numbering external nodes as they appear until returning to the original point [44]. This generalizes the cyclic ordering of external nodes in diagrams embedded on a disk.
It is convenient to factor the (−1) s Γ signs into two types of contributions, which we explain below.

Positivity Signs
Signs of the first type are common to all flows contributing to a given entry C ij . We refer to them as positivity signs because their effect is to ensure that, for graphs embedded on a disk, positive edge weights result in positive Plücker coordinates. They were first introduced by Postnikov for the planar boundary measurement in [43]. In fact, these are the only signs present for graphs on disks. To determine them, we need to consider the ordering of external nodes introduced above. All flows in a given entry C ij get an overall positivity sign equal to (−1) s(i,j) , where s(i, j) is the number of sources strictly between the external nodes i and j, neglecting periodicity.

Combinatorial Signs
A new contribution to the signs needs to be included when considering on-shell diagrams with non-planar embeddings. 14 The positivity signs typically violate one of the principal requirements of the boundary measurement, i.e. the consistency with the determination of region matching for on-shell diagrams based on generalized matroid polytopes expounded in §5: the cancellations required to ensure that Plücker coordinates become sums of flows will generally no longer happen. We refer to the signs that are necessary to correct this problem as combinatorial signs. In general, combinatorial signs differ among individual terms contributing to a giving entry C ij , i.e. among individual flows. Combinatorial signs were first introduced in [56] for on-shell diagrams on the annulus and extended to general genus-zero embeddings in [44].
In order to determine the combinatorial sign of a flow, we need to turn it into a closed loop as follows. We go from the source to the sink along the flow, and then return to the source following the boundaries and cuts. In general, such a loop has self-intersections. The rotation number r of the loop is defined as the number of full clockwise revolutions of the loop minus the number of full counter-clockwise revolutions. Equivalently, we can express the rotation number in terms of the parity of the number of self-intersections. The combinatorial sign for the flow is then given by (−1) r+1 . 15 The discussion above was originally developed for genus-zero embeddings [43,44,56]. In order to extend the boundary measurement to higher genus, we propose an explicit prescription for constructing the loop: it should be closed within the unit cell. This is done as follows: every time a flow goes around a non-trivial loop and thus uses the periodicity of the Riemann surface, we connect its exit and entry points of the unit cell. This procedure is illustrated in Figure 13 for genus g = 1. This process creates a closed loop which is entirely contained inside the unit cell, whose rotation number r is used to determine the combinatorial sign (−1) r+1 associated to the corresponding flow.
We emphasize that this prescription is a proposal, and it would be desirable to develop a proof for it and to consider its dependence on things such as the choice of unit cell. In order to arrive to it we have considered several explicit examples, like the ones presented below, and verified it works, as opposed to other ways of determining the rotation numbers. In particular, the parity of the number of self intersections of loops, and hence the combinatorial signs, can change if we do not insist in closing loops within a unit cell, destroying the cancellations which are necessary for Plücker coordinates to become sums of all flows associated to a point in the matroid polytope. A detailed example illustrating the dependence on different ways of closing loops, which indeed was used as a guide for constructing our final proposal, is provided in Appendix B. This prescription can have additional interesting consequences such as producing additional signs for flows even in the absence of cuts, as we shall see in §6.4. Our boundary measurement applies to arbitrary genus, reducing to the already known prescription on genus-zero graphs. For illustrative purposes and to provide evidence supporting our proposal, in the coming sections we present g = 1 and g = 2 examples.

A Genus-One Example
Let us revisit the on-shell diagram presented in Figure 9. As already mentioned, this diagram does not admit a g = 0 embedding. Figure 14 shows this diagram with the perfect orientation associated to the reference perfect matching p 4 = X 1,3 X 4,2 X 4,5 X 7,3 X 7,6 . This diagram has 34 perfect matchings, which are encoded by the perfect matching matrix given in (5.4 Figure 14. A reduced on-shell diagram embedded into a torus with two boundaries. This graph cannot be embedded on any surface with g = 0. Faces are labeled in green, external nodes in black and edges in red. The dashed line represents the cut. It is interesting to remark the beautiful agreement between the multiplicities of flows with the same source sets and the multiplicities of the corresponding perfect matchings for every point in the matroid polytope given in (5.7).
We are now ready to construct the corresponding element of the Grassmannian. The first step is to introduce the positivity signs (−1) s(i,j) . To do so, external nodes must be ordered using cuts to connect different boundaries. According to our definition of generalized face variables, cuts are oriented paths on the graph connecting pairs of boundaries. For the example at hand, an explicit choice of the cut was given in Figure  10. For ordering the external nodes, however, it is sufficient and much more convenient to consider deformations of the cuts that do not necessarily go over the edges of the graph. For this example, such a cut is represented by the dashed line in Figure 14.

On-Shell Form in Terms of Generalized Face Variables
Different variables can be used to describe the flows that contribute to the boundary measurement. In particular, it is instructive to consider how the boundary measurement for this on-shell diagram can be expressed in terms of generalized face variables, which for this example were given in (4.7) and (4.8). Without any gauge fixing, we obtain It is important to emphasize that going through edge variables is a useful intermediate step but not a necessary one.

A Genus-Two Example
Let us know apply our boundary measurement prescription to an on-shell diagram embedded into a genus-2 surface with a single boundary. This example admits an alternative embedding into a genus-0 surface with multiple boundaries, which allows for a non-trivial check of our proposal. Genus-2 surfaces have four fundamental cycles: The diagram is shown in Figure 16, where we present the fundamental cell of the surface and segments on its perimeter are periodically identified according to their color and orientation. We pick a perfect orientation corresponding to the perfect matching p ref = X 1,2 X 1,3 X 4,2 X 4,3 X 5,1 X 5,2 Y 5,2 .   Let us now determine the boundary measurement. To do so, we first list all flows and their source sets. (6.9) As in the previous example, its minors cannot be written as a sum of flows. It is sufficient to determine the combinatorial signs for only those flows appearing in the matrix, which are shown in Figure 17 along with their respective signs. This then yields the Grassmannian matrix (6.10) Interestingly, here we observe a new phenomenon, exclusive of higher genus. For genus-0, in the absence of closed loops in the perfect orientation, all flows whose source and sink lie on the same boundary do not pick up any combinatorial signs. This is because they do not use cuts to be completed into loops, which in this case are the only possible   Figure 17. Flows contributing to (6.9) completed to loops within the unit cell, the corresponding rotation numbers and the resulting signs.
sources of self-intersections. On the contrary, despite the fact that this example has only one boundary, several flows pick up a combinatorial minus sign. This effect is precisely tuned such that the minors of C are subject to important cancellations that result in the simple expressions ∆ 1,2,3 = p 1 − p 4 + p 8 + p 15 − p 16 ∆ 1,4,5 = p 7 + p 26 ∆ 1,2,4 = p 6 + p 21 − p 23 ∆ 2,3,4 = p 12 − p 13 − p 22 + p 24 ∆ 1,2,5 = p 18 − p 25 ∆ 2,3,5 = p 11 − p 19 + p 27 ∆ 1,3,4 = p 9 − p 3 ∆ 2,4,5 = 1 ∆ 1,3,5 = p 2 − p 5 + p 10 + p 17 ∆ 3,4,5 = p 28 − p 14 (6.11) We would like to stress how non-trivial this example is. Not only were we required to introduce signs for paths that start and end on the same boundary, but the signs in (6.10) seem not to have any particular pattern, yet they magically produce the cancellations required to obtain (6.11). Based on the examples presented, it is reasonable to conjecture that we have identified the full set of rules for constructing the boundary measurement for on-shell diagrams embedded on surfaces with arbitrary number of boundaries and genus. It would be interesting to confirm that this is the case and to find a formal derivation of our proposal.

The Non-Planar On-Shell Form
We shall now study the differential form associated to each non-planar on-shell diagram. As we have already seen in §4 there are multiple ways of expressing it: • Using edge variables as in (2.5), which straightforwardly extends to non-planar graphs. This has the advantage of manifestly displaying the d log form of the on-shell form. A slight disadvantage is that it depends on the choice of GL(1) gauge at every internal node, which needs to be taken into account to identify d independent edges.
• Using generalized face variables as in (4.4). This approach has the advantage of both displaying the d log form as well as being independent of the choice of GL(1)'s. The determination of generalized face variables naturally involves an embedding of the diagram.
• Using the minors of the Grassmannian, i.e. Plücker coordinates, such as in (4.6). While this representation hides the d log form and has a GL(k) redundancy, it has the advantage having a more direct connection to the geometry of Gr k,n , naturally expressed in terms of Plücker coordinates.
In this section we will be primarily concerned with the third point. In particular, the onshell forms obtained in this section correspond to having non-trivial factors F in (4.6).
While the discussion in the previous sections applies to general on-shell diagrams, here we focus on reduced ones. This is physically motivated by being interested in leading singularities, which imply the diagrams are reduced. Formally, it is also required by a dimensionality argument: in order to express the on-shell form in terms of minors, its rank needs to match the number of independent Plücker coordinates, implying the diagram must be reduced.

From Generalized Face Variables to Minors
A possible way of obtaining the on-shell form in term of minors of C is to use generalized face variables and the boundary measurement. More explicitly, starting with the form in (4.4), we can use the boundary measurement introduced in §6 to obtain the map between Plücker coordinates and generalized face variables. Solving for the generalized face variables will then yield the desired expression: where ∆ is the relevant set of Plücker coordinates, and J is the Jacobian for the transformation between entries in the Grassmannian and generalized face variables. 16 We shall now illustrate how this works in practice in a top-dimensional example in Gr 3,6 with two boundaries, shown in Figure 18. This example has 9 independent generalized face variables: 8 independent f i variables and one b j . In terms of oriented edge weights, the generalized face variables are given by f 1 = X 9,1 X 1,2 X 1,4 f 2 = X 5,2 X 1,2 X 2,3 X 2,9 f 3 = X 7,3 X 2,3 X 3,4 X 3,5 f 4 = X 1,4 X 3,4 X 4,7 f 5 = X 6,5 X 3,5 X 5,7 X 5,2 f 6 = X 7,6 X 9,6 X 6,8 X 6,5 f 7 = Y 8,7 X 5,7 X 4,7 X 8,7 X 7,6 X 7,3 X 7,9 f 8 = X 6,8 X 8,7 Y 8,7 f 9 = X 2,9 X 7,9 X 9,6 X 9,1 b 1 = X 1,4 X 8,7 X 7,9 (7.2) Eliminating f 4 using 9 i=1 f i = 1 we obtain the on-shell form Of course it is possible to do a similar thing starting from the on-shell form in terms of edge weights and using the boundary measurement to connect it to Plücker coordinates. The advantage of using generalized face variables is that they automatically produce the starting point (4.4). Using the boundary measurement in §6, we obtain the following matrix The variable transformation from generalized face variables to elements of the above matrix, i.e. to 9 i=1 dc i ≡ d 9 C, carries a Jacobian, which can also be expressed in terms of the generalized face variables. Using (7.4) we can express the Plücker coordinates in terms of generalized face variables. Solving for the generalized face variables, we obtain the following differential form: An important remark is that the resulting expression in terms of minors is independent of the chosen embedding. The simple example in Appendix A illustrates this point.

A Combinatorial Method
In this section we present an alternative systematic procedure for computing the nonplanar on-shell form in terms of Plücker coordinates for any MHV degree k, which allows us to construct it without the need to compute the boundary measurement. This is a generalization of the method developed in [39] for general non-planar MHV leading singularities. We will begin by quickly reviewing the procedure in [39], and then propose its generalization to any k. As a consistency check, all results in this section have also been obtained using the method in §7.1, providing substantial support for our proposal.

MHV Leading Singularities
A general method for obtaining non-planar MHV leading singularities was recently introduced in [39]. We now review this method with a simple example, shown in Figure 19. A general feature of MHV leading singularities is that every internal black vertex can be associated to a set of three external legs. These legs are those that are connected to the black node either directly or through a sequence of edges and internal white nodes. The previous sentence applies to non-necessarily bipartite on-shell diagrams. As explained earlier, every on-shell diagram can be turn into a bipartite one. We will continue focusing on bipartite diagrams, for which it is clear that there can only be at most one internal white node connecting an internal black node to an external leg. 17 The fact that for MHV leading singularities this rule precisely gives rise to three end points for every internal black node is indeed a rather non-trivial graph-combinatorial result.
The procedure for obtaining the differential form is as follows: 1. For each internal black node, we find the three external legs associated to it. Then we construct a n B × 3 matrix T , where each row contains the labels of the three external nodes associated to each black node. For the example in Figure  19, T is given by 4. Finally, the on-shell form corresponding to a diagram for which is given by detailed investigation of this thought for future work.
The original rules [39] are formulated in terms of spinor brackets i j ; for MHV leading singularities these are equivalent to (i j) on the support of the kinematic constraints. Writing them in terms of minors hints at an appropriate generalization to N k−2 MHV diagrams, for which the minors are k × k, which we now investigate.

Generalization to N k−2 MHV On-Shell Diagrams
Here we propose a generalization of the procedure shown above to k > 2. Subsequent sections will illustrate its inner workings with some non-trivial examples. In §7.5.1 and §7.5.2 we will prove the method for certain subclasses of diagrams. MHV leading singularities only require us to take into account on-shell diagrams with trivalent black vertices, but for k > 2 we will need to consider more general bipartite graphs. The complications arising when k > 2 are twofold: • In order to have k × k minors we need a T matrix with k + 1 columns. For k > 2 it is possible that some internal black nodes do not connect to k + 1 external legs in the way described for k = 2.
• The number of black nodes may exceed (n − k), forcing M to have more rows than columns, thus preventing us from taking its determinant.
The first point is related to the valency v of internal black nodes. There are two possible reasons why internal black nodes might fail to connect to k + 1 external ones. The first one is that the valency of the node is v > k + 1. Generally, performing a square move changes the valency of nodes in a diagram. In what follows we will assume that it is always possible to perform a series of equivalence moves to turn a diagram into one where every black node has v ≤ k + 1. An example of this procedure is given in Figure 20.
If, on the other hand, the valency of an internal black node is v < k + 1, we assign the first entries of the corresponding row in T to the external nodes to which the black node connects to, ordered clockwise, 18 and leave the remaining entries free: We then fill these additional entries with external labels, chosen arbitrarily from the set of nodes that do not already appear in the row, i.e. * j / ∈ {i 1 , . . . , i v }. Finally, we need to order the new entries * j among the {i 1 , . . . , i v }, such that det( M a 1 ,...,a k )/(a 1 · · · a k ) is independent of {a 1 · · · a k }, up to an overall sign (−1) k j=1 a j . In all cases we have considered, it is always possible to do this, but it would be interesting to understand better how to determine the correct ordering in the T matrix in general.
The second complication listed above, regarding the total number of black nodes, typically arises when the diagram has internal white nodes which are completely surrounded by black nodes. Notice that for bipartite graphs, this is always the case, unless when the internal white nodes are directly connected to some external leg. In the examples we have studied, it appears that n B = n − k + α, where α is the number of such white nodes in the diagram. This issue is resolved by adding an auxiliary external leg to every internal white node contributing to α. 19 Once the form has been obtained, 18 Defining a clockwise ordering requires considering an embedding. In practice, this is how we have dealt with the examples in §7.4. Since the result should be independent of any embedding, it would be interesting to understand what notion generalizes the ordering in its absence. 19 It is interesting to notice that, when thinking in terms of an embedding, this operation can generate new boundary components. In addition, if applied to a reducible graph it can turn it into a reduced one. This is related to our comment in footnote 17. through the generalization of the steps in §7.2.1 which we will outline shortly, we integrate over the extra variables c ij , j = n + 1, . . . , n + α around c ij = 0. We will see this done in detail in several examples.
In summary, the procedure to obtain the differential form for general N k−2 MHV on-shell diagrams is as follows: 1. If any internal black node is connected to more than k + 1 external nodes either directly or through a succession of edges and internal white nodes, perform a series of equivalence moves until all internal black nodes only connect to k + 1 or fewer external nodes. Also, if n B > n − k, add auxiliary external legs to the internal white nodes which are totally surrounded by internal black nodes, until n B = n − k.
2. Construct the n B × (k + 1) matrix T where each row corresponds to an internal black node. Every time there is an internal black node that connects to fewer than k + 1 external nodes, choose the remaining entries freely as described above; the correct ordering will be determined by point 4, below.
3. Construct the n B × n matrix M in the same way as for the MHV case. For each row {i 1 , . . . , i j , . . . , i k+1 } in T we populate the same row in M : at each position i j , insert the minor (i j+1 · · · i k+1 i 1 · · · i j−1 ) formed by removing i j ; all other entries are zero.
4. Remove k columns from M , chosen arbitrarily, to form M a 1 ,...,a k . Then compute the ratio det( M a 1 ,...,a k )/(a 1 · · · a k ). We emphasize that this quantity must be independent of the choice of {a 1 · · · a k }; if this is not the case, the ordering of the rows in T was chosen incorrectly, i.e. the position of the free entries * j must be modified.

The on-shell form corresponding to a diagram for which
is given by where we denote by PT (i) the Parke-Taylor-like product corresponding to each row i of T , for instance in (7.12), k−1 ). If there was no need for introducing auxiliary external legs, this is the final answer. 6. In the presence of auxiliary legs, we now need to integrate over the extra variables C ij , j = n + 1, . . . , n + α around C ij = 0. Below we present various examples in which this is done.

The Meaning of *
In (7.11) we proposed that when an internal black node in an N k−2 MHV on-shell diagram has valency v < k+1, this leads to arbitrary entries on the matrix T , denoted by * .
In this section we want to address the physical meaning of this freedom of choice. First, a row in T of the form {i 1 , . . . , i v , * v+1 , · · · * k+1 } implies that the columns c i 1 , . . . , c iv of the matrix C ∈ Gr k,n are linearly dependent vectors. This is a general statement that can be understood by splitting the original diagram into two sub-diagrams: C R containing the black node in question and all possible internal white nodes and external legs attached to it, and C L , the rest of the diagram. The original diagram is obtained by "amalgamating" C L and C R cf. §3 of [25]. The main purpose of doing so is that the minors of C can be written in terms of products of minors of C L and C R . Importantly, the diagram C R has k R < k, therefore every k × k minor of C with labels that belong entirely to C R will necessarily vanish, as it is impossible to write them all in a k R × k R minor of C R .
To illustrate this argument let us consider the leading singularity on Gr 3,6 presented in Figure 22, and split it as explained above. This is shown in Figure 21.
Notice that k L = 4 and k R = 2, thus the minors of the matrix C of the original diagram can be related to the minors of C L and C R as The situation when we have a top-form and α > 0 is a bit different, upon adding α auxiliary external edges, the corresponding T matrix may have * entries. They will, however, only impose the vanishing of minors containing the auxiliary legs.

Examples
We now illustrate the rules introduced in the previous section on various explicit examples.

NMHV with Low Valency
Our first example illustrates how to deal with cases when we need to introduce * into the matrix T . The diagram is shown in Figure 22. We will also show that this diagram is decomposable into a sum of Parke-Taylor factors through the use of Kleiss-Kuijf relations [57], thus independently confirming the answer. Although we do not have a general proof for the independence of the choice of * and the deleted rows of M , this example provides strong evidence to believe this is indeed the case. For the example at hand, we have checked explicitly that this result agrees with the differential form in terms of edge or generalized face variables for any choice of GL(3) gauge fixing, deleted rows as well as for * = 1 or 6. For this particular example, (7.18) can be explicitly confirmed to be correct: this leading singularity can be written in terms of planar integrals, with the help of the Kleiss-Kuijf relations [57] on the four-point nodes present in the diagram in Figure 22. Explicitly, using Plücker relations at the pole (345) = 0 one may rewrite the ratio in (7.18) as where I(i 1 , i 2 , i 3 , i 4 , i 5 , i 6 ) stands for the planar integrals with ordering indicated by their arguments: . (7.20) For MHV diagrams, [39] showed that every non-planar leading singularity can be reexpressed as a sum of Parke-Taylor factors with coefficients +1. This is not a general feature of N k−2 MHV leading singularities, as will become clear with the example in §7.4.3. In Appendix C we present a similar, higher genus, example.

NMHV with Too Many Black Nodes
Let us now consider diagrams with n B > n − k. An example of this type is provided in Figure 23, which is obtained by adding a BCFW bridge to legs 5 and 6 in Figure 22.  This example has α = 1. Following §7.2.2, we must introduce an auxiliary leg as shown in Figure 23. This new diagram yields the T matrix which results in the on-shell form where I| 7 stands for the piece containing the dependence on the auxiliary external node 7 and must be evaluated at the poles (347) = (567) = 0. On these poles, it can be recast as The final step is to remove the effect of the auxiliary edge. This is done by taking a generic element of the "extended" Grassmannian Gr k,n+1 and integrating the extra variables C i7 around C i7 = 0. To do so, we write a generic 3 × 7 matrix C and compute the residues of I| 7 around C i7 = 0, i = 1, 2, 3. We obtain As expected, this result agrees with the leading singularity (7.18) on the support of (345) = 0. With the previous two examples, we have illustrated the full set of our tools. As an additional demonstration of the power of this procedure, in Appendix D we compute a highly non-trivial N 2 MHV example.

NMHV with a New Type of Poles
We shall now apply our tools to computing a top-dimensional example in Gr 3,6 which exhibits a novel feature: a differential form with a singularity which is not of the form (ijk) = 0. This fact ultimately prohibits the diagram from being able to be written as a sum of planar terms. The on-shell diagram is shown in Figure 24. This example will also be revisited in §8, where the consequences of such a peculiar differential form will be studied in detail. Thus we find that the on-shell form of the six-point diagram in Figure 24 is given by  136)) . (7.32) The appearance of the factor (124)(346)(365) − (456)(234)(136) in the denominator through this process is rather non-trivial and shows that this diagram, unlike the NMHV leading singularity (7.18), cannot be written as a linear combination of planar diagrams. This example thus provides concrete evidence for a behavior already announced in [39], that already for k = 3 and n = 6 not all leading singularities can be expressed as linear combinations of planar ones. This diagram certainly deserves further study, and we will come back to it in §8.1. There we will use a matroid polytope perspective to fully understand reducibility in the context of non-planar diagrams. For this diagram we will indeed find an edge which, when removed, does not set any Plücker coordinates to zero but instead relates Plücker coordinates to each other, i.e. it will impose the relation (124)(346)(365) − (456)(234)(136) = 0. The leading singularity that arises through the removal of this edge is fully computed in Appendix E.

Towards a Proof of the Proposal
In this section we work towards a proof of the method proposed in §7.2.2 for constructing the on-shell form of N k−2 MHV in terms of Plücker coordinates. We will be able to provide proofs of it for two classes of on-shell diagrams: diagrams with n B = n − k and hence no * entries and diagrams obtained by an inverse soft limit.

Diagrams with n B = n − k
Let us consider on-shell diagrams that are top forms in Gr k,n with α = 0, i.e. n B = n−k. This means that the matrix T has no arbitrary entries * , so every black node has valency k+1 and is associated to a local Grassmannian Gr k,k+1 . The proof in this section follows the same logic used for MHV leading singularities in [39].
For an internal black node associated with the subset {i 1 , . . . , i k } of external particles, the corresponding constraint δ 2 (C ⊥ · λ) provides us with a linear relation satisfied by the set {λ i 1 , . . . , λ i k } connected to the node. Gr k,k+1 has k degrees of freedom, which we can parametrize by the entries of the 1 × (k + 1) matrix C ⊥ modulo GL(1), Then, we associate the following form to every internal black node Recalling that C and C ⊥ are complementary matrices, we may equivalently write is a 1 × 1 minor of C ⊥ and (i 1 · · ·î j · · · i k+1 ) C is a k × k minor of C obtained by deleting the column i j . Using this, (7.34) may be recast as It is clear that the product of k × k minors above gives rise to the Parke-Taylor-like factors introduced in (7.13). The next step is to consider the complete diagram instead of each internal black node separately. We write the matrix C ∈ Gr k,n as where c i are k-vectors. At this point, we recall that the matrix M introduced on item 2 of §7.2.2 provides a representative of the (n − k) × n matrix C ⊥ since c i 1 (i 2 · · · i k+1 ) + cyclic(i 1 , . . . , i k+1 ) = 0 ⇒ M · C T = 0. (7.38) All we need to worry about is that we can only compare gauge fixed quantities. To address this issue, we can gauge fix the GL(k) redundancy in C by writing each column as a linear combination of k columns { c i 1 , . . . , c i k }. This fixes columns i 1 , . . . , i k to the identity matrix. Denoting the matrix gauge fixed this way by C gf i 1 ···i k , the corresponding constraint δ 2×k (C · λ) acquires a Jacobian factor of 1 (i 1 · · · i k ) k . This gauge fixing in C induces a gauge fixing in C ⊥ for which all columns except i 1 , . . . , i k are gauge fixed to the identity matrix, which we denote by C ⊥gf i 1 ···i k . Relating C ⊥gf i 1 ···i k to M amounts to multiplying M by M −1 i 1 ,...,i k , the inverse of M i 1 ,...,i k defined in item 3 of §7.2.2. Thus, we have (7.39) Combining (7.39) with the Parke-Taylor denominators of (7.36) we obtain precisely (7.13), upon omitting the δ-functions.

Recursive Proof for Diagrams with Inverse Soft Factors
We now give a proof of the procedure for another class of on-shell diagrams: diagrams with inverse soft factors. More precisely, we prove that if the integration measure of a given diagram can be computed by the rules proposed in §7.2.2, then that of the diagram with an additional leg obtained from the original one via an inverse soft limit can also be calculated using our rules. We shall illustrate the proof with an NMHV diagram constructed via an inverse soft factor, as shown in Figure 25. The internal black vertex from the inverse soft factor generates an additional row in the T matrix with a quadruple {b, n, a, * }. We shall replace the undetermined entry by a label i and will assume without loss of generality that a < b < i < n. The inverse soft factor will modify the n B × (n − 1) = (n − 1 − 3) × (n − 1) matrix M (n−1) to a matrix M (n) with an additional row and an additional column: . . . 0 0 · · · 0 (ibn) 0 · · · 0 (nai) 0 · · · 0 (bna) 0 · · · 0 (aib) Let us now consider the reduced matrices M i 1 ,i 2 ,i 3 , obtained by removing any three columns {i 1 , i 2 , i 3 }. We shall now consider the case where n / ∈ {i 1 , i 2 , i 3 }, the case where n ∈ {i 1 , i 2 , i 3 } will be treated below. Since det M (n−1) which is easily verified by selecting {i 1 , i 2 , i 3 } as the columns containing (ibn), (nai) and (bna). From this we see that the left-hand side of (7.41) must also be independent of {i 1 , i 2 , i 3 }.
After computing the determinants, we find that the ratio between the n-point integration measure and that of the (n − 1)-point diagram is simply , (7.42) which is precisely the inverse soft factor for NMHV diagrams, thus proving that the on-shell form we obtain for n external legs is correct. We also note that on the pole (bna) = 0, we may rewrite the ratio as , (7.43) and the result is independent of the choice of i and j.
To complete the proof we must consider the case where we remove the columns {i 1 , i 2 , n} in (7.40). Without loss of generality we may choose i 1 = 1 and i 2 = 2, yielding det M For more general N k−2 MHV diagrams the proof follows along the same lines, and the procedure yields the corresponding N k−2 MHV inverse soft factor as expected. As an example, for N 2 MHV the added leg will generate an additional row in the T matrix with {b, n, a, * , * }. The free entries can be chosen to be i and j. We then need to remove four columns from the M (n) matrix, and regardless of which columns are removed we find det M This yields the ratio between the n-point on-shell form and the (n − 1)-point on-shell form which is the correct N 2 MHV inverse soft factor. Using the fact that a, b, n are on a line, i.e. that ( * bna) = 0, the soft factor may be rewritten as , (7.48) and the result is independent of i, j, k and l.

Novel Features of Non-Planar Reductions
In §5.2 we discussed reductions and reducibility of on-shell diagrams and introduced a combinatorial framework that can be used to study edge removal. In this section we will work out an example in detail. We will construct its matching and matroid polytopes, establish the precise connection between points in the matroid polytope and Plücker coordinates using the boundary measurement and investigate its reducibility. The example has been chosen to illustrate a new phenomenon that can occur when removing an edge from a non-planar diagram: the set of non-vanishing Plücker coordinates can remain the same while new non-Plücker constraints are generated. This has a direct impact on the issue of reducibility. If a new constraint arises, the new diagram does not cover the same region of the Grassmannian as the original one and hence it is not a reduction. This story has an interesting counterpart in terms of the on-shell form. The killing of degrees of freedom associated to removing an edge corresponds to taking the residue of the form at the pole where that degree of freedom goes to zero. On-shell forms for planar diagrams have a particularly simple structure; they are just one over a product of Plücker coordinates. Every pole of the on-shell form thus corresponds to setting some Plücker coordinate to zero. New things can, however, happen for non-planar diagrams: the on-shell form can have poles at which no Plücker coordinate vanishes.
Non-Plücker constraints should also be taken into account when determining whether two diagrams cover the same region of the Grassmannian. We leave a more detailed investigation of on-shell diagrams with constraints for future work. They certainly arise, as we explicitly show, as limits of more standard diagrams. At present we do not have any argument indicating they are not physical.

An Example
Let us consider the example on the left of §7.4.3. For convenience, the on-shell diagram is reproduced in Figure 26. The perfect orientation is the one corresponding to the perfect matching p ref = X 1,3 X 1,7 X 4,5 X 6,7 X 8,3 X 8,7 Y 4,5 . The new possibilities might be anticipated by looking at the denominator of the on-shell form (7.32), which contains a factor ((124)(346)(365) − (456)(234)(136)). This means that there is a pole when this factor vanishes, which can be reached without shutting off any Plücker coordinate. Furthermore, we expect this can be achieved by deleting edges in the graph. Notice that ((124)(346)(365) − (456)(234)(136)) = 0 does not kill any minor but instead imposes a new constraint on them. 20 We shall now see how this happens. 20 It is interesting to point out that this is very reminiscent of the detailed discussion of boundaries of the amplituhedron presented in [28], in which certain boundaries correspond to setting combinations of minors to zero. In that case, too, all boundaries can be mapped to poles of the on-shell form.  The perfect matching matrix P for this graph is where we have organized the rows such that the final six correspond to external edges. We have also highlighted the row corresponding to X 5,2 for future convenience. Recalling the definition of the perfect matching matrix (5.1), every column corresponds to a perfect matching and an entry P iµ is 1 if the perfect matching p µ contains the i th edge, and it is zero otherwise. The columns in P are the coordinate vectors in the matching polytope for the corresponding perfect matchings. Note that every perfect matching maps to a distinct point in the matching polytope. Despite the column vectors in (8.1) are 19-dimensional, it is straightforward to check, e.g. by shifting the coordinates such that one of them lies at the origin and then row-reducing P , that the matching polytope is a 9-dimensional object. This fact nicely matches the counting in terms of generalized face variables: there are 8 faces f i (7 of which are independent) and B − 1 = 2 variables b j , which totals 9 degrees of freedom. This will become important later. The matroid polytope is obtained by taking (8.1) and keeping only the 6 coordinates associated to the external edges. Generically, when doing this more than one perfect matching can be projected down to the same point in the matroid polytope. This is the multiplicity we alluded to earlier. The points in the matroid polytope are summarized in (8.2), where for every point we list the corresponding perfect matchings and Plücker coordinate. Using (8.1) it is straightforward to check that there is a single edge, X 5,2 , which can be removed without killing any point in the matroid polytope. Eliminating this edge removes all perfect matchings that contain it, i.e. p 7 , p 10 , p 20 , p 22 , p 28 , p 31 , p 36 , which are shown in red in (8.2). Following our previous discussion, none of the Plücker coordinates is set to zero. We now investigate what happens to them in more detail, by considering the effect on the boundary measurement.
Boundary Measurement for the Original Diagram. Before removing X 5,2 , the matrix C associated to Figure 26 is All minors of this matrix are generically non-zero: Here p µ indicates the flow associated to a perfect matching p µ . A flow takes the form of a monomial in oriented edge weights. We refer the reader to [44] for a thorough discussion of these concepts. The flows for perfect matchings containing X 5,2 are shown in red.
In total we have 9 independent minors, which tells us that C is in the top cell of Gr 3,6 .
Thus, we see that if generalized face variables are to parametrize all degrees of freedom of C, we cannot lose any f i or b j , as we already have the minimal number possible to account for a 9-dimensional C. Naively, this is in tension with the fact that edge X 5,2 can be removed without eliminating points in the matroid polytope, i.e. without setting Plücker coordinates to zero. As we now explain, while this is true, the removal of X 5,2 does not kill any ∆ I , but it removes a degree of freedom in such a way as to create a new constraint on the ∆ I , independent from the Plücker relations. We then conclude, the graph is not reducible.
Boundary Measurement After Removing X 5,2 . Let us understand in detail how the new constraint arises. We will do so from the perspective of the boundary measurement and the matching polytopes. If we remove X 5,2 , i.e. set X 5,2 = 0, the only entry in C that is affected is c 7 . 21 The Plücker coordinates now become 21 Let us say a few words on how to eliminate edges that appear in the denominator of entries in the boundary measurement. Once a perfect orientation is chosen, a given oriented edge weight appears either only in numerators (as it is the case for X 52 in this example) or denominators. This is determined by whether the perfect orientation coincides or is opposed to the conventional orientation we picked for the edge under consideration. If we want to remove an edge appearing in denominators, all we need to do is to send the corresponding edge weight to infinity. The fact that some edges are removed by sending them to zero while other ones are removed by sending them to infinity is thus a matter of conventions and another reflection of the symmetry of on-shell diagrams under the inversion of the edge weights.
Now we understand how the new constraint arises. While (8.12) is always true, we need to set X 5,2 = 0 in order to translate it into a constraint on Plücker coordinates ∆ I . Phrased differently, before removing X 5,2 , (8.11) would imply that (p 35 − p 7 ) p 23 p 37 = p 24 p 32 p 38 , which is not true. Once X 5,2 has been removed, however, p 7 disappears and (8.11) becomes equivalent to the known relation among perfect matchings (8.12).

A Systematic Approach to Reducibility
One lesson we should draw from the previous section is that for non-planar graphs the preservation of the matroid polytope under edge removal is a necessary but not sufficient condition for reducibility. It is nonetheless possible to establish a systematic procedure for determining whether a non-planar graph is reducible or not, which goes as follows. Simply remove as many edges as possible while preserving the matroid polytope, and count the degrees of freedom of the generalized face variables f i and b j in the resulting graph. 22 This number should be compared to the expected number of degrees of freedom based on the surviving points of the matroid polytope, i.e. a naive counting of dimensions of C that assumes the absence of constraints other than the Plücker relations. Two scenarios may occur: • The surviving points of the matroid polytope suggest a dimension that is equal to the number of independent generalized face variables. This means that the graph is now maximally reduced, and there are no new constraints on the ∆ I .
• The surviving points of the matroid polytope suggest a dimension that is larger than the number of independent generalized face variables. This means that the collection of removed edges, which did not affect the matroid polytope, have reduced the graph "more than the maximal amount". The difference δ between the naive and actual dimensions gives the number of new constraints on nonvanishing Plücker coordinates which have been generated. Whenever δ > 0, it means that too many edges have been removed and the graph was already reduced after deleting a subset of them.
For illustration, let us reconsider the graph in Figure 26. As we saw, it is possible to remove the edge X 5,2 while preserving the matroid polytope. The number of points in the matroid polytope after this operation is 20, which for Gr 3,6 suggests a naive dimension equal to 9 (i.e. as many dimensions as the top cell). However, we only have 6+2 = 8 independent generalized face variables, so δ = 9−8 = 1. We conclude that the original graph was already reduced and by deleting X 5,2 we generate a new constraint on Plücker coordinates.
These operations are very simple to implement algorithmically on a computer and thus provide a quick check for whether a graph is reduced or not.

Discovering Non-Plücker Constraints
As mentioned above, δ > 0 indicates the existence of constraints on the ∆ I that are independent from the Plücker relations. It is natural to want to find these constraints. To this end, we suggest the following strategy: • Solve the linear relations among column vectors in P to obtain all constraints on linear combinations of these vectors.
• Rewrite the perfect matchings in terms of Plücker coordinates, by inverting the map in (8.4).
• Plug the expressions of perfect matchings into the constraints obtained from the first point, to obtain the corresponding constraints in terms of Plücker coordinates.
• Insert the solution of the Plücker relations into these constraints. The number of new constraints that do not trivialize should be δ.

Conclusions
We have established several concepts and machinery to undertake the study of nonplanar on-shell diagrams. Some of our main results are: the introduction of generalized face variables, the construction of generalized matching and matroid polytopes, their application to the questions of region matching and reductions, the proposal of a boundary measurement for general on-shell diagrams, a study of reducibility of non-planar diagrams and a generalization of the prescription of [39] for obtaining the on-shell form in terms of minors that applies beyond the MHV case.
The natural goal of this general program is to achieve a level of understanding of non-planar diagrams similar to the existing one for planar diagrams. As we have repeatedly witnessed in this paper, the non-planar realm is far richer.
In addition, there are several concrete questions for future investigation, and we now mention a few of them. First, it would be interesting to investigate in further detail the interplay between our combinatorial tools and the classification of diagrams based on equivalence moves. For example, a concrete problem is to classify the on-shell diagrams associated to all permutation inequivalent top-dimensional cells for various G(k, n)'s [58]. It would be interesting to find an algorithm that starting from a generalized matroid polytope constructs an on-shell diagram, perhaps a reduced representative, associated to it. Similar methods exist for constructing planar on-shell diagrams from permutations [25] and for constructing dimer models (i.e. bipartite graphs on a torus without boundaries) from toric diagrams [59,60]. It would be worth studying whether the stratification of non-planar on-shell diagrams hints at some interesting topologies of the associated geometries and, if so, what its physical significance is. 23 It is also natural to investigate whether there are non-planar counterparts for some of the objects which followed on-shell diagrams in planar N = 4 SYM, such as deformed on-shell diagrams [61][62][63][64][65] 24 and the amplituhedron [26,27]. Another question to explore is whether there is a non-planar generalization of the connection between scattering amplitudes in the 3d ABJM theory [68] and the positive orthogonal Grassmannian [69,70]. 23 Here we have in mind the approach to stratification introduced in [44], based on the generalized matching and matroid polytopes. 24 Deformed amplitudes have been studied in [66,67].
Let us consider the perfect orientation corresponding to the reference perfect matching p ref = X 1,4 X 2,3 X 2,4 , which has source set {2, 3}. Using our prescription for the boundary measurement, we obtain the Grassmannian matrix The on-shell form becomes In terms of minors, it becomes which is simply the form for the planar embedding, i.e. the ordinary square box in Figure 5. This illustrates the independence of the on-shell form on the embedding and shows that the generalized face variables maintain a d log form regardless of its choice.

B Combinatorial Signs: a Torus Example
To illustrate the main issues concerning the combinatorial signs that arise when trying to generalize the boundary measurement to higher genus, let us consider the on-shell diagram on the torus shown in Figure 28. We pick the reference perfect matching p ref = X 1,2 Y 1,2 Z 1,2 , which gives the source set {2, 4}. External nodes have been ordered according to the prescription in §6.
The matrix C takes the schematic form: where we have already included the positivity signs (−1) s(i,j) . As mentioned in §6.1, for non-planar diagrams the individual flows are also subject to combinatorial signs. Let Figure 28. An on-shell diagram with two boundaries and four external nodes on the torus. The blue edges are those in the reference perfect matching.
genus-0 prescription to higher genus, i.e. if we do not insist in closing flows into loops within the unit cell. Focusing on the example at hand, Figure 29 shows the two flows that contribute to the entry C 23 , which run from source 2 to sink 3. We then use the boundaries and cuts to form a loop, as for the genus-0 cases. The first flow gives rise to a single loop with no self-intersections, since the flow does not contain any edge that crosses the cut. The second flow contains a self-intersection since one of its edges crosses the cut. The first flow gets no sign while the second one picks a (−1). Similarly, two flows contribute to C 41 . Both of them are analogous to the first flow in Figure 29, in that neither of them has self-intersections. We would thus expect no combinatorial signs for them. All other flows connect pairs of nodes on the same boundary, and hence never utilize the cut and do not self-intersect. As a result, we do not give any additional signs to them.
The matrix corresponding to this sign prescription becomes 3 Figure 29. The two flows contributing to C 23 , completed into closed loops using the boundaries and the cut. We have denoted it K to differentiate it from the true Grassmannian matrix C, which we will write shortly. We note that the only signs that have been introduced are the overall (−1) s(i,j) positivity signs for entire entries and the one given to the second flow in Figure 29, i.e. to p 7 = X 3,1 Z 4,3 X 1,2 Z 1,2 . The minors that arise from (B.2) are: The only minor that requires delicate cancellations in order to achieve the desired map between Plücker coordinates and perfect matchings is k 13 . We see straight away that this choice of signs did not work: we would like to see a single term contributing to ∆ 13 , corresponding to the only perfect matching with source set {1, 3}, i.e. p 11 = X 4,3 Y 4,3 Z 4,3 X 1,2 Y 1,2 Z 1,2 . The two surplus terms in (B.3) should have been subject to a cancellation rather than doubling up, and for this reason appear with a coefficient of 2.
The graph under consideration can also be embedded on a genus-zero surface, as shown in Figure 30. Considering this alternative embedding is useful for identifying the source of the failure. In this case, it becomes clear that both flows in Figure 29 cross the cut, and hence should receive a minus sign. Indeed, giving p 3 = X 2,4 Z 4,3 X 1,2 Z 1,2 a minus sign, all minors become well behaved: ∆ 12 = p 5 + p 8 ∆ 23 = p 9 ∆ 13 = p 11 ∆ 24 = 1 ∆ 14 = p 1 + p 2 + p 4 + p 6 + p 12 The lesson is simple: it appears it is possible to avoid self-intersections by looping around the torus. Simply giving a minus sign to all paths that go around the torus does not work either, as is easy to verify for this example -we precisely want to give a minus sign to those paths that use the periodicity of the torus to avoid self-intersections. Again, we stress that this example should be regarded only as motivation for the prescription in §6, which directs us to close loops within the unit cell. The prescription works more generally, such as in the genus-two example in §6.4 which contains no cuts at all. Figure 31 shows all the flows for the diagram in Figure 28 and their associated rotation numbers (and hence signs) as determined by the rules in §6. It is easy to verify that these are the correct signs postulated above, which yield (B.4).

C On-Shell Form for a Genus-One NMHV Diagram
To show that the method prescribed in §7.2.2 works just as well for graphs with higher genus, we now consider the non-planarizable genus-1 example studied in §6.3 shown in Figure 32.
Following the prescription in §7.2.2, we find the matrices T and M to be We have checked that this result coincides with the result obtained by using the boundary measurement as described in §7.1, giving further evidence to both methods as well as to the validity of the boundary measurement in §6.

D N 2 MHV Example with Two Auxiliary Edges
Let us consider the N 2 MHV example in Figure 33. The T matrix is given by    This can be simplified using the fact that the points {1, 6, 7, 9} are collinear, {8, 9, 10} are collinear, {2, 3, 10} are collinear and {3, 5, 9, 10} are coplanar, as can be read off from (D.1). After these simplifications, the dependence on nodes 9 and 10 is encoded in the ratio Putting everything together, we obtain the following on-shell form (4) This differential form has been independently confirmed using the boundary measurement procedure from §7.1.

E Six-Point Leading Singularity
Here we compute the six-point NMHV non-planar leading singularity considered in §7.4.3. For convenience, we quote the Grassmannian formula where the contour of integration is taken around the pole S = (124)(346)(365) − (456)(234)(136). After taking into account the δ-functions, the six-point NMHV leading singularity is a one-dimensional contour integral of a parameter, which we shall denote τ . It is straightforward to check that S is a degree-three polynomial in τ , rendering the solutions to S = 0 rather complicated. Instead we apply the residue theorem, namely that the residue at S = 0 is equal to minus the sum of the residues at (234) = 0, (345) = 0, (456) = 0, (561) = 0, (136) = 0 and (236) = 0. 25 In what follows we compute each residue separately.