Abstract 1 Introduction 2 Preliminaries 3 From cylindric Schnyder woods to toroidal Schnyder woods 4 Rivers 5 Algorithm for half-crossing toroidal Schnyder woods 6 Algorithm for crossing toroidal Schnyder woods 7 Experimental results 8 Concluding remarks References

Computation of Toroidal Schnyder Woods Made Simple and Fast: From Theory to Practice

Luca Castelli Aleardi ORCID LIX, Ecole Polytechnique, Institut Polytechnique de Paris, Palaiseau, France Eric Fusy ORCID LIGM, Université Gustave Eiffel, Champs-sur-Marne, France Jyh-Chwen Ko ORCID LIX, Ecole Polytechnique, Institut Polytechnique de Paris, Palaiseau, France Razvan-Stefan Puscasu ORCID École polytechnique fédérale de Lausanne (EPFL), Switzerland
Abstract

We consider the problem of computing Schnyder woods for graphs embedded on the torus. We design simple linear-time algorithms based on canonical orderings that compute toroidal Schnyder woods for simple toroidal triangulations. The Schnyder woods computed by one of our algorithm are crossing and satisfy an additional structural property: at least two of the mono-chromatic components of the Schnyder wood are connected. We also exhibit experimental results empirically confirming three conjectures involving the structure of toroidal and higher genus Schnyder woods.

Keywords and phrases:
Schnyder woods, toroidal triangulations, canonical ordering
Funding:
Luca Castelli Aleardi: this work is supported by ANR grant “3DMaps” ANR-20-CE48-0018.
Eric Fusy: this work is supported by ANR grant “3DMaps” ANR-20-CE48-0018.
Copyright and License:
[Uncaptioned image] © Luca Castelli Aleardi, Eric Fusy, Jyh-Chwen Ko, and Razvan-Stefan Puscasu; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Combinatoric problems
; Theory of computation Computational geometry
Related Version:
Full Version: https://hal.science/hal-05027238 [13]
Editors:
Oswin Aichholzer and Haitao Wang

1 Introduction

Graphs embedded on surfaces exhibit many significant structural properties. In the planar case, one of the most elegant characterizations is provided by Schnyder woods, a profound combinatorial structure introduced by W. Schnyder to define a new planarity criterion [31] and to design an efficient and elegant straight-line grid drawing algorithm [32]. Schnyder woods lead to a global characterization of planar graphs in terms of spanning trees and have inspired numerous generalizations and applications in various fields, including graph drawing [17, 18, 19], graph encoding [10, 11], enumerative combinatorics [2, 20], random sampling [29] and plane spanners [4].

The first generalizations [5, 14, 15] of Schnyder woods to non planar graphs were motivated by applications involving graph encoding problems, aiming to preserve their global spanning properties. Since then the study of Schnyder woods and related structures for graphs embedded on toroidal [3, 6, 12, 16, 21, 22, 27] and higher genus [1, 14, 15, 25, 33] surfaces have attracted a lot of attention. This is particularly true in the toroidal case, for which some elegant generalizations lead to applications ranging from graph drawing [22] to bijective encodings [3, 16, 21].

Toroidal Schnyder woods

A key property of toroidal triangulations is that the number of edges is exactly three times the number of vertices, by Euler’s formula. Gonçalves and Lévêque  [22] show how to endow a simple toroidal triangulation with an edge orientation and coloring with three colors 111In our pictures we use red for color 0, blue for color 1 and black for color 2. {0,1,2} where every vertex has outgoing degree 3 and satisfies a local Schnyder rule (as in the plane). It turns out that the i-cycles 222An i-cycle, for i{0,1,2}, is a mono-chromatic cycle whose edges are of color i. are directed, non-contractible and homotopic, and they do not intersect each other. Moreover, any toroidal triangulation admits a crossing Schnyder wood for which every pair of i-cycles and j-cycles (for ij) are crossing, which is particularly relevant for graph drawing applications. Indeed, the crossing condition is crucial for obtaining a periodic straight-line drawing [22] of toroidal maps on a grid of polynomial resolution, which extends the face-counting approach of planar Schnyder drawings [32, 18, 19].

1.1 Contribution

Addressing two questions left open in [22, 27], we design and implement a simple algorithm for computing (crossing) toroidal Schnyder woods: our approach is based on the vertex shelling paradigm involving canonical orderings 333In the planar case there exists a linear time algorithm for computing Schnyder woods via canonical orderings [8, 26] performing vertex shellings: the fact that such an algorithm also exists in the toroidal case has been left as an open question in [27]. and allows us to get mono-chromatic components which are connected, for at least two of the three colors. Our main result is stated below:

Theorem 1.

Given a simple toroidal triangulation 𝒯 it is possible to compute in linear time a crossing Schnyder wood of 𝒯 such that the mono-chromatic components of color 0 and of color 1 are connected.

As far as we know, our approach leads to the first implementation for computing toroidal Schnyder woods: previous solutions [22, 27] rely on a very involved case analysis or on unpublished results (requiring more than linear time) and, to our knowledge, they have not been implemented, even in the triangulated case (see Section 1.2 for a more detailed discussion), nor do they provide a guarantee on connectness of any mono-chromatic component.

We also conduct experiments providing an empirical answer to conjectures stated in [1, 22] regarding the existence of Schnyder woods for higher genus surfaces.

1.2 Related works: computing crossing toroidal Schnyder woods

