Journal of Graph Algorithms and Applications Hanani-tutte for Radial Planarity

A drawing of a graph G is radial if the vertices of G are placed on concentric circles C1,. .. , C k with common center c, and edges are drawn radially: every edge intersects every circle centered at c at most once. G is radial planar if it has a radial embedding, that is, a crossing-free radial drawing. If the vertices of G are ordered or partitioned into ordered levels (as they are for leveled graphs), we require that the assignment of vertices to circles corresponds to the given ordering or leveling. We show that a graph G is radial planar if G has a radial drawing in which every two edges cross an even number of times; the radial embedding has the same leveling as the radial drawing. In other words, we establish the weak variant of the Hanani-Tutte theorem for radial planarity. This generalizes a result by Pach and Tóth. An earlier version of the paper appeared in the proceedings of Graph Drawing 2015. The research of the first author has received funding from the People Programme (Marie Curie Actions) of the European Union's Seventh Framework Programme (FP7/2007-2013) under REA grant agreement no [291734].


Introduction
In a leveled graph every vertex is assigned a level in {1, . . . , k}. We can capture the leveling of the graph visually, by placing the vertices on parallel lines or concentric circles corresponding to the levels of G. To further emphasize the levels, we can require that edges respect the levels in the sense that edges must lie between the levels of their endpoints, and be monotone in the sense that they intersect any line (circle) parallel to (concentric with) the chosen lines (circles) at most once. If we choose lines, we obtain the concept of level-planarity; for circles we get radial (level) planarity.
Radial planarity was introduced by Bachmaier, Brandenburg and Forster [1] as a generalization of level-planarity [6]. Radial layouts are a popular visualization tool (see [7] for a recent survey); early examples of radial graph layouts can be found in the literature on sociometry [13]. Bachmaier, Brandenburg and Forster [1] showed that radial planarity can be tested, and an embedding can be found, in linear time. Their algorithm is based on a variant of PQ-trees [2] and is rather intricate. It generalizes an earlier linear time algorithm for level-planarity testing by Jünger and Leipert [12]. In this paper, we take the first step toward an alternative algorithm for radial planarity testing via a Hanani-Tutte style characterization.
The classical Hanani-Tutte theorem [5,20] states that a graph is planar if and only if it can be drawn in the plane so that every two independent edges cross an even number of times. A particularly nice algorithmic consequence of this result is that it reduces planarity testing to solving a system of linear equation (of polynomial size) over Z 2 , a purely algebraic problem which can be solved in polynomial time.
If we could show that a leveled graph G is radial planar if it has a radial drawing (respecting the leveling) in which every two independent edges cross an even number of times, we would have a new, very simple, polynomial-time algorithm for radial planarity. We conjecture that this (strong) Hanani-Tutte characterization of radial planarity is true, and take the first step toward this result: a weak Hanani-Tutte theorem. A weak variant of the Hanani-Tutte theorem makes the stronger assumption that every two edges cross an even number of times. Often, this leads to stronger conclusions. For example, it is known that if a graph can be drawn in a surface so that every two edges cross evenly, then the graph has an embedding on that surface with the same rotation system, i.e. the cyclic order of ends at each vertex remains the same [3,16].
Our main result, proved in Sect. 3, is the following theorem: Theorem 1. Suppose a leveled graph G has a radial drawing in which every two edges cross an even number of times. Then G has a radial embedding with the same rotation system. (All drawings respect the given leveling.) Theorem 1 implies a polynomial time algorithm for the radial planarity testing of a leveled graph G if a combinatorial embedding (rotation system) of G is fixed. This algorithm (sketched in Sect. 4) is based on solving a system of linear equations over Z 2 , see also [19,Sect. 1.4]. Thus, our algorithm runs in time O(|V (G)| 2ω ), where O(n ω ) is the complexity of multiplication of two square n×n matrices. Since our linear system is sparse, it is also possible to use Wiedemann's randomized algorithm [21], with expected running time O(n 4 log n 2 ) in our case.
Remark 1. While we do not know whether the (strong) Hanani-Tutte characterization of radial planarity holds, it can still be used for an algorithmic solution of the radial planarity problem, in the following sense: one can write a polynomialtime algorithm which-given leveled graph G-either returns a radial planar embedding of G, states that G is not radial planar, or stops with "don't know". If the algorithm outputs one of the first two answers, it is correct. If the strong Hanani-Tutte theorem for radial planarity is true, then the third answer will not occur. The details of how this can be done have been explained in a paper by Gutwenger, Mutzel, and Schaefer [11], where such an algorithm was successfully implemented for c-planarity.
Theorem 1 is a generalization of a weak variant of the Hanani-Tutte theorem for level-planarity 1 , first proved by Pach and Tóth [9,14]. The full Hanani-Tutte theorem for level-planarity was established only more recently [9], and it led to a quadratic time level-planarity test. A computational study of Chimani and Zeranski [4] of various algorithms for upward planarity testing (an NP-complete problem related to level-planarity), showed that the algorithm based on the Hanani-Tutte characterization of level-planarity performs very well in practice (it beats all other algorithms in nearly all scenarios).
Hanani-Tutte style characterizations have also been established for partially embedded planar graphs, several classes of simultaneously embedded planar graphs [18], and two-clustered graphs [8]. The family of counterexamples in [8,Sect. 4] shows that a straightforward variant of the Hanani-Tutte theorem for clustered graphs with more than two clusters fails. Gutwenger et al. [11] showed that by using the reduction from [18], this counterexample can be turned into a counterexample for a variant of the Hanani-Tutte theorem for two simultaneously embedded planar graphs [18,Conjecture 6.20]. For higher-genus (compact) surfaces, the weak variant is known to hold in all surfaces [3,17], while the strong variant is known for the projective plane only [15]. It remains an intriguing open problem whether the strong Hanani-Tutte theorem holds for closed surfaces other than the sphere and projective plane.

