Determining Genus From Sandpile Torsor Algorithms

We provide a pair of ribbon graphs that have the same rotor routing and Bernardi sandpile torsors, but different topological genus. This resolves a question posed by M. Chan [Cha]. We also show that if we are given a graph, but not its ribbon structure, along with the rotor routing sandpile torsors, we are able to determine the ribbon graph's genus.


Introduction
In this paper, we work with connected graphs that may have multiple edges between the same pair of vertices but we will not allow self loops. We will follow much of the same notation that is used in Chan et al. (2014). For a graph G, denote the set of vertices by V (G), the set of edges by E(G), and the set of spanning trees by T (G).

The Sandpile Group
For any graph G, define the group Div(G) of divisors of G as: Define the subgroup Div 0 (G) of degree-0 divisors of G as: where in general, the degree of a divisor is the sum v∈V (G) n v .
The Laplacian matrix ∆ of G is the symmetric matrix defined by: Finally, define the sandpile group or Picard group Pic 0 (G) as: Pic 0 (G) := Div 0 (G)/im(∆) We can view the elements of Div 0 (G) as configurations on a graph where we place some number of "chips" on each vertex (allowing for negative chips but not fractional chips). The image of the graph Laplacian is generated by "firing" and "unfiring" vertices of G. When a vertex v fires, it sends one chip along each edge incident to v. This decreases the number of chips at v by the degree of v and increases the number of chips at every other vertex w by the number of edges incident to both v and w. When a vertex v unfires, it takes in one chip along each edge incident to v. This increases the number of chips at v by the degree of v and decreases the number of chips at every other vertex w by the number of edges incident to both v and w.
Thus, an equivalent definition of Pic 0 (G) is the abelian group whose elements are configurations of zero total chips on the vertices of G, whose binary operation is pointwise addition, and with the equivalence relation given by firing and unfiring vertices. In fact, since unfiring a single vertex is equivalent to firing every other vertex, we can generate our equivalence relation purely by firing vertices. This gives the following useful lemma: Lemma 1. Two elements S and S ′ of Div 0 (G) are equivalent as elements of Pic 0 (G) if and only if there is a sequence of vertex firings that leads from S to S ′ .

Relating Pic 0 (G) and T (G)
The narrative of this section is similar to the narrative given in the introduction of Chan et al. (2014) and some of these ideas were also explored in Wagner (2000).
It is a well known fact that the size of the sandpile group of a graph G is the same as the number of spanning trees of G (as shown e.g. in Biggs (1999) and Holroyd et al. (2008)). Thus, it is natural to ask whether there exists a canonical (automorphism invariant) bijection between these two sets. However, this is impossible in general because there is not always a distinguished spanning tree to associate with the identity element of the sandpile group. For example, a complete graph with more than two vertices has no distinguished spanning tree.
The next best hope would be if there were a canonical free transitive action of Pic 0 (G) acting on T (G). A free transitive action of a group G on a set S is a function f : G × S → S such that for any pair s, s ′ ∈ S, there is a unique g ∈ G such that f (g, s) = s ′ . A canonical free transitive action is also too much to ask for on a general graph. For example, on a graph with two vertices and three or more edges, each edge is a spanning tree and they are all indistinguishable. Furthermore, even after we select one of the edges, the remaining edges are still indistinguishable.
To resolve this issue, we introduce additional structure on G. For each vertex v ∈ V (G), assign a cyclic order ρ v to the edges incident to v. When this information is provided, (G, ρ) is called a ribbon graph, sometimes referred to as a combinatorial embedding or a combinatorial map. Even with the ribbon graph structure provided, there is not always a canonical choice of free transitive action. For example, if we have a graph with two vertices v and w and three edges e 1 , e 2 and e 3 such that ρ v = ρ w = (e 1 , e 2 , e 3 ), then there is no canonical way to decide whether the equivalence class of the sandpile group containing (v − w) or the equivalence class of the sandpile group containing (w − v) should send e 1 to e 2 (see Figure  1). This final ambiguity can be fixed by associating our free transitive action with a distinguished vertex, that we call the basepoint.
Definition 1.1. A sandpile torsor of a ribbon graph (G, ρ) is a free transitive action of Pic 0 (G) on T (G) given a basepoint v ∈ V (G).
Definition 1.2. A sandpile torsor algorithm α is a function whose input is a ribbon graph (G, ρ) and one of its vertices v ∈ V (G) and whose output is a sandpile torsor on (G, ρ) with basepoint v.
The two sandpile torsor algorithms we will work with in this paper are the rotor routing process and the Bernardi process. We give a full description of these algorithms in Section 2.