Figure 1: A toroidal simple triangulation of size 9, endowed with three different Schnyder woods.
Via edge contractions.

One can compute crossing Schnyder woods for essentially 3-connected toroidal maps making use of the approach based on edge contractions [22]. The main idea is to perform a sequence of edge contractions until we are left with few vertices: the Schnyder wood can be recovered by assigning colors after the edge expansions (in reverse order). The validity of this approach relies on a very involved case analysis [22, 27]: this results in a polynomial time algorithm, but it is not known how to get linear time while preserving the crossing condition, which is a non-local property.

Via three paths meeting at a vertex.

For simple triangulations another way [22] to compute toroidal Schnyder consists in cutting a toroidal triangulation 𝒯 along three non-contractible (and non-homotopic) cycles Γ0,Γ1,Γ2 whose intersection is a common single vertex v. As result one obtains a partition of 𝒯 into two quasi-triangulations G1 and G2, which are internally 3-connected and can be endowed with a planar Schnyder wood (refer to [18, 19]). Then computing Schnyder woods for G1 and G2 and gluing them yields a crossing Schnyder wood for 𝒯 (see Fig. 2). The Schnyder wood satisfies the following 3-cycles property: there are (at least) three mono-chromatic cycles, one for each color, crossing at a single vertex and which are disjoint elsewhere. It is worth noting that the construction described in [22] does not guarantee that the mono-chromatic components are connected (the Schnyder wood could have several disjoint mono-chromatic i-cycles). Unfortunately, as pointed out in [27], it is not clear how to get a linear-time algorithm: the pre-processing phase relies on an unpublished result by Fijavz (the computation of three non-homotopic and non-contractible cycles whose intersection is a common vertex) which involves a result on disjoint paths in [30].

Figure 2: Computing a toroidal Schnyder wood via 3 non-contractible cycles crossing at v1.
Via reversal of oriented cycles.

In the triangulated case, the basic approach using edge contraction (without maintaining crossing property) leads to an algorithm for computing balanced toroidal Schnyder woods in linear time (Thm 10 in [27]). As shown in [27] (Thm 11) it is possible to turn a balanced Schnyder wood into a half-crossing one by performing the reversal of oriented cycles. Then one can perform another cycle reversal phase in order to make the Schnyder wood crossing (Thm 13 in [27]). All these phases can be executed in linear time, but we are not aware of any existing implementation. 444 For a fast implementation one needs to efficiently process contractible edges and to maintain the map data structure under local updates: this is not trivial in practice, even in the (planar) triangulated case.

2 Preliminaries

Toroidal and cylindric triangulations

In this work we deal with toroidal triangulations which are maps on the torus with only triangular faces (such maps are simple if they have no loops nor multiple edges). We will denote by n the total number of vertices. In our drawings we will represent such maps in the planar model of the flat torus. We also consider (simple) cylindric triangulations, which are planar maps with a marked inner face of simple contour denoted Cin (the outer face contour being denoted Cext) such that all other inner faces have degree 3. G is non-degenerate if Cin and Cext are disjoint (not sharing any vertex). We will denote by n the number of vertices of GCin, and will also use notation iG for Cin and eG for Cext. We will draw cylindric triangulations either in the annular representation or in the flat model of the cylinder.

Toroidal Schnyder woods (for triangulations)

Definition 2 ([22, 27]).

Let 𝒯 be a toroidal triangulation. A Schnyder wood of 𝒯 is an orientation and labeling, with colors in {0,1,2} of the edges of 𝒯 so as to satisfy the following local Schnyder condition (for all vertices): for each vertex v, the edges incident to v in counterclockwise (ccw) order are: one outgoing edge colored 2, zero or more incoming edges colored 1, one outgoing edge colored 0, zero or more incoming edges colored 2, one outgoing edge colored 1, and zero or more incoming edges colored 0.

A Schnyder wood is half-crossing if there are two distinct colors i,j{0,1,2} such that there is an i-cycle crossing a j-cycle (in which case all i-cycles cross all j-cycles). A Schnyder wood is crossing if for each pair of distinct colors i,j{0,1,2} there is an i-cycle crossing a j-cycle).

The pictures in Fig. 1 show a toroidal triangulation endowed with three Schnyder woods. Definition 2 is particularly elegant since it preserves the symmetry of the three colors, but in general the global spanning property of Schnyder woods is lost: the graph induced by any given color could consist of several disjoint connected components, each component being made of a cycle with trees attached to it (as every vertex has outdegree 1 in a given color).

Canonical orderings for cylindric triangulations

As shown in [12], it is possible to extend the notion of canonical orderings [23] to the cylindric case as follows. A cylindric canonical ordering is an ordering π={v1,vn} of the vertices of GCin such that, for every k0, the map Gk induced by Cin{v1,,vk} is a cylindric (possibly degenerate) triangulation, and such that, for every k1, the vertex vk belongs to the outer boundary cycle of Gk, denoted eGk, and its neighbors in Gk1 are consecutive boundary vertices on eGk1. Such an ordering can be computed in linear time via an incremental vertex shelling procedure, where vertices together with their incident edges and faces are removed in reverse order from the boundary eGk (nk1). In order to be removed, a vertex veGkCin must be free: v cannot be incident to a chord of eGk. The existence of free vertices on eGk relies on an inductive argument similar to the planar case (we refer to [12] for more details).