Terminology
For the purposes of this paper, graphs may have multi-edges, but no loops. An ordered graph G = (V, E) is a graph whose vertices are equipped with a total order v 1 < v 2 < · · · < v n . We consider an ordered graph a special case of a leveled graph, in which every vertex of G is assigned a level, a number in {1, . . . , k} for some k. The leveling of the vertices induces a natural ordering of the vertices.
For convenience we represent radial drawings as drawings on a (standing) cylinder. Intuitively, imagine placing a cylindrically-shaped mirror in the center of a radial drawing as described in the introduction. 2 The cylinder C is S 1 × I, where S 1 is a unit circle and I is the unit interval [0, 1]. Thus, a point on C is a pair (s, i), where s ∈ S 1 and i ∈ I. The projection of C to S 1 , or I, maps (s, i) ∈ C to s, or i. We denote a projection of a point or a subset α of S 1 × I to I by I(α). The winding number of a closed curve on a cylinder is the number of times the projection to S 1 of the curve winds around S 1 , i.e., the number of times the projection passes through an arbitrary point of S 1 in the counter clockwise sense minus the number of times the projection passes through the point in the clockwise sense. A closed curve (or a cycle in a graph) on a cylinder is essential if it has an odd winding number.
With this, a radial drawing of G is a drawing of G on C such that the projection to I of every edge is injective (i.e., an edge does not "turn back") and for every pair of vertices v i < v j we have I(v i ) < I(v j ). We also speak of an edge being radial when it satisfies this condition. In a radial drawing an upper edge and lower edge, respectively, at v is an edge incident to v for which min(I(e)) = I(v) and max(I(e)) = I(v). A vertex v is a sink (source), if v has no upper (lower) edges. In order to avoid some inconvenient situation we assume that I(G) is contained in the interior of I.
The rotation at a vertex in a drawing (on any surface) of a graph is the cyclic order of the ends of edges incident to the vertex in the drawing. The rotation system is the set of rotations at all the vertices in the drawing. In the case of radial drawings the upper (lower ) rotation at a vertex v is the linear order of the end pieces of the upper (lower) edges in the rotation at v starting with the direction corresponding to the clockwise orientation of S 1 . The rotation at a vertex in a radial drawing is completely determined by its upper and lower rotation. The rotation system of a radial drawing is the set of the upper and lower rotations at all the vertices in the drawing.
In what follows we consider drawings of G in the (Euclidean) plane or on a cylinder. Thus, every embedded cycle of G is separating, i.e. its complement in the ambient space of G has two components. Also, the complement of any closed curve (possibly with self-crossings) can be two-colored so that connected regions each get one color and neighboring regions receive opposite colors.
A drawing of G is even if every two edges in the drawing cross an even number of times. After a sufficiently generic continuous deformation of a drawing of G the parity of the number of crossings between a pair of edges changes only when an edge passes through a vertex during the deformation. We call this event an edge-vertex switch. In particular, when an edge e passes through a vertex v the parity of the number of crossings between e and every edge incident to v changes.

Weak Hanani-Tutte for Radial Drawings
In this section, we prove Theorem 1, the weak Hanani-Tutte theorem for radial planarity. We claim that it will be sufficient to restrict ourselves to the special case in which every level of G contains a single vertex, an ordered graph.