Summary of Results
From a ribbon graph (G, ρ), we obtain an associated surface by thickening the edges of G and then gluing disks to the boundary components while respecting the cyclic orders given by ρ. The genus of a ribbon graph (G, ρ) is the genus of its associated surface. (i) A ribbon graph is called planar if its genus is equal to 0. The inspiration for this paper comes from the following theorem proven in Chan et al. (2014) for the rotor routing case and Baker and Wang (2017) for the Bernardi case. This theorem suggests that we may be able to determine the genus of a ribbon graph from the structure of the sandpile torsors given by a sandpile torsor algorithm, a question posed by Melody Chan Chan. However, the following theorem shows that this is not the case: Theorem 3. Let (G, ρ) and (G ′ , ρ ′ ) be two ribbon graphs with genera g and g ′ respectively and let α v be the rotor routing or Bernardi process is a bijection, and γ : Pic 0 (G) → Pic 0 (G ′ ) is an isomorphism such that for every vertex v ∈ V (G) the following diagram commutes: (i) Note that this is not the same as the combinatorial genus of G which is defined as E(G) − V (G) + 1.
We will construct two ribbon graphs demonstrating this theorem in Section 3.1. In fact, we give a very small counterexample where V (G) = V (G ′ ) = 2 and E(G) = E(G ′ ) = 5. Note that if we require g = 0, Theorem 3 does not hold (this is a corollary to Theorem 2).
For certain G and G ′ , we can strengthen Theorem 3 by requiring γ to be a particular kind of map, which we will define in Section 3.2.
Theorem 4. Consider the same conditions as Question 3, but where we require γ to be induced by the identity on a suitable V gen ⊆ V (G). We can still find (G, ρ) and (G ′ , ρ ′ ) satisfying the above conditions where g = g ′ .
While we could prove Theorem 3 by restricting to 2-vertex ribbon graphs, we show in Proposition 11 that we need more vertices to prove Theorem 4. Nevertheless, we give a family of 3-vertex ribbon graphs that demonstrate this theorem in Section 3.2.
Because of the failure of these conjectures, any algorithm for determining the genus of a ribbon graph must require more information than just the orbits of the sandpile torsors produced by the rotor routing or Bernardi process. In Section 4, we consider the case where we are given V (G) and E(G) but not ρ. In this setting, we show that if we are given the map r v (i.e. the rotor routing torsor with basepoint v) for every v , we can determine the genus of (G, ρ). Specifically, in Section 4 we prove: Theorem 5. Let (G, ρ) be a ribbon graph such that V (G) and E(G) are known but ρ is not. Suppose that for every v ∈ V (G), we are given the map where r v is the rotor routing torsor with basepoint v (and each T ∈ T is given as a subset of E(G)). Then, it is possible to determine the genus of (G, ρ).

Rotor Routing Process
The rotor routing process is a sandpile torsor algorithm described in Holroyd et al. (2008) and based on the "Eulerian walkers model" from Priezzhev et al. (1996).
For v ∈ V (G), denote r v as the sandpile torsor with basepoint v determined by the rotor routing process (or the rotor routing torsor with basepoint v for short). For S ∈ Pic 0 (G) and T ∈ T (G), define r v (S, T ) in the following way: Choose a representative of S with a nonnegative number of chips away from v. Then, direct the edges of T so that they point towards v along the path of T . There is now one directed edge coming out of every vertex w = v. This edge is called the rotor at w. Choose any vertex w that has a positive number of chips. Then, rotate the rotor at w to the next edge in ρ w and send a chip from w to the other vertex incident to this edge. Continue this process until every vertex has zero chips (at which point the chips have all been deposited at v). The resulting position of the rotors is independent of the order that the rotors are rotated and, after removing the directional information, produces a new spanning tree T ′ . See Figure 2 for an example.
It is proven in Holroyd et al. (2008) that r v is a well-defined free transitive action.

Bernardi Process
The Bernardi process is another sandpile torsor algorithm that is described in Baker and Wang (2017) based on results from Bernardi (2008).
For v ∈ V (G), denote β v as the sandpile torsor with basepoint v determined by the Bernardi process (or the Bernardi torsor with basepoint v for short). For S ∈ Pic 0 (G) and T ∈ T (G), define β v (S, T ) in the following way: Consider an edge e incident to vertices v 1 and v 2 to be composed of two half-edges (e, v 1 ) and (e, v 2 ). Choose an arbitrary edge e incident to v. (The choice of e does not affect the action). We first need to find the break divisor associated with each spanning tree. To get the break divisor associated with T , we follow a recursive procedure beginning at the half-edge (e, v) and continuing until we return to (e, v). Informally, this procedure traces around T and places chips the first time it crosses each edge that is not in T . Say that our current edge is (e ′ , v ′ ). There are 2 cases: 1) If e ′ ∈ T , we consider the other half edge associated to e ′ , say (e ′ , w ′ ). Then, we move to the half edge (e ′′ , w ′ ) where e ′′ is the next edge after e ′ in ρ w ′ and restart the procedure with (e ′′ , w ′ ) as our new half edge. 2) If e ′ ∈ T , we consider the half edge (ẽ, v ′ ) whereẽ is the next edge after e ′ in ρ v ′ . Furthermore, if we have not already passed through the other half edge involving e ′ , we place a chip on v ′ . Then we restart the procedure with (ẽ, v ′ ) as our new half edge.
This process continues until we return to (e, v). At this point, we will have placed one chip for each edge not in T , so this gives us an element of Div g (G) It is shown in  that when we apply the Bernardi process to each spanning tree, the resulting chip configurations are all unique as elements of Pic g (G) := Div g (G)/im(∆).
The element of Pic g (G) associated to the spanning tree T by this process is called the break divisor associated to T . (ii) β v (S, T ) is given by adding S to the break divisor associated to T , which gives us a new element of Pic g (G), and then finding the spanning tree T ′ for which this is the break divisor. See Figure 3 for an example.
It is proven in Baker and Wang (2017) that β v is a well-defined free transitive action, and an efficient algorithm is provided to find the tree associated with a given break divisor.