3 From cylindric Schnyder woods to toroidal Schnyder woods

Figure 3: Left: coloring rule associated to the 𝚛𝚎𝚖𝚘𝚟𝚎 operator. Center: local conditions for vertices on Cin and Cext. Right: a cylindric Schnyder wood of a cylindric triangulation.

For the simple triangulated case, we show how to derive toroidal Schnyder woods from the notion of cylindric canonical orderings [12]. We first planarize the input triangulation 𝒯 cutting along a chordless non-contractible cycle Γ, getting a non-degenerate cylindric triangulation G (a non-contractible cycle can be computed in linear time [9]).

Algorithm 1 Computation of a toroidal Schnyder wood via a cylindric canonical ordering.

Then we compute a cylindric canonical ordering of G and we proceed as in the planar case by defining a vertex removal operation: at a given shelling step k, 𝚛𝚎𝚖𝚘𝚟𝚎(v) updates the outer boundary of Gk by removing vertex v while assigning colors and orientations to edges incident to v in Gk, as illustrated in the left picture of Fig. 3: the left and right edges (v,vleft) and (v,vright) become outgoing from v (of color 0 and 1), and all remaining edges get oriented toward v (of color 2). This shelling procedure is described in detail in [12], the pseudocode is provided in Algorithm 1. As a result we get a cylindric Schnyder wood S(G), i.e., a coloring (in 0, 1 or 2) and an orientation for all edges in GCin satisfying the three conditions below (depicted in Fig. 3):

  • inner vertices satisfy the local Schnyder condition as in Definition 2.

  • local condition for Cext: each vertex vCext has exactly two outgoing edges (of color 0 and 1). When traversing the neighbors of vCext in ccw order around v we encounter: a (possibly empty) set of incoming edges (of color 1), an outgoing edge of color 0, a (possibly empty) set of incoming edges (of color 2), an outgoing edge of color 1, and the remaining edges (if any) are incoming of color 0.

  • local condition for Cin: each vertex vCin has one outgoing incident edge e of color 2; all remaining incident edges are incoming at v, being of color 1 if they are at the left of e, and of color 0 otherwise.

Figure 4: Illustration of Algorithm 1. The toroidal triangulation 𝒯 is cut along a non-contractible and chordless cycle Γ. The resulting cylindric triangulation G is endowed with a cylindric canonical ordering (vertices are labeled accordingly), yielding a cylindric Schnyder wood S(G): after gluing Cin and Cext we get a toroidal Schnyder wood SΓ(𝒯).

After identification of the cycles Cext and Cin we get back the toroidal triangulation 𝒯 endowed with a toroidal Schnyder wood SΓ(𝒯) satisfying the additional properties expressed in the Lemma below (the proof is provided in [13]).

Lemma 3.

Let 𝒯 be a simple toroidal triangulation and Γ a chordless non-contractible cycle. The Schnyder woods S(G) and SΓ(𝒯) computed as above satisfy (see Fig. 4):

  1. 1.

    in S(G) the edges of color 2 define a spanning forest of GCext, whose (directed) trees are rooted on a vertex of Cext; Similarly, the edges of color 0 (resp. 1) define a spanning forest of GCin, whose (directed) trees are rooted on a vertex of Cin;

  2. 2.

    in SΓ(𝒯) all i-cycles cross the cycle Γ and are not homotopic to Γ (for i{0,1,2});

  3. 3.

    if SΓ(𝒯) is half-crossing then the 0-cycles and 1-cycles are pairwise crossing.

Balanced Schnyder woods

As illustrated in Fig. 4 the Schnyder woods computed by Algoritm 1 may fail to be crossing or half-crossing (we will remedy this in the next sections), but as we show here they satisfy the important property of being balanced. A Schnyder wood is called balanced if every non-contractible (undirected) cycle C has the same number of outgoing edges on each side. It is actually sufficient (Lemma 34 in [27]) to have the condition satisfied by two non-contractible cycles that are not homotopic (see [13] for the proof of the statement below).

Corollary 4.

The Schnyder woods computed by Algorithm 1 are balanced.

Balanced Schnyder woods are very instrumental in the bijective encoding [16, 21] of simple toroidal triangulations by decorated unicellular maps (which yields an asymptotically optimal encoding procedure). Indeed the first step of the construction is to compute the so-called minimal balanced Schnyder wood of the simple toroidal triangulation 𝒯 to be encoded. It turns out that this can easily be done in linear time (by an adaptation of the planar-case arguments given in [7], see also [24, Lemma 3.2]) starting from an arbitrary balanced Schnyder wood of 𝒯, as provided by Algorithm 1.

3.1 Constrained cylindric Schnyder woods

Assume we are given a cylindric triangulation G with two boundary cycles Cin and Cext (with no chord at Cin) and a chordless path P={u0,u1,ut1} originating from vertex u0Cin and ending at ut1Cext, such that P intersects the boundary cycles of G only at u0 and ut1. We explain here how to adapt the shelling procedure so as to obtain a cylindric Schnyder wood of G such that P is a directed path in color 2.

Definition 5.

Let P={u0,u1,ut1} be a path satisfying the conditions above. A cylindric Schnyder wood of G is called P-constrained if every edge (ui,ui+1)P is oriented toward ui+1 and has color 2.