Theorem 2.
Suppose the ordered graph G has an even radial drawing. Then G has a radial embedding with the same rotation system, and the winding parity of every cycle remains the same. 3

(All drawings respect the ordering.)
The reduction of Theorem 1 to Theorem 2 is based on the same construction used in [9,Sect. 4.2] to reduce level-planarity to x-monotonicity: Suppose we are given an even radial drawing of a leveled graph G. If any level of G contains more than one vertex, we do the following: if any vertex at that level is a source or a sink, we add a crossing-free edge on the empty side of that vertex. We place the new vertex at a new level, close to the current level we are working on. We now slightly perturb all the vertices of the current level so no two vertices are at the same level (without moving them past any of the new vertices we created). We can do so, while keeping all edges radial, and without introducing any crossings. Since the new vertices we added are at unique levels, we only perform the perturbation on the original levels. Call the resulting ordered graph G . By Theorem 2, G has a radial embedding with the same rotation system, and the winding number of every cycle unchanged. We can now move all perturbed vertices back to their original levels, the additional edges we added ensure that this is always possible.
We will make use of the weak Hanani-Tutte theorem for x-monotone graphs due to Pach and Tóth [14], reproved in [9]. [14]). Suppose that G can be drawn so that edges are x-monotone and every two edges cross an even number of times. Then there exists an embedding of G, in which the vertices are drawn as in the given drawing of G, the edges are x-monotone, and the rotation system is the same. Figure 1 shows an example of a graph for which x-monotonicity and radial planarity differ. A radial embedding of a graph not admitting an x-monotone embedding, must contain an essential cycle.

Working with Even Radial Drawings
Given a connected graph G with a rotation system, we can define a facial walk purely combinatorially by following the edges according to the rotation system (see, for example, [10, Sect. 3.2.6]). A vertex and edge, respectively, is incident to a face if it appears on its facial walk. By gluing disks to each facial walk, one obtains a surface with the graph embedded in it. In case the surface is a sphere, each vertex occurs at most once on every facial walk of G if and only if G does not contain a cut-vertex. Any drawing of a graph G on an orientable surface defines a rotation system. For an even drawing of a connected graph G on the plane, the facial walks obtained from the rotation system correspond to a planar embedding. This is the weak Hanani-Tutte theorem [3,16]: Theorem 4. Let G be a graph. Suppose that G has an even drawing in the plane. Then G has an embedding in the plane with the same rotation system.
Let v denote a vertex incident to a face f . Let e = uv and e = vw denote a pair of consecutive edges on the facial walk of a face f in an embedding of a graph G. (Note that e and e might be equal.) The edges e and e define a wedge at v in f which is a portion of f in a small topological -neighborhood of v between e and e . By Theorem 4, any even drawing of G corresponds to its embedding with the same rotation system. Hence, every consecutive pair of edges e = uv and e = vw in the rotation at v in an even drawing defines a wedge in the corresponding embedding of G. Thus, a face f in an even drawing of G is given by the set of wedges corresponding to f in the embedding of G. From the set of wedges representing a face f in an even drawing we obtain the facial walk W f of f , since every two consecutive edges on W f define a wedge of f . By slightly abusing the notation we will denote the facial walk W f by f .
We consider a radial embedding of a connected graph G. Let a maximum (minimum) of a face f in the radial embedding of G be the maximum (minimum) i such that v i is incident to f . Let a local maximum (minimum) of a face f be a vertex v incident to f such that v > u, w (v < u, w), where u and w are the predecessor and successor of v on the facial walk of f . An outer face in a radial embedding is a face containing 0 × S 1 or 1 × S 1 . A face is an inner face if it is not an outer face.
Let f be a face in G given by an even radial drawing. The boundary curve of f is a closed curve traversing the facial walk of f in its close topological neighborhood, and at vertices passing through wedges in f . We naturally extend the notion of the winding number to a face defined as the winding number of its boundary curve. The two-coloring of f is the two-coloring of the complement of its boundary curve. A point in the complement of the boundary curve of f is in the interior (exterior ) of f if it receives the same (opposite) color as a wedge in f when we two-color f . Note that in an even drawing all the wedges in a face have the same color. The outer face in an even radial drawing is a face having 0 × S 1 or 1 × S 1 in its interior. In an even radial drawing an outer face containing 0 × S 1 (1 × S 1 ) is the lower (upper ) outer face. If G has only one outer face f , f is simultaneously the lower and upper outer face. A face that is not an outer face is an inner face. For a closed non-essential curve on the cylinder we define the interior (exterior ) as the union of the connected components in its complement whose color is different (the same) as the color of 0 × S 1 in the two-coloring of its complement.
Let v be a local minimum or maximum of a face f . A wedge ω at v in f in a radial drawing is convex (concave) if the angle bounding ω in a small topological neighborhood of v is convex and concave. Let C be a cycle in a radial drawing of G. We consider C to be a subgraph of G whose drawing is inherited from that of G. Now, C represents two faces. It is easy to see that C is non-essential if and only if in the two-coloring of (the complement of) C the concave wedge of C at the minimum and maximum of C receive the same color, i.e., are in the same face defined by C. Indeed, the parity of the number of crossings between a "vertical" path in C joining 0 × S 1 with 1 × S 1 , and C equals to the winding number of C by the definition of the winding number of C.
In a radial embedding of a connected graph G we observe that a face f is an outer face if and only if v n is its maximum, or v 1 is its minimum, and the wedge in f at v n or v 1 is concave. Thus, either G has two outer faces one of which is lower and one of which is upper, or G has exactly one outer face. In the former, the boundary curve of the outer faces is essential. In the latter G does not contain any essential cycle. The same is true also in even radial drawings.