Counterexamples
We first give an algebraic result that will help to prove both Theorem 3 and Theorem 4. In particular, this result says that in order to show that the diagrams commute, we only need to test on a set of generators of Pic 0 (G).
Lemma 6. Let H be a group and X be a set such that γ is an automorphism on H, ϕ is an automorphism on X, and α is a group action from H × X → X.
Let {h i } be a set of generators for H and x be an arbitrary element of X.
Proof: By definition, we can write any h ∈ H as h k1 1 h k2 2 ...h kn n . We will proceed by induction on the degree of this monomial.
When the degree is 1, h is a generator and the result holds automatically. For an arbitrary h, assume without loss of generality that k 1 > 0. Then, we can write h = h 1 h ′ where the degree of h ′ is one less than the degree of h.
For any x ∈ X, the lemma follows from this chain of equalities (which hold by the definition of a group action and the induction hypothesis):

Unrestricted γ (Theorem 3)
We can prove Theorem 3 while only considering ribbon graphs with 2 vertices. For these graphs, each edge is a spanning tree, and there are several other nice properties. We begin with a well known result that is straightforward to prove either by the definition of Pic 0 (G) or by the chip-firing perspective.
Lemma 7. If G is a graph with 2 vertices and n edges then Pic 0 (G) ∼ = Z/nZ. Furthermore, two configurations are equivalent as elements of Pic 0 (G) if and only if the number of chips on a fixed vertex differ by a multiple of n.
There is a known formula for the genus of a ribbon graph (G, ρ). Define a cycle on a ribbon graph (G, ρ) as a closed loop such that whenever we enter a vertex, we exit along the next edge in the cyclic order at that vertex. It was shown in Edmonds Jr (1960) that these cycles are the faces of the surface associated to (G, ρ). Thus, we have the following by Euler's formula (where cyc(G, ρ) is the number of cycles of (G, ρ)): With this formula in mind, we can construct a pair of ribbon graphs that prove Theorem 3. Consider 2 ribbon graphs, (G, ρ) and Figure 4). Furthermore, label the edges of G as a 1 through a 5 such that ρ v1 = (a 1 , a 2 , a 3 , a 4 , a 5 ) and ρ w1 = (a 1 , a 3 , a 2 , a 5 , a 4 ) and label the edges of G ′ such that ρ Figure 4). Finally, let ϕ be the map that sends Fig. 4: Two ribbon graphs with the same sandpile torsor structure but different genus.
and γ be the map that doubles the number of chips at each vertex. Note that γ is an isomorphism because Pic 0 (G) ∼ = Z/5Z.
, γ, and ϕ be constructed as above and identify v 1 with v 2 and w 1 with w 2 . For every vertex v ∈ V (G) the following diagram commutes, where α v is the rotor routing process r or the Bernardi process β with basepoint v: However, the genus of (G, ρ) is 2 while the genus of (G ′ , ρ ′ ) is 1.

Proof:
First, we observe that β vi = r wi and β wi = r vi . To see this, it suffices to show that they match on a generator.
Therefore, we only need to prove the result for the rotor routing torsors. Furthermore, by Lemma 6, it suffices to check a generator of Pic 0 (G) (and we do not have to choose the same generator for r v as for r w ).
Using v i − w i as our generator, we get the following diagram for r w : Using w i − v i as our generator, we get the following diagram for r v : Finally, we find from direct computation that cyc(G, ρ) = 3 while cyc(G ′ , ρ ′ ) = 1. By Proposition 8, this means that the genus of (G, ρ) is 1 while the genus of (G ′ , ρ ′ ) is 2.