We say that a boundary vertex veGkP (for k1) is strongly free (with respect to P) if v is free and not adjacent to any vertex of Pk, where Pk=P(GkeGk) is the restriction of P to the interior of Gk. The vertex uPeGk is strongly free if it does not have any incident chord at eGk. We modify the shelling procedure described in the previous section by removing at each shelling step only vertices on eGk which are strongly free, as illustrated in Fig. 5 (see [13] for the proof of the Lemma below).

Lemma 6.

Given a cylindric triangulation G and a path P defined as above, the adapted shelling procedure outputs a P-constrained Schnyder wood of G, and runs in linear time.

Figure 5: Computation of a P-constrained Schnyder wood (Lemma 6): only vertices which are strongly free (with respect to the path P={u0,,ut1}) can be removed at each step.

4 Rivers

Figure 6: (Left) annular representation of a river R with a chordless path P crossing only once its boundary cycles. Right: only non-trivial chords are drawn, as dotted arcs.

We consider here a particular type of “thin” cylindric triangulations called rivers, for which we compute a so-called rigthmost (resp. leftmost) P-constrained Schnyder wood. Rivers, and properties of their rightmost (resp. leftmost) Schnyder wood, are key to obtain the half-crossing (resp. crossing) property, as presented in Section 5 (resp. Section 6).

4.1 Definition of a river

Let us define a river R as a non-degenerate simple cylindric triangulation whose outer and inner boundary cycles, denoted iR={x0,x1,,xr1} and eR={z0,z1,z2,,zs1}, satisfy the following conditions: iR and eR are chordless cycles such that every vertex zeR has an incident edge (z,x¯), where x¯iR, and every vertex xiR has an incident edge (x,z¯), where z¯eR (such edges are called non-trivial chords of R).

4.2 Right-most (left-most) cylindric canonical ordering of a river

Let us assume that R is provided with a chordless path P={u0,,ut1} intersecting its boundaries only once, at u0=x0 and ut1=z0 (refer to Fig. 6). Observe that the non-trivial chords (u,y), where u is either u0 or ut1 and y(iReR)P, can be partitioned into two (possibly empty) sets, depending on whether (u,y) is at the right or at the left of the path P. We classify the vertex ut1 according to four types (see Fig. 7):

(A):

ut1 has chords both at the left and at the right of P;

(B):

ut1 has no chords at the left nor at the right of P, so that (u0,ut1) is the only chord at ut1;

(C1):

ut1 has chords at the right of P, but not at the left of P;

(C2):

ut1 has chords at the left of P, but not at the right of P.

Let us now define the right-most traversal of R with respect to P (yielding a P-constrained cylindric Schnyder wood) as given by Algorithm 2 below (refer also to Fig. 7 for an illustration):

Algorithm 2 Right-most traversal of a river.
Figure 7: Illustration of Algorithm 2 and Lemma 7: we distinguish four cases for the right-most traversal of a river R. Left pictures: removal of the first vertex on eR. Center pictures: paths of color 1 obtained via a right-most traversal of R. Right pictures: complete execution of Algorithm 2 on four examples (vertex labels are assigned according to the cylindric canonical ordering).

One crucial property is that, after computing a P-constrained Schnyder wood SP(R) according to a right-most traversal, if ut1 is of type (A), (B) or (C1) then every vertex z on eR lies on a path of color 1 ending at P. If ut1 is of type (C2) this property may fail, but the right-most traversal leads to the existence of a ccw-oriented contractible cycle enclosed in R. These properties are a consequence of the statement below (see [13] for the proof).

Lemma 7.

Let us consider a river R and a chordless path P as defined above. Let SP(R) be the P-constrained cylindric Schnyder wood computed by Algorithm 2. Then we have:

  1. 1.

    if ut1 is of type (A), then for every vertex zieR with 1<i<s, the path of color 1 starting from zi passes by ut1;

  2. 2.

    if ut1 is of type (B) or (C1), then for every vertex zeR, the path of color 1 starting from z ends at u0;

  3. 3.

    if ut1 is of type (C2): then all vertices zi are lying on a path of color 1 ending either at P or at xc. Moreover, there exists at least one vertex zi lying on a ccw-oriented cycle (enclosed in R) defined by (xc,ut1,zs1,,zi).

Left-most traversal.

One can define left-most traversals proceeding in a symmetric way with respect to Algorithm 2: at the beginning we set v=zs1 if ut1 is of type (A) and v=z0 otherwise; xc is set to be the extremity of the right-most chord of v; finally, at each shelling step one removes the strongly free vertex which is closest at the left of xc.

Similarly to the properties stated in Lemma 7 one can show that if ut1 is of type (A), (B) or (C2) then each vertex z on eR lies on a path of color 0 ending at P.

5 Algorithm for half-crossing toroidal Schnyder woods

We describe in this section an algorithm to compute a half-crossing toroidal Schnyder wood for any simple toroidal triangulation, with the further property that the mono-chromatic component in color 0 or in color 1 is connected.

5.1 Existence of a river in cylindric triangulations

A key ingredient of the algorithm is the computation of a river in the cylindric triangulation that is obtained by cutting along a chordless non-contractible cycle.

Lemma 8.

Given a non-degenerate cylindric triangulation G with no chord at Cin or Cext, it is possible to compute in linear time a river R contained in G, whose inner and outer boundaries are homotopic to iG (the proof is provided in [13]).

5.2 Algorithm