Lemma 1.
In an even radial drawing of a connected graph G at most one face can have a concave wedge at its maximum or minimum, which necessarily happens only at v n or v 1 . Consequently, either G has two outer faces one of which is lower and one of which is upper, or G has exactly one outer face.
The next lemma simplifies the type of faces we have to deal with.

Lemma 2.
Let G be a connected graph. Suppose that G has an even radial drawing. Then we can augment the drawing of G by adding edges so that the resulting drawing is still even and radial, every face of G has at most two local minima and two maxima, and each outer face has exactly one local minimum and one local maximum.
Proofs of previous lemmata will be contained in the journal version of the paper.

Proof of Theorem 2
A connected component G 1 of G drawn radially is essential if it contains an essential cycle.
Given a graph G with a radial drawing, consider the augmentation of G that's guaranteed by Lemma 2. If Theorem 2 is true for the augmented graph, then it is clearly true for G as well. Thus, it suffices to prove Theorem 2 for graphs of the form constructed in Lemma 2. Even more, we can restrict ourselves to connected components of the graph, as the following lemma shows (proof left to the journal version).

Lemma 3. A counterexample to Theorem 2 with the smallest number of vertices is not disconnected.
Before we turn to the proof of Theorem 2 we present one more tool which allows us to clear an arbitrary edge in an even radial drawing of crossings while keeping the drawing radial and even. This is a slight extension of redrawing results we have used in previous papers [17,Fig. 3]. A proof will be included in the journal version.