Restricted γ (Theorem 4)
For any G and G ′ on the same set of vertices, the identity map on V (G) induces a natural isomorphism from Div 0 (G) → Div 0 (G ′ ). However, this isomorphism does not always induce an isomorphism from Pic 0 (G) → Pic 0 (G ′ ) because it is possible that two chip configurations will be firing equivalent on G but not G ′ (or vice versa). Nevertheless, for certain graphs, we can find natural isomorphisms with respect to appropriate subsets of vertices.
Let G and G ′ be two graphs on the same set of vertices. Furthermore, suppose that there is some V gen ⊂ V (G) satisfying the following properties: • Every element of either Pic 0 (G) and Pic 0 (G ′ ) can be written as a linear combination of vertices in V gen . In other words, any chip configuration is firing equivalent to one with no chips on vertices outside of V gen .
• Two chip configurations with no chips outside of V gen are firing equivalent in G if and only if they are firing equivalent on G ′ .
Then, letγ be a map from Pic 0 (G) → Pic 0 (G ′ ) that we get from the following procedure. Given S ∈ Pic 0 (G), we first choose a representative for S with no chips outside of V gen , which exists by Property 1. Then, we letγ(S) be the equivalence class of Pic 0 (G ′ ) containing Id(S) where Id is the map from Div 0 (G) → Div 0 (G ′ ) induced by the identity on V (G). By the second property, we have the following: If (G, ρ) and (G ′ , ρ ′ ) are ribbon graphs on two vertices with the same number of edges, then G and G ′ must be isomorphic because we do not allow loop edges. This means that we can take V gen = V (G) and this will always give us a isomorphismγ : Pic 0 (G) → Pic 0 (G ′ ). Note thatγ maintains the number of chips on each vertex while the γ we used for Proposition 9 doubles them, so this is not sufficent to prove Theorem 4. In fact, we show the following: Proposition 11. There are no examples of 2-vertex graphs satisfying Theorem 4.
Proof: Let V (G) = {v 1 , w 2 } and V (G ′ ) = {v 2 , w 2 } where we identify v 1 with v 2 and w 1 with w 2 , and also refer to them as v i and w i respectively (similarly to the notation used in the proof of Proposition 9). We can use r w and r v (or equivalently β v and β w ) to determine ρ v2 and ρ w2 in relation to ρ v1 and ρ w1 . Then, we show that cyc(ρ v1 · ρ w1 ) = cyc(ρ v2 · ρ w2 ).
ϕ is a bijection, so it does not affect the number of cycles in the resulting product. This means that (G, ρ) and (G ′ , ρ ′ ) must have the same genus.
Proposition 11 says that in order to prove Theorem 4, we will need to work with ribbon graphs that have at least 3 vertices. Let x be any odd integer. Consider two ribbon graphs, (G, ρ) and Fig. 6: The Rotor Routing/ Bernardi torsors at v and w are the same on (G, ρ) when (G ′ , ρ ′ ) is planar that |V (G)| = |V (G ′ )| = 3. Call the elements of V (G) v 1 , z 1 , and w 1 , and call the elements of V (G ′ ) v 2 , z 2 , and w 2 . Connect v 1 and z 1 with 2 edges, z 1 and w 1 with x edges, v 2 and z 2 with 1 edge, and z 2 and w 2 with 2x edges (see Figure 5). For the cyclic ordering ρ z1 , set the 2 edges that connect to v 1 to be next to each other. Furthermore, set the cyclic order of edges connecting z 1 to w 1 to be the same for ρ z1 as ρ w1 , and likewise, set the cyclic ordering of edges connecting z 2 to w 2 to be the same for ρ ′ z2 as ρ ′ w2 (again see Figure 5).
Theorem 12. For any g ∈ Z >0 , let (G, ρ) and (G ′ , ρ ′ ) be constructed as above with x = 2g + 1. If we identify the vertices of G with the vertices of G ′ , then Pic 0 (G) ∼ = Pic 0 (G ′ ) and {v i , w i } the V gen requirements of Lemma 10. Furthermore, the diagram in Theorem 4 commutes. However, the genus of (G, ρ) is g while the genus of (G ′ , ρ ′ ) is 2g.
Note that if x is even, then this theorem does not hold. In particular, Pic 0 (G) ∼ = Z/2Z ⊕ Z/xZ and Pic 0 (G ′ ) ∼ = Z/2xZ. These two groups are only isomorphic if x is odd.
Before we prove the theorem, we prove a lemma which gives a sufficient condition for two specific basepoints to be equivalent with respect to either of our sandpile torsor algorithms. In particular, when we apply this lemma to the ribbon graphs in Figure 5, we find that the rotor routing process is the same with basepoint v i as with z i (where i is either 1 or 2) and the same is true for the Bernardi process.
Let (G, ρ) be a ribbon graph and let v, w ∈ V (G). We split G into 3 subgraphs labeled G ′ , G v , and G w using the following construction (which is given in Figure 6): For any e ∈ E(G), • If every path from e to w passes through v, e ∈ G v .
• If every path from e to v passes through w, e ∈ G w .
• If neither above condition is met, e ∈ G ′ .
When including an edge in any of these subgraphs, we also include both incident vertices. Furthermore, we always require v ∈ G v and w ∈ G w , even when G v or G w contains no edges. It is immediate that Lemma 13. For a ribbon graph (G, ρ) with v, w ∈ V (G), construct (G ′ , ρ ′ ) as above. Let the following conditions hold: • The edges of G ′ that are incident to v are all sequential in ρ v .
• The edges of G ′ that are incident to w are all sequential in ρ w .
Then, α v and α w are equivalent sandpile torsors when α is replaced by either r or β.
Proof: First, we consider the case where α is the rotor routing process. Let S be any element of Div 0 (G) that has a nonnegative number of chips away from v. Let S ′ be an element of Div 0 (G) that is equivalent to S as an element of Pic 0 (G) and has a nonnegative number of chips away from w.
We need to show that for any spanning tree T ∈ T (G), we have r v (S, T ) = r w (S ′ , T ). We can begin our evaluation of each of these rotor routing torsors by performing rotor routing on G v and G w until all vertices in G\G ′ have no chips on them. Because S and S ′ are in the same sandpile equivalence class, and because the rotors in G v and G w will always point towards v and w respectively, the resulting portions of the spanning tree outside of G ′ is the same with either basepoint. Furthermore, if a chip ever leaves G ′ during rotor routing (say WLOG that it enters G v ), then this happens because the rotor at v rotates into G v . For the chip to return to G ′ (which must happen eventually), the rotor at v must keep spinning until it returns to an edge in G ′ . This drops one chip across each edge in G v incident to v. The effect of this rotation is the same as firing v in the subgraph G v which has no effect on the resulting tree. By Theorem 2, we know that r v = r w when we restrict to (G ′ , ρ ′ ) and the above analysis shows that this is also true on (G, ρ).
The Bernardi action is even simpler. If we start each tour with the first edge in G ′ connected to the basepoint vertex, then the tours will go around G v and G w in the same direction. Thus, the effect of these subgraphs on the break divisors will be the same for each basepoint vertex. Because the two Bernardi actions are the same on G ′ and we alter each of them in the same way, they are also the same on G. Now we are ready to prove the Theorem 12.
Proof Proof of Theorem 12: For each ribbon graph, there are 2x spanning trees, which means that this is also the size of the sandpile groups. We claim that the sandpile element v i − w i has order 2x in both Pic 0 (G) and Pic 0 (G ′ ). This means that it must generate the sandpile group for both graphs. Furthermore, since there are no chips on z i , the pair {v i , w i } satisfies the V gen requirements of Lemma 10.
Label the spanning trees of G 1 as [a, b] where a is the index of the edge between v 1 and z 1 (either 1 or 2) and b is the index of the edge between z 1 and w 1 in cyclic order (ranging from 1 to x). Label the spanning trees of G 2 as [a] with a the index of the edge between z 2 and w 2 (ranging from 1 to 2x). Our claim follows if we show that are all distinct spanning trees of G 1 and are all distinct spanning trees of G 2 (where we could replace r wi with any other sandpile torsor).
On G 1 , r w1 (1, 0, −1) switches the edge between v 1 and z 1 and then shifts the edge between z 1 and w 1 up by 1. The only special case is when we get to the last edge between z 1 and w 1 and shift over to the edges between v 1 and z 1 . However, this just causes the edge between v 1 and z 1 to shift twice which does not change it and then we get the first edge between z 1 and w 1 before depositing the chip at w 1 . Thus, the trees given in 1 are: On G 2 , r w2 (1, 0, −1) simply switches to the next edge between z 2 and w 2 . Thus, the trees given in 2 are: In both cases, we get 2x distinct trees. Additionally, this result, along with Lemma 6, tells us that there is a unique bijection ϕ : T (G 1 ) → T (G 2 ) that will make the diagram from Theorem 4 commute when our sandpile torsor is r wi . In particular, we let ϕ( We now need to check that this same bijection will cause the diagram to commute when we replace r wi with r vi , β vi , or β wi (and by Lemma 6, we only need to check on a generator).
By similar computation to above, we find that These trees occur in the same order that they did for r wi , so the same bijection holds. Now, we look at the Bernardi torsors. On G 1 , consider β v1 (1, 0, −1). We will start the Bernardi tour on the first edge connecting v 1 to z 1 . If this edge is part of our spanning tree, we will place one chip on z 1 when the tour reaches the other edge between v 1 and z 1 . Otherwise, we place one chip at v 1 at the very beginning. Additionally, we place one chip on z 1 for each edge between z 1 and w 1 before the edge of our spanning tree, and one chip on w 1 for each edge between z 1 and w 1 after the edge of our spanning tree. Thus there are 2 cases: If the spanning tree is [1, k] for some k, then the break divisor is (0, k, x − k). If the spanning tree is [2, k] for some k, then the break divisor is (1, k − 1, x − k). In the first case, adding (1, 0, −1) gives (1, k, x − k − 1) which is the break divisor for [2, k + 1] (if k = x, we have the divisor (1, x, −1) which is equal to (1, 0, x − 1) after unfiring w 1 once. This is the break divisor for [2, 1]). In the second case, adding (1, 0, −1) gives (2, k − 1, x − k − 1). After firing v 1 once, we get (0, k + 1, x − k − 1) which is the break divisor for [1, k + 1] (if k = x, we have the divisor (0, x + 1, −1) which is equal to (0, 1, x − 1) after unfiring w 1 once. This is the break divisor for [1,1].) This means that which is the same as the r w1 action.
The case for β w1 (−1, 0, 1) is completely similar and yields that which is the same as r v1 .
On G 2 , because the edge between v 2 and z 2 is in every spanning tree, we can ignore it and look at the other two vertices. On a two vertex graph, the rotor routing process at one basepoint produces the same tensor as the Bernardi process at the other basepoint. Thus, β v2 = r w2 and β w2 = r v2 . Combined with our previous results that β v1 = r w1 and β w1 = r v1 , we conclude that β vi = r wi and β wi = r vi . This, the diagram commutes for either sandpile torsor algorithm.
The only thing left to show is that the genus of G 1 is g while the genus of G 2 is 2g. This is a direct application of Lemma 8.

Genus From Rotor Routing when the Graph is Known
In order to determine the genus of a ribbon graph, we need more information than just the rotor routing or Bernardi torsors. For this final section of the paper, we work with a ribbon graph (G, ρ) for which G is known, but ρ is not. This alone is not enough to determine the genus of (G, ρ), but we show that if we are also given the rotor routing action at each basepoint, we can calculate the genus. In other words, we prove Theorem 5.
Our method of proof is to take an arbitrary vertex of our ribbon graph and show that the cyclic order of edges around it is essentially uniquely determined. Then, we can apply Proposition 8 to determine the ribbon graph's genus. Note that (G, ρ) has multiple v-components if and only if v is a cut vertex. Furthermore, the intersection of any two v-components is v. In Figure 7, the lower ribbon graph is a v-component of the upper ribbon graph.
Lemma 14. Let (G, ρ) be a ribbon graph with a vertex v. Let e 1 and e 2 be two edges incident to v in the same v-component, and let w 1 and w 2 be their other incident vertices respectively. There exists a spanning tree T of (G, ρ) such that: • e 1 ∈ T , • e 2 ∈ T , and • the path from w 2 to v using edges in T passes through w 1 .
Proof: By the definition of v-components, there is a path between w 1 and w 2 that does not pass through v. Because this path does not pass through v, adding e 1 to the path will not give us a cycle. Then, we expand to any spanning tree. This spanning tree must not contain e 2 or we would have a cycle, so all three conditions are met.
Consider (G, ρ), v, e 1 , e 2 , w 1 , and w 2 as given in Lemma 14. Let T be a spanning tree satisfying the conditions of this lemma and (G ′ , ρ ′ ) be the v-component containing e 1 and e 2 . Let T be a spanning tree satisfying the conditions of Lemma 14, and let T ′ be the restriction of T to G ′ (which is a spanning tree of G ′ ).
Let S ∈ Div 0 (G) be the configuration that places 1 chip on v, −1 chips on w 2 , and 0 chips elsewhere. Let r w2 be the rotor routing torsor on (G, ρ) with basepoint w 2 . LetT = r w2 (S, T ) andT ′ be the restriction ofT to E(G ′ ).
Proposition 15. Consider the construction above. The edge e 2 is directly after e 1 in ρ ′ v if and only if T ′ = T ′ ∪ e 2 \ e 1 .
Proof: In the evaluation of r w2 (S, T ), the single chip on v travels around the graph until it reaches w 2 . Whenever the chip enters a v-component other than (G ′ , ρ ′ ), say (G ′′ , ρ ′′ ), it remains in (G ′′ , ρ ′′ ) until it returns to v. While the chip is in (G ′′ , ρ ′′ ), it can only shift edges within (G ′′ , ρ ′′ ). In particular, it will not affectT ′ . After the chip has returned to v, it will move on to the next edge in the cyclic order around v, and the effect onT ′ will be the same as if the rotor had spun an extra time without sending the chip. Hence, it suffices to consider the case where G has only one v-component.
After this simplification, the forward direction of the proof is immediate because if e 2 is the next edge after e 1 in the cyclic order around v, the rotor routing torsor will have a single step which exchanges e 1 for e 2 and then deposits the chip to w 2 . The result is our desired tree.
For the other direction, we proceed by contradiction. Assume that the edges a 1 , .., a k all fall between e 1 and e 2 in the cyclic order around v. Consider the configuration S ′ ∈ Div 0 (G) that places k + 1 chips on v and −d x chips on each other vertex x where d x is the number of edges in {a 1 , .., a k , e 2 } that are incident to x. Then, the evaluation of r w2 (S ′ , T ) rotates the rotor at v around k + 1 times so that it is now at e 2 . Thus, the resulting tree is T ′ ∪ e 2 \ e 1 . To establish our contradiction, we need to show that r w2 (S ′ , T ) = r w2 (S, T ). Because the rotor routing action is free and transitive, this statement reduces to showing that S and S ′ are not equivalent as elements of Pic 0 (G), which is the same as showing that S − S ′ is not equivalent to the identity.
The configuration S −S ′ has −k chips on v and d x chips on each other vertex x, where d x is the number of edges in {a 1 , .., a k } that are incident to x. By Lemma 1, if S − S ′ is equivalent to the identity, then we can get from this configuration to the configuration where there are no chips on the graph merely by firing vertices. Because firing a vertex is the only way to decrease the number of chips it has, every vertex that begins with chips must be fired. Additionally, any non-v vertex adjacent to a fired vertex must be fired because it begins with no chips and gains a chip once the adjacent vertex has been fired. By recursion, this means that any vertex that is connected to a fired vertex by a path not passing through v must fire. We assumed that every vertex is on the same v-component, so every non-v vertex must fire. Additionally, since every edge in E(G) is incident to a non-v vertex, every edge must have a chip travel across it. Since there are at least k + 2 edges incident to v, v will eventually have a positive number of chips and must also fire. However, firing every vertex is equivalent to firing no vertices, meaning S − S ′ must be the configuration where there are no chips. This is a contradiction because we assumed that there were edges between e 1 and e 2 This proposition implies that on any cut-free ribbon graph (G, ρ), given the necessary inputs for Theorem 5, we can precisely calculate ρ v k and thus, by Proposition 8, also the genus of (G, ρ). However, knowing the restriction of ρ v to each v-component is not generally enough information to determine genus. We will also need information about when edges from one v-component fall between edges of a second v-component. This is the content of the next two lemmas.
Let (G, ρ) be a ribbon graph with a vertex v. Let e 1 and e 2 be two sequential edges within a vcomponent, and w 1 and w 2 be their other incident vertices respectively. Consider a different v-component (G ′ , ρ ′ ) such that a 1 , ..., a k are the edges in E(G ′ ) that are between e 1 and e 2 in ρ v . Let T be a spanning tree satisfying the conditions of Lemma 14, and T ′ be the restriction of T to E(G ′ ).
Let S ∈ Div 0 (G) be the configuration with 1 chip on v, −1 chips on w 2 , and 0 chips elsewhere. Additionally, let r w2 be the rotor routing action on (G, ρ) with basepoint w 2 ,T = r w2 (S, T ), andT ′ be the restriction ofT to E(G ′ ).
We compare the treeT ′ to a tree we obtain by restricting to (G ′ , ρ ′ ) from the start. Let S ′ ∈ Div 0 (G ′ ) be the configuration with −k chips on v and d x chips on each other vertex x ∈ V (G ′ ), where d x is the number of edges incident to x in {a 1 , ..., a k }. Finally, let r ′ v be the rotor routing torsor on (G ′ , ρ ′ ) with basepoint v.
Proof: As the rotor at v rotates from e 1 to e 2 , it will pass through each of the edges {a 1 , .., a k } once. By the same reasoning as discussed in the previous proof, any edges not in E(G ′ ) that the rotor passes through will have no effect onT ′ . Every time the rotor reaches edge a i , one chip is transferred from v to the other vertex incident to a i (call this vertex b i ). Then, the chip travels around in (G ′ , ρ ′ ) until it returns to v. This has the same effect on the rotors in (G ′ , ρ ′ ) as if we placed a single chip on b i and evaluated r ′ v . Combining these single chip addition configurations gives us the element of the sandpile group S ′ . See Figure 7 Let (G ′ , ρ ′ ) be a ribbon graph with a vertex v such that v is not a cut vertex. (iii) Let {e 1 , ..., e n } be the edges of G ′ incident to v. For any E ⊆ {e 1 , ..., e n }, let S E ∈ Div 0 (G ′ ) be the configuration that places −k chips on v and d x chips on each other vertex x ∈ V (G ′ ) where d x is the number of edges incident to x in E.
(iii) We use (G ′ , ρ ′ ) instead of (G, ρ) because we want to think of (G ′ , ρ ′ ) as a v-component of a larger ribbon graph. Lemma 17. In the construction above, if S E = S E ′ then either E = E ′ or one is {e 1 , ..., e n } and the other is ∅.
Proof: S E = S E ′ if and only if S E − S E ′ = Id. Because S E − S E ′ and S E ′ − S E sum to the all zeros configuration, at least one of them must have a nonnegative number of chips placed on v. Call this configuration S ′ . By Lemma 1, if S ′ is equivalent to the identity, then we can get from S ′ to the all zeros configuration by firing vertices. Consider a sequence of firings that results in the all zeros configuration. Because the only way for a vertex to lose chips is to be fired, if v starts with a positive number of chips, it must be fired. Furthermore, if v starts with 0 chips, then unless S ′ is already the all zeros configuration (which only occurs when E = E ′ ), some vertex must have a positive number of chips, and must therefore fire. By definition of S E and S E ′ , the only vertices with a possibly nonzero number of chips in S ′ are those adjacent to v, so some vertex adjacent to v must fire. This deposits at least one chip to v, which means that v now has a finite number of chips and must fire as well.
We have shown that if E = E ′ , then v must fire at some point. Since the ordering of firings is irrelevant, we can assume that v fires first. Note that every vertex x in S ′ has either 0, d x , or −d x chips on it where d x is the number of edges connecting v to x. Thus, after firing v, each edge has either 0, d x , or 2d x chips. If every vertex ends up with 0 chips, then we have reached the all zeros configuration with only a single firing. This only occurs if every vertex began with −d x chips. By construction, we see that this occurs if E = {e 1 , ..., e n } and E ′ = ∅ (or vice versa). Otherwise, some vertex has a positive number of chips and every other vertex has a nonnegative number of chips. By the same reasoning used in the previous proposition, since we have only a single v-component, all non v vertices must fire at least once. However, since v also must fire, this means that every vertex must fire at least once when going from S ′ to the all zeros configuration. This cannot be required since firing every vertex is equivalent to firing no vertices.
By combining the results of the last two lemmas, for a ribbon graph (G, ρ) we are able to find exactly which edges from one v-component (G ′ , ρ ′ ) fall between two sequential edges in a second vcomponent(G ′′ , ρ ′′ ) with one exception. If all of the edges of (G ′ , ρ ′ ) fall between the same two edges of (G ′′ , ρ ′′ ), then we cannot always determine which pair of edges they fall between. However, the following lemma shows that any ambiguities in ρ v can be resolved with no effect on the genus of (G, ρ).
Lemma 18. In the above construction, the genus of (G, ρ) is the sum of the genus of (G ′ , ρ ′ ) and the genus of (G ′′ , ρ ′′ ).
Proof: First, we note that |E(G ′ )| + |E(G ′′ )| = |E(G)| because every edge in G is in exactly one of the subgraphs. Furthermore, |V (G ′ )| + |V (G ′′ )| = |V (G)| + 1 because every vertex in G is in exactly one of the subgraphs, except for v which is in both.
Next note that every cycle of (G, ρ) is entirely contained in either (G ′ , ρ ′ ) or (G ′′ , ρ ′′ ) unless it enters v on the edge e i or the edge e i+j . We also know that these two half edges must be part of the same cycle because after the cycle leaves (G ′ , ρ ′ ) via e i , it must enter (G ′ , ρ ′ ) again via e i+j or it would not be a closed loop. Because this cycle remains a cycle when restricted to either (G ′ , ρ ′ ) or (G ′′ , ρ ′′ ) it is double counted when summing |cyc(G ′ )| and |cyc(G ′′ )|. Thus, we have |cyc(G ′ )| + |cyc(G ′′ )| = |cyc(G)| + 1. Now, we use the genus formula given in Proposition 8, = g((G ′ , ρ ′ )) + g((G ′′ , ρ ′′ )).
We are now ready to prove Theorem 5.
Proof Proof of Theorem 5: Choose any vertex v ∈ V (G) and consider its v-components. Lemma 15 gives us the order of edges for each v-component while Lemma 16 gives which edges of one v-component are between two given edges of another v-component. Lemma 17 tells us that there is potential ambiguity if all of the edges in one v-component fall between the same two edges of another v-component. However, Lemma 18 resolves this ambiguity by allowing us to choose arbitrarily when we cannot deduce cyclic order from the previous lemmas with no effect on the ribbon graph's genus. If we repeat this procedure for every vertex of G, we have deduced the cyclic orders for a ribbon graph with the same genus as (G, ρ). Thus, we can use Proposition 8 to determine the genus of (G, ρ).
Finally, we conjecture that the same theorem holds for the Bernardi process.
Conjecture 19. Let (G, ρ) be a ribbon graph. Suppose that we are given V (G), E(G), Pic 0 (G), T (G) ⊂ E(G) and for every v ∈ V (G), we are given the map where β v is the Bernardi process with basepoint v. Then, it is possible to determine the genus of (G, ρ).
The challenge for this conjecture is that even on a cut-free graph, it is not easy to use the Bernardi process to detect information about the cyclic order around a fixed vertex without information about the cyclic order around other vertices. In other words, there is no clear analogue to Proposition 15.