Let 𝒯 be a simple toroidal triangulation. We now describe the algorithm computing a half-crossing Schnyder woods of 𝒯; the complete pseudo-code is provided in Algorithm 3, see also Figure 8 for an illustration on an example. After cutting 𝒯 along a non-contractible and chordless cycle Γ (as in Section 3), we obtain a non-degenerate cylindric triangulation G, and compute a river R in G (Lemma 8). As a result, the faces of G are partitioned into three regions: Gtop (a possibly degenerate cylindric triangulation), the river R, and Gbottom (a possibly degenerate cylindric triangulation).

Algorithm 3 Half-crossing Schnyder woods (with a connected mono-chromatic component).

The algorithm relies on two passes (the second one not always necessary). In the first pass, we let P be an arbitrary non-trivial chordal edge {x,z} for the river R. If z is not of type C2, we perform a rightmost traversal of R, otherwise a leftmost traversal. We also compute in an independent way two (arbitrary) Schnyder woods of Gtop and Gbottom: after boundary identifications we obtain a Schnyder wood S(T) of 𝒯. It follows from Lemma 7 (see the proof of Proposition 9) that if z is not (resp. is) of type C2, then there is a single monochromatic cycle C of color 1 (resp. color 0), and moreover it winds only once around Γ (it may share edges with Γ but reaches it only once from the left). If C crosses any cycle of color 2, then we output S(𝒯). Otherwise we need a second pass. Let γ2 be an arbitrary 2-cycle. Note that γ2 winds once around Γ since it is homotopic to C. Due to edge colors and local Schnyder conditions, it intersects γ2 at a single vertex (as opposed to C it can not share edges with Γ). Hence, if we cut γ2 along Γ, we obtain a path P2G which is chordless and meets the boundary cycles only at its extremities. We can then adjust the Schnyder wood in R as follows: if the upper end of P2 is not of type C2, we perform a rightmost traversal of R with respect to P2, otherwise a leftmost traversal. This updates S(𝒯) into a half-crossing Schnyder wood, such that in the first (resp. second) case there is a single cycle of color 1 (resp. 0) and it the cycle γ2 of color 2 (as expressed by Proposition 9).

Figure 8: Execution of Algorithm 3 on a small example.
Proposition 9.

Given a simple toroidal triangulation 𝒯, Algorithm 3 computes in linear time a half-crossing Schnyder wood of 𝒯 via vertex shellings. More precisely, there is r{0,1} such that the edges of color r define a single connected component, and the unique r-cycle crosses the 2-cycles (see [13] for the proof).

6 Algorithm for crossing toroidal Schnyder woods

Building on the ideas of Section 5, we give in this section a linear-time algorithm for computing a crossing toroidal Schnyder wood, with the additional property that the mono-chromatic components in color 0 and in color 1 are connected, as stated in Theorem 1.

6.1 Existence of two non-overlapping rivers in cylindric triangulations

Compared to the procedure for half-crossing Schnyder woods, the algorithm for crossing Schnyder woods now requires the computation of two parallel and non-overlapping rivers Rt and Rb in the cylindric triangulation obtained after cutting along a non-contractible and chordless cycle. The existence of such a pair of rivers is guaranteed by the next statement.

Lemma 10.

Given a non-degenerate cylindric triangulation G with no chord at Cin or Cext, nor between Cin and Cext, it is possible in linear time to compute a pair of non-overlapping rivers Rt (top river) and Rb (bottom river) contained in G, whose inner and outer boundaries are homotopic to iG (see [13] for the proof).

Figure 9: Illustration of the algorithm of Section 6.2 for computing crossing Schnyder woods. At the end of the first phase the Schnyder wood is half-crossing but not crossing (the 1-cycle is parallel to the 2-cycles). But the bottom river contains a ccw-oriented contractible cycle C (enclosing the shaded green region): the reversal of C leads to a 1-cycle parallel to Γ and thus crossing the 2-cycles, making the Schnyder wood crossing. The edges of color 0 and 1 define a connected component.

6.2 Algorithm

Given a toroidal simple triangulation 𝒯, as before the first step consists in cutting 𝒯 along a chordless non-contractible cycle Γ, yielding a cylindric triangulation G. Since Γ is chordless, the triangulation G has no chord at Cin or at Cext, nor chords from Cin to Cext (such an edge would correspond to a chord of Γ starting at one side and ending at the other side). Hence we can apply Lemma 10, which yields a decomposition of G into five components (from top to bottom): a top cylindric triangulation Gtop, the river Rt, a middle cylindric triangulation Gmiddle, the river Rb, and a bottom cylindric triangulation Gbottom. Note that Gtop, Gmiddle and Gbottom are possibly degenerate. We then follow the pipeline used in Algorithm 3: one river (resp. the other river) is used to guarantee that color 0 (resp. color 1) is crossing color 2, and that the mono-chromatic component is connected.

Precisely, in a first pass, we choose a chord et in Rt that is the leftmost chord at its top vertex, and let Pt=et be the path according to which we perform a rightmost traversal of Rt (note that (Rt,Pt) is of type B or C1). Similarly, we choose a chord eb in Rb that is the rightmost chord at its top vertex, and we let Pb=eb be the path according to which we perform a leftmost traversal of Rb (note that (Rb,Pb) is of type B or C2). We also compute an arbitrary cylindric Schnyder wood for each of the three components Gtop, Gmiddle, and Gbottom. Then we glue together the Schnyder woods for the five components. Identifying Cin with Cext we obtain a toroidal Schnyder wood of 𝒯. From Lemma 7 and arguments already used in Section 5, the mono-chromatic component of color 1 (resp. color 0) is connected, thanks to the top-river (resp. bottom river). If the Schnyder wood is crossing we return it as the output.