Lemma 4. Let G denote a graph given by an independently even radial drawing.
Let e denote an arbitrary edge of G crossing every other edge in G evenly. We can redraw the edges crossing e inside I(e) × S 1 so that (i) e is crossing free, (ii) the resulting drawing remains even and radial, (iii) the rotation system and the points representing vertices are the same as in the given drawing, (iv) the parity of winding number remains the same for all cycles.
Proof (of Theorem 2). For the sake of contradiction let G denote a minimal counterexample with respect to the number N of ordered pairs of vertices (u, v), u < v, of G, where u is a source and v is a sink. By Lemma 3, we assume that G is connected and by Lemma 2 we assume that each face of G contains at most two local minima and each outer face at most one local minimum. We construct a radial embedding D of G inductively as D n , where every D i , 1 ≤ i ≤ n, is an even radial drawing of a graph G i obtained from G by subdividing certain edges in their interior without altering its radial planarity such that D i is crossing free in [0, I(v i )] × S 1 . Since throughout the proof we keep the rotation system of G unchanged (after suppressing the subdividing vertices in G i ), this contradicts the choice of G.
We proceed by constructing compatible cyclic orders O i given by the order of appearance of points in The elements, i.e., points, in O i 's are denoted by the objects of G i , i.e., edges and vertices, they belong to. By "compatible" we mean that for two consecutive orders O i and O i+1 (after suppressing the subdividing vertices in G i ) the order O i+1 is obtained from O i using an auxiliary order O i as follows. We obtain O i from O i by replacing v i with its upper edges. We obtain O i+1 from O i by replacing the lower edges of v i+1 appearing consecutively in O i with v i+1 if v i+1 is not a source. Otherwise, we obtain O i+1 from O i by placing v i+1 between two edges bounding the face that contains the concave wedge at v i+1 .
In the base case there is nothing to prove. We just put G 1 := G. For i+1 > 1, we distinguish two cases depending on whether v i+1 is a source or not. We work in D i from the induction hypothesis. We subdivide in G i every edge e whose projection I(e ) contains v i in its interior at a point p e whose projection I(p e ) ∈ (I(v i ), I(v i )+ ), where is sufficiently small such that [I(v i ), I(v i )+ ]×S 1 is free of edge crossings. Let G i+1 denote the resulting graph. Clearly, such subdivisions have no effect on the embeddability and do not alter the value N . The order O i is obtained by taking D i ∩ ((I(v i ) + ) × S 1 ). There are two cases to distinguish depending on whether v i+1 is a source.
The vertex v i+1 is not a source. First, if v i+1 is not a source let e denote a lower edge at v i+1 , see   Since the interior of (I(P ) × S 1 ) \ P is homeomorphic to the plane, (ii) is obvious once we establish (i). To prove (i), consider a closed curve C obtained by concatenating the part of f between v i+1 and v (not containing u); the part of P between v and I(v i+1 ) × S 1 ; and the part of I(v i+1 ) × S 1 crossing the interior of f , i.e., not crossing P . Claim (i) follows since e crosses C an odd number of times, and hence, the only way for e to sprout beyond v is to have an edge in G e splitting a wedge in the interior of f which is impossible.
If G i is empty, S is not crossed by an edge, and hence, the order of edges in O i+1 is inherited from O i . The drawing D i+1 is obtained analogously as in the case when v i+1 was not a source. Otherwise, consider a connected component H of G i given by the even radial drawing inherited from the drawing D i of  H )). Indeed, f is not an outer face by Lemma 1, since f has a local maximum whose corresponding wedge is concave and different from v n . Thus, the maximum of f is different from z which is a local maximum of f . We reduce G i+1 by removing the edges of H from it, and identifying the seeds of H thereby replacing them by a single vertex s i . In D i , this corresponds to contracting C H to a point while keeping the drawing radial and even. Let G denote the resulting graph. Note that N necessarily decreased in G . Indeed, at least the contribution of the source-sink pair (v i+1 , z) towards N decreased. Since G i+1 was a minimal counterexample, G has a desired radial embedding. Similarly, let H denote the graph obtained from H by identifying its seeds and denoting the resulting vertex by s i . By the weak variant of the Hanani-Tutte theorem for monotone drawings, Theorem 3, we obtain a radial embedding of H without an essential cycle. We combine the embeddings of H and G by identifying s i and s i , and uncontracting s i . We have room to accommodate H inside f , since max(f ) > max(I(H )).

Algorithm
Theorem 1 reduces the problem of radial planarity testing with a fixed rotation system to a system of linear equations over Z 2 . For planarity testing, systems like this were first constructed by Wu and Tutte [19,Sect. 1.4.2].
Unlike the x-monotone case, two drawings of an edge e with fixed endpoints may not be obtainable from each other by a continuous deformation of e, while keeping e radial: two radial drawings of e may also differ by a number of (Dehn) twists. The system has a variable x e,v for every edge-vertex switch (e, v) such that I(v) ∈ I(e), and x e for every edge twist. Since we work in Z 2 orientation of a twist does not matter. We consider a twist of e = uv, u < v, as being performed very close to v, i.e., the twist is carried out by removing a small portion P e of e such that we have I(w) ∈ I(P e ), for all vertices w, and reconnecting the severed pieces of e by a curve intersecting every edge e , s.t. I(P e ) ⊂ I(e ), exactly once. Observe that with respect to the parity of crossings between edges performing a twist close to v equals performing an edge-vertex switch of e with all the vertices w < v (even those w for which w < u). Hence, any twist of e keeping e radial can be simulated by a twist of e very close to v and a set of edge-vertex switches of e with certain vertices w, for which u < w < v.
By the previous paragraph a linear system for testing radial planarity with the fixed rotation system looks as follows. Given an arbitrary radial drawing of G we denote by cr(e, f ) the parity of the number of crossings between e and f . In the linear system, for each pair of independent edges (e, f ) = (uv, wz), where u < v, w < z, u < w, and w < v, we have x e,w + x e,z + x f = cr(e, f ) if z < v, and x e,w + x f,v + x e = cr(e, f ) if z > v. For a pair of edges (e, f ) = (uv, uw), where u < v < w, we have x f,v + x e = cr(e, f ) and for a pair of edges (e, f ) = (uv, uw), where u > v > w, we have x f,v + x e + x f = cr(e, f ). For a pair of edges (e, f ) = (uv, uv), where u < v, we have x e + x f = cr(e, f ).