If it is not crossing we need a second pass, similarly to Section 5. By the 3rd item in Lemma 3 we must have either color 1 parallel to color 2, or color 0 parallel to color 2. In both cases, due to the rivers, the non-contractible cycles of color 2 must wind only once (they cross Γ at a single vertex), so in G such a cycle γ2 gives a path P2 from Cin to Cext. Keeping the Schnyder woods for Gtop, Gmiddle, and Gbottom unchanged, we need a second pass to adjust those for Rt and Rb in order to obtain the crossing property. Precisely, let Pt (resp. Pb) be the restriction of P2 to Rt (resp. Rb). If (Rt,Pt) and (Rb,Pb) are not both of type C2 or are not both of type C1, then we can choose one of them, denote it by (R,P), not to be of type C2, and the other one, denote it by (R′′,P′′), not to be of type C1. Then we perform a right-most traversal for (R,P), and a left-most traversal for (R′′,P′′). After these updates on the Schnyder woods for the two rivers, and by the arguments of Section 5, the toroidal Schnyder wood of 𝒯 now has the property that cycles of color 1 (resp. 0) cross cycles of color 2 thanks to R (resp. R′′), and that the monochromatic component of color 1 (resp. 0) are still connected.

It remains to treat the case where at the second pass we have (Rt,Pt) and (Rb,Pb) both of type C1 or both of type C2. Let us assume they are both of type C2. Then we adjust the Schnyder woods in Rt and Rb by performing the leftmost Pt-constrained traversal of Rt, and the rightmost Pb-constrained traversal of Rb. At this point we have the crossing of color 0 with color 2, thanks to the top river and the 2nd item in Lemma 3. In color 1 the crossing property may however fail. But we can take advantage of the 3rd item in Lemma 7, which guarantees the existence of a specific directed cycle C in Rb. Reversing this cycle makes eRb a cycle in color 1 that is parallel to Γ.

Claim 11.

If in the second phase the rivers (Rt,Pt) and (Rb,Pb) are of type C2, then after reversing the cycle C, the toroidal Schnyder wood of 𝒯 is crossing, and the mono-chromatic components of color 0 and of color 1 are connected (see [13] for the proof).

The case where (Rt,Pt) and (Rb,Pb) are both of type C1 can be handled very similarly, by performing the rightmost Pt-constrained traversal of Rt, the leftmost Pb-constrained traversal of Rb, and reversing the specific directed cycle in Rb that is guaranteed by the mirror-statement of the 3rd item in Lemma 3.

This concludes the proof of our main result, as stated in Theorem 1.

 Remark 12.

An alternative to our algorithm is given by Theorem 13 in [27], which allows to obtain a crossing Schnyder wood from a half-crossing one (such as computed by Proposition 9), however without guarantee of connectedness for the mono-chromatic components. It relies on the repeated reversal of carefully chosen directed cycles. As a comparison, our algorithm needs to reverse at most one directed cycle, and it is easy to implement in linear time (even though the overall proof of correctness is a bit involved).

7 Experimental results

7.1 Implementation and experiments

We have written Java implementations 555 Datasets, runnable programs and source code (pure Java) are made available at:
www.lix.polytechnique.fr/amturing/software.html.
of our algorithms and performed tests on genus 1 triangle meshes of various sizes (mostly taken from Thingi10K repository). Our algorithms for computing toroidal Schnyder woods are significantly simpler to analyze (in particular regarding the linear time complexity) and implement than previous solutions [22]. As confirmed by the runtime plots of Fig. 10, the approach based on vertex shelling leads to a very fast implementation: we can process more than 1M vertices per second (our experiments are run on a single core of a core i7-9700 cpu, allocating 8GB memory for the JVM, running Java 1.8 under Ubuntu Linux).

Refer to caption
Figure 10: (Left) runtime performances of Algorithm 1: average timings (computed over several runs) are expressed in seconds as a function of the size (millions of vertices). (Right) examples of genus 1 triangle meshes endowed with a toroidal Schnyder wood.

7.2 Conjectures on higher genus Schnyder woods: empirical results

We have conducted experiments providing an empirical confirmation of three conjectures involving Schnyder woods for triangulations in genus 1 and genus 2. We wrote a Java program that exhaustively generates all possible 3-orientations (see definition below in genus more than 1) and Schnyder woods for triangulations of genus g2. Our generator is fast enough to process all tiny triangulations (generated using surftri [34], see Table 1) in a reasonable amount of time, allowing us to compute some statistics and test some conjectures.

Table 1: Simple triangulations of genus 1 and 2 (enumerated using surftri [34]).
g=1 irreducible triang. all triangulations g=2 irreducible triang. all triangulations
n=7 1 1 n=7 - -
n=8 4 7 n=8 - -
n=9 15 112 n=9 - -
n=10 1 2109 n=10 865 865
n=11 - 37867 n=11 26276 113506

Connectedness of the three mono-chromatic graphs in genus 𝟏

We have checked that all toroidal simple triangulations of size at most 11 admit a Schnyder wood for which the edges of the same color define a connected graph (having thus 3 mono-chromatic cycles, one for each color), providing an empirical answer to an open question stated in [22] (our algorithm of Section 6 guarantees a positive answer in two of the three colors). We also consider a second open question asked in [22] concerning the existence of crossing Schnyder woods satisfying a stronger requirement (referred to as connected 3-cycles property): the Schnyder wood is crossing, the three mono-chomatic components consist of a single connected component and the intersection of the three non trivial cycles is a single vertex 666Observe that Thm. 9 in [22] guarantees the existence of three edge-disjoint mono-chromatic cycles crossing at a single vertex, but each mono-chromatic graph may consist of several disjoint components.. Our experiments provide an empirical positive answer to this question (for n11): we report in Figure 11 some statistics and the list of irreducible 777A triangulation is irreducible if no edge can be contracted without producing multiple edges. triangulations of genus 1, each endowed with a crossing Schnyder wood satisfying this stronger condition.

Figure 11: List of genus 1 irreducible triangulations (the embeddings are provided in [28]). Each triangulation is endowed with a Schnyder wood satisfying the connected 3-cycles property computed by our generator. The bottom plots report some statistics computed by our generator.

Existence of Schnyder woods in genus 𝟐

Figure 12: Planar layout of a genus 2 triangulation: it is endowed with two Schnyder woods satisfying the multiple Schnyder condition computed by our generator. In the left case vertex a has outgoing degree 9, while in the right one vertices j and k have outgoing degree 6. This triangulation admits 16.421.904 3-orientations and 509844 valid Schnyder woods.

For a simple triangulation of genus g1, a 3-orientation is an orientation such that for every vertex v the out-degree is divisible by 3 and at least 3 (no sinks). In genus g2 some vertices must have degree more than 3, since v(deg(v)3)=6g6 according to the Euler relation. It is shown in [1] that any simple triangulation of genus g2 admits a 3-orientation. The following natural open question (asked in [27]) then arises: for every simple triangulation of genus g2, is it always possible to find a 3-orientation for which the edges can be colored so as to satisfy a multiple local Schnyder condition at every vertex (as depicted in Fig. 12)? In his PhD dissertation J. Suagee [33] shows that the answer is positive for every simple triangulation of genus g2 having edge-width at least 40(2g1). We have checked that the answer is actually positive for every simple triangulations of genus 2 and n11, suggesting that the assumption on the large edge-width is maybe unnecessary.

8 Concluding remarks

We expect that the construction of Section 3 can be extended to 3-connected toroidal maps using the notion of cylindric toroidal canonical ordering defined for the 3-connected case in [12], leading to a fast linear-time algorithm. As in the triangulated case, the obtained Schnyder woods should have the property of being balanced, which is instrumental in the bijective encoding of 3-connected toroidal maps [3] (indeed it relies on the computation of the minimal balanced Schnyder wood of the map, which can easily be obtained in linear time starting from an arbitrary balanced Schnyder wood).

References

  • [1] Boris Albar, Daniel Gonçalves, and Kolja Knauer. Orienting triangulations. J. Graph Theory, 83(4):392–405, 2016. doi:10.1002/jgt.22005.
  • [2] Olivier Bernardi and Nicolas Bonichon. Catalan’s intervals and realizers of triangulations. Journal of Combinatorial Theory, Series A, 116(1):55–75, 2009. 22 pages. URL: https://hal.archives-ouvertes.fr/hal-00143870.
  • [3] Nicolas Bonichon, Éric Fusy, and Benjamin Lévêque. A bijection for essentially 3-connected toroidal maps. Eur. J. Comb., 95:103290, 2021. doi:10.1016/J.EJC.2020.103290.
  • [4] Nicolas Bonichon, Cyril Gavoille, Nicolas Hanusse, and Ljubomir Perkovic. Plane spanners of maximum degree six. In Automata, Languages and Programming, 37th International Colloquium, ICALP 2010, pages 19–30, 2010. doi:10.1007/978-3-642-14165-2_3.
  • [5] Nicolas Bonichon, Cyril Gavoille, and Arnaud Labourel. Edge partition of toroidal graphs into forests in linear time. In ICGT, volume 22, pages 421–425, 2005. doi:10.1016/J.ENDM.2005.06.065.
  • [6] Nicolas Bonichon and Benjamin Lévêque. A bijection for essentially 4-connected toroidal triangulations. Electron. J. Comb., 26(1):1, 2019. doi:10.37236/7897.
  • [7] U. Brandes and D. Wagner. A linear time algorithm for the arc disjoint menger problem in planar directed graphs. Algorithmica, 28(1):16–36, 2000. doi:10.1007/s004530010029.
  • [8] Enno Brehm. 3-orientations and Schnyder 3-tree-decompositions. Master’s Thesis, FB Mathematik und Informatik, Freie Universität Berlin, 2000.
  • [9] Sergio Cabello, Éric Colin de Verdière, and Francis Lazarus. Finding cycles with topological properties in embedded graphs. SIAM J. Discret. Math., 25(4):1600–1614, 2011. doi:10.1137/100810794.
  • [10] Luca Castelli Aleardi and Olivier Devillers. Array-based compact data structures for triangulations: Practical solutions with theoretical guarantees. JoCG, 9(1):247–289, 2018. doi:10.20382/jocg.v9i1a8.
  • [11] Luca Castelli Aleardi and Olivier Devillers. SCARST: Schnyder compact and regularity sensitive triangulation data structure. In 40th Intern. Symp. on Computational Geometry (SoCG 2024), volume 293 of LIPIcs, pages 32:1–32:19, 2024. doi:10.4230/LIPICS.SOCG.2024.32.
  • [12] Luca Castelli Aleardi, Olivier Devillers, and Éric Fusy. Canonical ordering for graphs on the cylinder, with applications to periodic straight-line drawings on the flat cyclinder and torus. J. Comput. Geom., 9(1):391–429, 2018. doi:10.20382/jocg.v9i1a14.
  • [13] Luca Castelli Aleardi, Éric Fusy, Jyh-Chwen Ko, and Razvan-Stefan Puscasu. Computation of toroidal schnyder woods made simple and fast: from theory to practice. preprint, 2025. URL: https://hal.science/hal-05027238.
  • [14] Luca Castelli Aleardi, Éric Fusy, and Thomas Lewiner. Schnyder woods for higher genus triangulated surfaces. In Proc. of the 24th ACM Symp. on Comput. Geom. (SoCG), pages 311–319. ACM, 2008. doi:10.1145/1377676.1377730.
  • [15] Luca Castelli Aleardi, Éric Fusy, and Thomas Lewiner. Schnyder woods for higher genus triangulated surfaces, with applications to encoding. Discrete & Computational Geometry, 42(3):489–516, 2009. doi:10.1007/s00454-009-9169-z.
  • [16] Vincent Despré, Daniel Gonçalves, and Benjamin Lévêque. Encoding toroidal triangulations. Discrete & Computational Geometry, 57(3):507–544, 2017. doi:10.1007/s00454-016-9832-0.
  • [17] Raghavan Dhandapani. Greedy drawings of triangulations. Discrete & Computational Geometry, 43(2):375–392, 2010. doi:10.1007/s00454-009-9235-6.
  • [18] Stefan Felsner. Convex drawings of planar graphs and the order dimension of 3-polytopes. Order, 18(1):19–37, 2001. doi:10.1023/A:1010604726900.
  • [19] Stefan Felsner. Geodesic embeddings and planar graphs. Order, 20(2):135–150, 2003. doi:10.1023/B:ORDE.0000009251.68514.8b.
  • [20] Stefan Felsner and Florian Zickfeld. On the number of planar orientations with prescribed degrees. Electr. J. Comb., 15(1), 2008. URL: http://www.combinatorics.org/Volume_15/Abstracts/v15i1r77.html.
  • [21] Éric Fusy and Benjamin Lévêque. Orientations and bijections for toroidal maps with prescribed face-degrees and essential girth. J. Comb. Theory A, 175:105270, 2020. doi:10.1016/J.JCTA.2020.105270.
  • [22] Daniel Gonçalves and Benjamin Lévêque. Toroidal maps: Schnyder woods, orthogonal surfaces and straight-line representations. Discrete & Computational Geometry, 51(1):67–131, 2014. doi:10.1007/s00454-013-9552-7.
  • [23] Goos Kant. Drawing planar graphs using the canonical ordering. Algorithmica, 16(1):4–32, 1996. doi:10.1007/BF02086606.
  • [24] Samir Khuller, Joseph Naor, and Philip N. Klein. The lattice structure of flow in planar graphs. SIAM J. Discret. Math., 6(3):477–490, 1993. doi:10.1137/0406038.
  • [25] Kolja Knauer, Daniel Gonçalves, and Benjamin Lévêque. On the structure of Schnyder woods on orientable surfaces. J. Comput. Geom., 10(1):127–163, 2019. doi:10.20382/jocg.v10i1a5.
  • [26] Stephen G. Kobourov. Canonical orders and schnyder realizers. In Encyclopedia of Algorithms, pages 277–283. Springer, 2016. doi:10.1007/978-1-4939-2864-4_650.
  • [27] Benjamin Lévêque. Generalization of Schnyder woods to orientable surfaces and applications. Hdr thesis, Université Grenoble Alpes, 2016. URL: https://tel.archives-ouvertes.fr/tel-01488943.
  • [28] Bojan Mohar and Carsten Thomassen. Graphs on Surfaces. Johns Hopkins, 2001.
  • [29] Dominique Poulalhon and Gilles Schaeffer. Optimal coding and sampling of triangulations. Algorithmica, 46(3-4):505–527, 2006. doi:10.1007/s00453-006-0114-8.
  • [30] Neil Robertson and Paul D. Seymour. Graph minors. VI. disjoint paths across a disc. J. Comb. Theory, Ser. B, 41(1):115–138, 1986. doi:10.1016/0095-8956(86)90031-6.
  • [31] Walter Schnyder. Planar graphs and poset dimension. Order, pages 323–343, 1989.
  • [32] Walter Schnyder. Embedding planar graphs on the grid. In Proceedings of the Annual ACM-SIAM Symposium on Discrete Algorithms, volume 90, pages 138–148, 1990. URL: http://departamento.us.es/dma1euita/PAIX/Referencias/schnyder.pdf.
  • [33] Jason Suagee. Existence and Construction of Schnyder Orientations over a Large Class of Higher Genus Surface Triangulations. PhD thesis, George Washington University, 2021.
  • [34] Thom Sulanke. Generating maps on surfaces. Discret. Comput. Geom., 57(2):335–356, 2017. doi:10.1007/s00454-016-9853-8.