1 Introduction

Grid drawings of graphs embed graphs into grids such that vertices map to grid points and edges map to internally disjoint curves on the grid lines that connect their endpoints. Orthogonal grids, whose grid lines are horizontal and vertical lines, are popular and widely used in Graph Drawing. Among other applications, orthogonal graph drawings are used in VLSI design (e.g., [5, 35]), diagrams (e.g., [3, 14, 20, 38]), and network layouts (e.g., [24, 30]). They have been extensively studied with respect to their construction and properties (e.g., [1, 6, 7, 29, 33]). Moreover, they have been generalized to arbitrary planar graphs with degree higher than four (e.g., [8, 18, 32]).

Fig. 1
figure 1

An ortho-radial drawing of a graph on a grid (a) and its equivalent interpretation as an orthogonal drawing on a cylinder (b)

Fig. 2
figure 2

Metro map of Berlin using an ortho-radial layout. Image copyright by Maxwell J. Roberts. Repro- duced with permission

Ortho-radial drawings are a generalization of orthogonal drawings to grids that are formed by concentric circles around the origin and straight-line spokes from the origin, but excluding the origin. Equivalently, they can be viewed as graphs drawn in an orthogonal fashion on the surface of a standing cylinder, see Fig. 1, or a sphere without the poles. Hence, they naturally bring orthogonal graph drawings to the third dimension.

Among other applications, ortho-radial drawings are used to visualize network maps; see Fig. 2Footnote 1. Especially, for metro systems of metropolitan areas they are highly suitable. Their inherent structure emphasizes the city center, the metro lines that run in circles as well as the metro lines that lead to suburban areas. While the automatic creation of metro maps has been extensively studied for other layout styles such as octilinear edge directions [23, 26, 28, 36] and curved metro lines [16], this is a new and wide research field for ortho-radial drawings [2, 17]. For a more detailed discussion on layouts of transit maps we refer to the survey by Wu et al. [37].

Adapting existing techniques and objectives from orthogonal graph drawings is a promising step to open up that field. One main objective in orthogonal graph drawing is to minimize the number of bends on the edges. The key ingredient of a large fraction of the algorithmic work on this problem is the orthogonal representation, introduced by Tamassia [31], which describes orthogonal drawings by listing (i) the angles formed by consecutive edges around each vertex, and (ii) the directions of bends along the edges. Such a representation is valid if (I) the angles around each vertex sum to \(2\pi \), and (II) the sum of the angles around each face with k vertices is \((k-2)\cdot \pi \) for internal faces and \((k+2)\cdot \pi \) for the outer face. The necessity of the first condition is obvious and the necessity of the latter follows from the sum of inner/outer angles of any polygon with k corners. It is thus clear that any orthogonal drawing yields a valid orthogonal representation, and Tamassia [31] showed that the converse holds true as well; for a valid orthogonal representation there exists a corresponding orthogonal drawing that realizes this representation. Moreover, the proof is constructive and allows the efficient construction of such a drawing, a process that is referred to as compaction.

Altogether, this enables a three-step approach for computing orthogonal drawings, the so-called Topology-Shape-Metrics Framework, which works as follows. First, fix a topology, i.e., a combinatorial embedding of the graph in the plane (possibly planarizing it if it is non-planar); second, determine the shape of the drawing by constructing a valid orthogonal representation with few bends; and finally, compactify the orthogonal representation by assigning suitable vertex coordinates and edge lengths (metrics). As mentioned before, this reduces the problem of computing an orthogonal drawing of a planar graph with a fixed embedding to the purely combinatorial problem of finding a valid orthogonal representation, preferably with few bends. The task of actually creating a corresponding drawing in polynomial time is then taken over by the framework. It is this approach that is at the heart of a large body of literature on bend minimization algorithms for orthogonal drawings (e.g., [4, 9,10,11,12,13, 15]).

Contribution and Outline. In this paper we establish an analogous drawing framework for ortho-radial drawings. To this end, we introduce so-called ortho-radial representations, which give a combinatorial description of ortho-radial drawings, and therefore can be used to substitute orthogonal representations in the Topology-Shape-Metrics Framework.

More precisely, our contributions are as follows. We show that a natural generalization of the validity conditions (I) and (II) above is not sufficient, and introduce a third, less local condition that excludes so-called strictly monotone cycles, which do not admit an ortho-radial drawing. The third condition requires an additional edge, called the reference edge, from which we can derive whether an edge is part of a circle or a spoke of the ortho-radial grid. We prove that these three conditions together fully characterize ortho-radial drawings. Before that, characterizations for bend-free ortho-radial drawings were only known for paths, cycles and theta graphs [21]. Further, for the special case that each internal face is a combinatorial rectangle, a characterization for cubic graphs was known [22]. Here, an internal face is a combinatorial rectangle if it contains exactly four angles of \(\pi /2\) and all other angles have \(\pi \).

On the algorithmic side, we show that it can be tested in \(\text{\O }(n^2)\) time whether an ortho-radial representation with a given reference edge is drawable. A corresponding drawing can be obtained in the same running time. While this does not yet directly allow us to compute ortho-radial drawings with few bends, our result paves the way for a purely combinatorial treatment of bend minimization in ortho-radial drawings, thus enabling the same type of tools that have proven highly successful in minimizing bends in orthogonal drawings. Recently, Niedermann and Rutter [27] presented such a tool based on an integer linear programming formulation showing that the topology-shape-metrics framework for ortho-radial drawings is capable of handling real-world networks such as metro systems.

We define basic terms and notations in Sect. 2. Afterwards, we formally introduce ortho-radial drawings and ortho-radial representations in Sect. 3, where we also establish basic properties that will be used throughout this paper. In Sect. 4 we introduce helpful tools for working with ortho-radial representations. Section 5 establishes basic properties of labelings that are used to describe ortho-radial representations. In Sects. 6 and 7 we prove that ortho-radial representations are drawable if and only if they are valid. In Sect. 8 we give a validity test for ortho-radial representations that runs in \(\text{\O }(n^{2})\) time. Afterwards, in Sect. 9, we revisit the rectangulation procedure from Sect. 7 and show that using the techniques from Sect. 8 it can be implemented to run in \(\text{\O }(n^{2})\) time, improving over a naive application which would yield running time \(\text{\O }(n^{4})\). This enables a purely combinatorial treatment of ortho-radial drawings. In Sect. 10 we discuss how to include bends and we show that deciding whether a graph has a bend-free ortho-radial drawing is \(\mathcal{N}\mathcal{P}\)-complete. We conclude with a summary and some open questions in Sect. 11.

2 Preliminaries

Let G be a plane graph with combinatorial embedding \(\mathcal {E}\) and outer face \(f_o\). The embedding \(\mathcal {E}\) fixes for each vertex v of G the counterclockwise order of the edges incident to v around the vertex v. A path in G may contain vertices multiple times, and a cycle C may contain vertices multiple times but may not cross itself in the sense that the pairs of edges along which C enters and leaves a vertex v do not alternate in the cyclic order of edges around v in the embedding \(\mathcal {E}\). We consider all paths and cycles to be directed. We represent a path P as the sequence \(v_1\ldots v_k\) of its vertices in the order as they appear on P. Similarly, we represent a cycle as the sequence \(v_1\ldots v_k\) of its vertices in the order as they appear on C, where \(v_1\) is arbitrarily chosen. For any path \(P=v_1\ldots v_k\) its reverse is \(\bar{P}=v_k\ldots v_1\). The concatenation of two paths \(P_1\) and \(P_2\) is written as \(P_1+P_2\). For two edges uv and wx on a path P the subpath from uv to wx is the unique path on P that starts with uv and ends with wx, and we denote it by P[uvwx]. If P contains u (or x) only once, we may write u instead of uv (or x instead of wx). This can lead to abbreviations like \(P\hspace{0.33325pt}[u, wx]\), \(P\hspace{0.33325pt}[uv, x]\), and \(P\hspace{0.33325pt}[u, x]\). In particular, if P is simple \(P\hspace{0.33325pt}[u, x]\) denotes the subpath of P from u to x. For a cycle C, we similarly denote its reverse by \(\bar{C}\), and for edges uv and wx on C the subpath of C from uv to wx in the direction of C is denoted by \(C\hspace{0.33325pt}[uv, wx]\).

Moreover, a path or cycle is simple if it contains all vertices at most once. A facial walk C of a face f is a cycle in G that describes the boundary of f, i.e., the cycle C consists of edges of f and for any subpath uvw of C the edge uv precedes vw in the cyclic order of edges around v that is defined by \(\mathcal {E}\). Any simple cycle C separates two sets of faces. One of these sets contains the outer face \(f_o\), and we call these faces together with the vertices and edges incident to them the exterior of C. Conversely the faces of the other set and their incident vertices and edges form the interior of C. Note that C belongs to both its interior and its exterior. Unless specified explicitly, a simple cycle C is directed such that its interior lies to the right of C. Finally, a path P respects a cycle C if P lies in the exterior of C.

3 Ortho-Radial Drawings and Representations

Let \(G=(V,E)\) be a planar, connected 4-graph with n vertices, where a graph is a 4-graph if it has maximum degree four. An ortho-radial drawing \(\Delta \) of G is a plane drawing on an ortho-radial grid \(\mathcal G\) such that each vertex of G is a grid point of \(\mathcal G\) and each edge of G is a simple curve on \(\mathcal G\). We observe that in any ortho-radial drawing there is an unbounded face \(f_o\) and a face \(f_c\) that contains the center of the grid; we call the former the outer face and the latter the central face; in our figures we mark the central face using a small “x”. All other faces are regular. We remark that \(f_c\) and \(f_o\) are not necessarily distinct. We further distinguish two types of simple cycles. If the central face lies in the interior of a simple cycle, the cycle is essential and otherwise non-essential.

In this paper, we assume that we are given G, a fixed combinatorial embedding \(\mathcal E\) of G and two (not necessarily distinct) faces \(f_c\) and \(f_o\) of \(\mathcal E\). We seek an ortho-radial drawing \(\Delta \) of G such that the combinatorial embedding of \(\Delta \) is \(\mathcal {E}\), the face \(f_c\) is the central face of \(\Delta \) and \(f_o\) is the outer face of \(\Delta \). We call the tuple \(I=(G,\mathcal E,f_c,f_o)\) an instance of ortho-radial graph drawing and \(\Delta \) a drawing of I.

We observe that the definition of ortho-radial drawings allows edges to have bends, i.e., an edge may consist of a sequence of straight-line segments and circular arcs. In this paper, we focus on ortho-radial drawings without bends; we call such drawings bend-free. Hence, each edge is either part of a radial ray or of a concentric circle of \(\mathcal G\). This is not a restriction as any ortho-radial drawing can be turned into a bend-free drawing by replacing bends with subdivision vertices; see Sect. 10 for a detailed discussion.

In a bend-free ortho-radial drawing of G each edge has a geometric direction in the sense that is drawn either clockwise, counterclockwise, towards the center, or away from the center. Hence, using the metaphor of a cylinder, the edges point right, left, down, or up, respectively. Moreover, horizontal edges point left or right, while vertical edges point up or down; see Fig. 1.

Fig. 3
figure 3

The orthogonal drawing is transformed into an ortho-radial drawing by bending the horizontal edges into concentric circular arcs, while vertical edges become segments of rays that emanate from the center of the ortho-radial grid

We further observe that if the central and outer face are identical then an ortho-radial drawing can be interpreted as a distorted orthogonal drawing, in which the horizontal edges are bent to circular arcs, while the vertical edges remain straight segments; see Fig. 3 for an example. Hence, utilizing the framework for orthogonal drawings by Tamassia [31], this allows us to easily create an ortho-radial drawing of an instance I for the case that the central face \(f_c\) and the outer face \(f_o\) are the same. Therefore, we assume \(f_c\ne f_o\) in the remainder of this work, which changes the problem of finding an ortho-radial drawing of I substantially.

Fig. 4
figure 4

A combinatorial embedding (left) and an ortho-radial drawing (right) of a graph. For each combi- natorial angle a rotation is given. Refer to the online version of this article for colored figures

We first introduce concepts that help us to combinatorially describe the ortho-radial drawing \(\Delta \). Let v be a vertex of G and let \(\mathcal E(v)\) be the counterclockwise order of the edges in \(\mathcal E\) around v. A combinatorial angle at v is a pair of edges \((e_1,e_2)\) that are both incident to v and such that \(e_1\) immediately precedes \(e_2\) in \(\mathcal E(v)\); see Fig. 4. An angle assignment \(\Gamma \) of an instance \(I=(G,\mathcal {E},f_c,f_o)\) assigns to each combinatorial angle \((e_1,e_2)\) of \(\mathcal {E}\) a rotation \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_1,e_2) \in \{-2,-1,0,1\}\). For an ortho-radial drawing \(\Delta \) of I we can derive an angle assignment that defines \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_1,e_2) = 2-2\alpha /\pi \) for each angle \((e_1,e_2)\) at v, where \(\alpha \) is the counterclockwise geometric angle between \(e_1\) and \(e_2\) in \(\Delta \). Hence, the rotation of a combinatorial angle counts the number of right turns that are taken when going from \(e_1\) to \(e_2\) via v, where negative numbers correspond to left turns; see Fig. 4. In particular, when traversing the boundary of a face such that the face lies to the right, then we perform two left turns at a degree-1 vertex. Hence, in case that \(e_1=e_2\) we derive \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_1,e_2)=-2\) from \(\Delta \), i.e., v contributes two left turns. But conversely, we cannot derive an ortho-radial drawing from every angle assignment.

For a face f of \(\mathcal {E}\) with facial walk \(v_1\ldots v_{k}\) around f (where f is oriented in clockwise order) we define \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(f)=\sum _{i=1}^{k} {{\,\textrm{rot}\,}}\hspace{1.111pt}(v_{i-1}v_{i},v_{i}v_{i+1})\), where we define \(v_0:=v_k\) and \(v_{k+1}:=v_1\). Every angle assignment \(\Gamma \) that is derived from a bend-free ortho-radial drawing is locally consistent in the following sense [21].

Definition 3.1

An angle assignment is locally consistent if it satisfies the following two conditions.

  1. (i)

    For each vertex, the sum of the rotations around v is \(2\hspace{0.33325pt}(\deg (v)-2)\).

  2. (ii)

    For each face f, we have

    $$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(f)= {\left\{ \begin{array}{ll} 4, &{} \text {{ f} is a regular face}, \\ 0, &{} \text {{ f} is the outer or the central face but not both}, \\ -4,&{} \text {{ f} is both the outer and the central face.} \end{array}\right. } \end{aligned}$$
Fig. 5
figure 5

Illustration of an ortho-radial representation where the angles around vertices sum up to \(2\pi \), and also the sum of angles for each face is as expected for an ortho-radial drawing. However, the graph does not have an ortho-radial drawing without bends as illustrated on a cylinder (left) and an ortho-radial grid (right)

Unlike for orthogonal representations, conditions (i) and (ii) do not guarantee that for a locally consistent angle assignment of I there is an ortho-radial drawing of I having the same angles; see Fig. 5. In this paper, we introduce a third more global condition that characterizes all locally consistent angle assignments of I that can be drawn. To that end, we first introduce basic concepts on rotations and directions in locally consistent angle assignments in Sect. 3.1, which leads us to ortho-radial representations. Afterwards, we define this global condition in Sect. 3.2.

3.1 Ortho-Radial Representations

We transfer two basic properties of ortho-radial drawings to locally consistent angle assignments. First, the rotations of all cycles are either 0 or 4. Second, fixing the geometric direction of a single edge \(e^\star \), fixes the geometric directions of all edges. We call \(e^\star \) a reference edge and assume that it points to the right and lies on the outer face of \(\mathcal {E}\).

Definition 3.2

An ortho-radial representation is a locally consistent angle assignment with a reference edge \(e^\star \) on the outer face such that the outer face lies to the left of \(e^\star \).

For two edges \(e=uv\) and \(e'=vw\) we define the rotation between them as \({{\,\textrm{rot}\,}}\hspace{0.55542pt}(uvw)=\sum _{i=1}^{k-1}{{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_i,e_{i+1})-2\hspace{0.33325pt}(k - 2)\), where \(e=e_1,\dots ,e_k=e'\) are the edges that are incident to v and lie between e and \(e'\) in counterclockwise order; see Fig. 6a.

Fig. 6
figure 6

Generalization of rotations. a The rotation of the two edges \(e_1=uv\) and \(e_2=vw\) is \({{\,\textrm{rot}\,}}\hspace{0.55542pt}(uvw)=\sum _{i=1}^3 1-2 (4-2) =-1\). b The rotation of the path P is \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(P)=-1+1-1-1+1+1=0\)

The rotation of a path \(P=v_1\ldots v_k\) is the sum of the rotations at its internal vertices, that is \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(P)=\sum _{i=2}^{k-1}{{\,\textrm{rot}\,}}\hspace{0.88882pt}(v_{i-1}v_iv_{i+1})\); see Fig. 6 (b).

Observation 3.3

Let P be a path with start vertex s and end vertex t.

  • It is \( {{\,\textrm{rot}\,}}\hspace{0.33325pt}(\bar{P}) = -{{\,\textrm{rot}\,}}\hspace{0.33325pt}(P)\).

  • For every edge e on P it is \( {{\,\textrm{rot}\,}}\hspace{0.33325pt}(P) = {{\,\textrm{rot}\,}}\hspace{0.7222pt}(P[s, e]) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(P[e,t])\).

Similarly, for a cycle \(C = v_1\ldots v_k\), its rotation is the sum of the rotations at all its vertices (where we define \(v_0 = v_k\) and \(v_{k+1}=v_1\)), i.e., \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C) = \sum _{i=1}^{k} {{\,\textrm{rot}\,}}\hspace{0.7222pt}(v_{i-1}v_{i}v_{i+1})\). We observe that the rotation of a face f is equal to the rotation of the cycle that we obtain from the facial walk around f.

Lemma 3.4

Let C be a simple cycle in an ortho-radial representation \(\Gamma \). Then, \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C)=0\) if C is essential and \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C)=4\) if C is non-essential.

Proof

Let H be the sub-graph of G that is contained in the interior of C; we note that C belongs to H. Let \(n_H\), \(m_H\), and \(f_H\) denote the number of vertices, edges and faces of H, respectively. Let \(\Gamma '\) be the angle assignment that coincides with \(\Gamma \) on all angles in the interior of C and has \({{\,\textrm{rot}\,}}_{\Gamma '}(uvw) = {{\,\textrm{rot}\,}}_{\Gamma }(uvw)\) for any three consecutive vertices along C. By construction, \(\Gamma '\) satisfies property (i) and therefore the sum R of all rotations is \(R=\sum _{v\in V} 2\hspace{0.33325pt}(\deg (v)-2) = 4\hspace{0.33325pt}(m_H-n_H) = 4\hspace{0.33325pt}(f_H - 2)\) by Euler’s formula.

If C is essential, then \(f_H - 2\) interior faces contribute a rotation of 4 each and the central face contributes a rotation of 0, leaving a rotation of 0 for the outer face. If C is non-essential, then the \(f_H - 1\) interior faces contribute a rotation of 4 each, leaving a rotation of \(-4\) for the outer face. Since C is oriented clockwise while the outer face is oriented counterclockwise, \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C) = 4\) follows. \(\square \)

Fig. 7
figure 7

Illustration for proof of Lemma 3.5. Cycle C with two additional edges ab and cd. If a lies in the exterior of C then \(r_a=+2\) and otherwise \(r_a=-2\). Similarly, if d lies in the exterior of C then \(r_d=+2\) and \(r_d=-2\) otherwise

The next lemma relates the rotations of two paths S and T that use the same edges except on a cycle C; see Fig. 7.

Lemma 3.5

Let C be a cycle and let ab and cd be two edges (with \(b\ne c\)) such that b and c lie on C, but a and d do not. Further, let \(S=ab+C[b,c]+cd\) and \(T=ab+\bar{C}[b,c]+cd\). Then

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S)-{{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)={{\,\textrm{rot}\,}}\hspace{0.33325pt}(C)+r_a+r_d, \end{aligned}$$

where for \(z\in \{a,d\}\) we define \(r_z=+2\) if z lies in the interior of C and \(r_z=-2\) if z lies in the exterior of C.

Fig. 8
figure 8

Illustration for proof of Lemma 3.5. In all six cases it holds \({{\,\textrm{rot}\,}}\hspace{0.49988pt}(abs) - {{\,\textrm{rot}\,}}\hspace{0.49988pt}(abt) = {{\,\textrm{rot}\,}}\hspace{0.49988pt}(tbs) + r_a\)

Proof

Let t and s be the vertices immediately before and after b on C. We observe that a lies in the interior of C if and only if ab lies locally to the right of the path sbt. Considering all six cases how the edges ab, sb, and tb can be arranged (see Fig. 8), we obtain \({{\,\textrm{rot}\,}}\hspace{0.49988pt}(abs) - {{\,\textrm{rot}\,}}\hspace{0.49988pt}(abt) = {{\,\textrm{rot}\,}}\hspace{0.49988pt}(tbs) + r_a\). Similarly, we define \(s'\) and \(t'\) as the vertices immediately before and after c on C. Considering all cases as above we get \({{\,\textrm{rot}\,}}\hspace{0.49988pt}(s'cd) - {{\,\textrm{rot}\,}}\hspace{0.49988pt}(t'cd) = {{\,\textrm{rot}\,}}\hspace{0.49988pt}(s'ct') + r_d\). Splitting S and T into three parts (see Fig. 7), we have

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S) - {{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)= & {} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(abs) + {{\,\textrm{rot}\,}}\hspace{0.88882pt}(C[b, c]) + {{\,\textrm{rot}\,}}\hspace{0.49988pt}(s'cd) -{{\,\textrm{rot}\,}}\hspace{0.49988pt}(abt) \\ {}{} & {} - {{\,\textrm{rot}\,}}\hspace{0.88882pt}(\bar{C}[b,c]) - {{\,\textrm{rot}\,}}\hspace{0.49988pt}(t'cd).\end{aligned}$$

Combining the rotations at b and c using the observations from above, we get

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S) - {{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)&= {{\,\textrm{rot}\,}}\hspace{0.49988pt}(tbs) + r_a + {{\,\textrm{rot}\,}}\hspace{0.88882pt}(C[b, c]) + {{\,\textrm{rot}\,}}\hspace{0.88882pt}(C[c,b]) + {{\,\textrm{rot}\,}}\hspace{0.49988pt}(s'ct') + r_d\\&= {{\,\textrm{rot}\,}}\hspace{0.33325pt}(C) + r_a + r_d. \end{aligned}$$

\(\square \)

For two edges e and \(e'\) let P be an arbitrary simple path that starts at the source or target of e and ends at the source or target of \(e'\), and that neither contains e nor \(e'\). We call P a reference path from e to \(e'\). We define the combinatorial direction of \(e'=xy\) with respect to \(e=uv\) and P as

$$\begin{aligned} {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,P,e') = {\left\{ \begin{array}{ll} {{\,\textrm{rot}\,}}\hspace{1.111pt}(e+P+e') &{} \text {{ P} starts at { v} and ends at { x}},\\ {{\,\textrm{rot}\,}}\hspace{1.111pt}(\bar{e}+P+e')+2 &{} \text {{ P} starts at { u} and ends at { x}},\\ {{\,\textrm{rot}\,}}\hspace{1.111pt}(e+P+\bar{e'})-2 &{} \text {{ P} starts at { v} and ends at { y}},\\ {{\,\textrm{rot}\,}}\hspace{1.111pt}(\bar{e}+P+\bar{e'}) &{} \text {{ P} starts at { u} and ends at { y}.} \end{array}\right. } \end{aligned}$$

With the fixed direction of the reference edge \(e^\star \), it is natural to determine the direction of any other edge e by considering the direction of any reference path from \(e^\star \) to e. In order to get consistent results, any two reference paths P and Q from \(e^\star \) to e must induce the same direction of e, which means that \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e^\star , P, e)\) and \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e^\star , Q, e)\) may only differ by a multiple of 4. In the following lemma we show that this is indeed the case.

Lemma 3.6

Let e and \(e'\) be two edges of an ortho-radial representation \(\Gamma \), and let P and Q be two reference paths from e to \(e'\).

  • It holds \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,P,e')\equiv {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,Q,e') \pmod {4}\).

  • It holds \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,P,e') = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,Q,e')\), if there are two essential cycles C and \(C'\) such that

    1. (a)

      \(C'\) lies in the interior of C,

    2. (b)

      e lies on C and \(e'\) lies on \(C'\), and

    3. (c)

      P and Q lie in the interior of C and in the exterior of \(C'\).

Fig. 9
figure 9

Illustration of the proof for Lemma 3.6. a The edges e and \(e'\) are replaced by the depicted construction to reduce the number of cases to be considered. b Four cases are considered how the edges e and \(e'\) can be connected by the path S. The paths \(S_1\) and \(S_2\) are defined depending on the particular case

Proof

First, we define a construction that helps us to reduce the number of cases to be considered. We subdivide e by a vertex u into two edges \(e_1\) and \(e_2\); see Fig. 9a. Further, we add a path consisting of two edges \(e_3\) and \(e_4\) such that the target of \(e_4\) is u. We define that \({{\,\textrm{rot}\,}}\hspace{0.55542pt}(e_3e_4)=1\) and \({{\,\textrm{rot}\,}}\hspace{0.55542pt}(e_4e_2)=-1\). Similarly, we subdivide \(e'\) by a vertex v into two edges \(e'_1\) and \(e'_2\). Further, we add a path consisting of two edges \(e'_3\) and \(e'_4\) such that the source of \(e'_3\) is v. We define that \({{\,\textrm{rot}\,}}\hspace{0.55542pt}(e'_1e'_3)=1\) and \({{\,\textrm{rot}\,}}\hspace{0.55542pt}(e'_3e'_4)=-1\). Let S be a reference path from e to \(e'\); see Fig. 9b. Let \(S_1\) be the path that starts at the source of \(e_3\) and ends at the starting point of S only using edges from \(\{e_1,e_2,e_3,e_4\}\). Further, let \(S_2\) be the path that starts at the end point of S and ends at the target of \(e'_4\) only using edges from \(\{e'_1,e'_2,e'_3,e'_4\}\). The extension \(S'\) of S is the path \(S_1+S+S_2\). The following claim shows that we can consider \(S'\) instead of S such that it is sufficient to consider the rotation of \(S'\) instead of the direction \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')\), which distinguishes four cases.

Claim 3.7

\({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')={{\,\textrm{rot}\,}}\hspace{0.33325pt}(S')\).

The detailed proof of Claim 3.7 is found at the end of this proof. In the following let \(P'\) and \(Q'\) be the extensions of P and Q, respectively. We show that \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(P')\equiv {{\,\textrm{rot}\,}}\hspace{0.33325pt}(Q')\) (mod 4). Moreover, for the case that e coincides with the reference edge \(e^\star \) and \(e'\) lies on an essential cycle that is respected by P and Q, we show that \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(P') = {{\,\textrm{rot}\,}}\hspace{0.33325pt}(Q')\). Altogether, due to Claim 3.7 this proves Lemma 3.6. We show \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(P') = {{\,\textrm{rot}\,}}\hspace{0.33325pt}(Q')\) by converting \(P'\) into \(Q'\) successively. More precisely, we construct paths \(R_1\ldots R_k\) such that \(R_i\) consists of a prefix of \(P'\) followed by a suffix of \(Q'\) such that with increasing i the used prefix of \(P'\) becomes longer, while the used suffix of \(Q'\) becomes shorter. In particular, we have \(R_1=Q'\) and \(R_k=P'\). We show that \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(R_i)\equiv {{\,\textrm{rot}\,}}\hspace{0.33325pt}(R_{i+1})\) (mod 4). If \(R_{i}\ne P'\), we construct \(R_{i+1}\) from \(R_i\) as follows; see Fig. 10.

Fig. 10
figure 10

Illustration for proof of Lemma 3.6. The path \(R_i\) (gray) consists of a prefix of the path \(P'\) (orange) and a suffix of the path \(Q'\) (blue)

There is a first edge vw on \(P'\) such that the following edge does not lie on \(R_{i}\). Let x be the first vertex on \(P'\) after w that lies on \(R_i\) and let y be the vertex on \(R_i\) that follows x immediately. As both \(P'\) and \(R_i\) end at the same edge, these vertices always exist. We define \(R_{i+1} = P[e_3,x]+R_i[x,e_4']\). We observe that \(R_i[x,e_4']=Q'[x,e_4']\), as \(R_i[w,e_4']=Q'[w,e_4']\) and x occurs on \(Q'\) after w. Further, \(R_{i+1}\) is a path as we can argue as follows. We can decompose \(R_{i+1}\) into three paths: \(R^1_{i+1}=P'[e_3,w]=R_{i}[e_3,w]\), \(R^2_{i+1}=P'[w,x]\) and \(R^3_{i+1}=Q'[x,e_4']=R_{i}[x,e_4']\). The paths \(R^1_{i+1}\) and \(R^3_{i+1}\) do not intersect as both also belong to \(R_i\), which is a path by induction. The paths \(R^1_{i+1}\) and \(R^2_{i+1}\) do not intersect (except at their common vertex w), because both belong to \(P'\). The paths \(R^2_{i+1}\) and \(R^3_{i+1}\) do not intersect (except at their common vertex x), because by the definition of x no vertex of \(P'\) between w and x lies on \(R_i\).

Next, we show that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_i)\equiv {{\,\textrm{rot}\,}}\hspace{0.33325pt}(R_{i+1}) \pmod {4}\). To that end consider the (initially undirected) cycle \(C_{i}\) that consists of the two paths \(R_i[w,x]\) and \(R_{i+1}[w,x]\). We orient \(C_{i}\) such that the interior of the cycle locally lies to the right of its edges. By the definition of \(R_{i+1}\) we obtain \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_i[e_3,vw]) = {{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_{i+1}[e_3,vw])\) and \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_i[xy,e_4']) = {{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_{i+1}[xy,e_4'])\), as these subpaths of \(R_i\) and \(R_{i+i}\) coincide, respectively. Hence, it remains to show that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_i[vw,xy]) \equiv {{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_{i+1}[vw,xy])\) (mod 4) and \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_i[vw,xy]) = {{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_{i+1}[vw,xy])\) in the special case that \(e = e^\star \) and \(e'\) lies on an essential cycle that is respected by P and Q.

In general we can describe the obtained situation as follows. We are given a cycle and two edges ab and cd (with \(b\ne c\)) such that b and c lie on that cycle, but a and d not; see also Fig. 7. Hence, we can apply Lemma 3.5.

We distinguish two cases: if the interior of \(C_i\) lies locally to the right of \(R_i\) we define \(S=vw+R_i[w,x]+xy\) and \(T=vw+R_{i+1}[w,x]+xy\), and otherwise \(S=vw+R_{i+1}[w,x]+xy\) and \(T=vw+R_{i}[w,x]+xy\). We only consider the first case, as the other case is symmetric. By Lemma 3.5 we obtain \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(S)-{{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)={{\,\textrm{rot}\,}}\hspace{0.33325pt}(C_i)+r_v+r_y\). As \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C_i)\equiv 0\) (mod 4) and \(r_v,r_y\equiv 2\) (mod 4) we obtain \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(S)\equiv {{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)\) (mod 4) and with this \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_i[vw,xy]) \equiv {{\,\textrm{rot}\,}}\hspace{0.88882pt}(R_{i+1}[vw,xy])\) (mod 4). Altogether, in the general case we obtain \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(R_i) \equiv {{\,\textrm{rot}\,}}\hspace{0.33325pt}(R_{i+1})\).

Finally, we prove the second statement of the lemma. Hence, there are two essential cycles C and \(C'\) such that

  • \(C'\) lies in the interior of C,

  • e lies on C and \(e'\) lies on \(C'\), and

  • P and Q lie in the interior of C and in the exterior of \(C'\).

In particular, the paths P and Q respect \(C'\) as they lie in the exterior of \(C'\). We show that \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(S)={{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)\). First, we observe that \(R_i[e,vw]\) respects the cycle \(C_i\) by the simplicity of \(R_i\) and \(R_{i+1}\). In particular, vw lies in the exterior of \(C_i\) so that \(r_v=-2\). We distinguish the two cases whether \(C_i\) is essential or non-essential. If \(C_i\) is a non-essential cycle, the edge xy is also contained in the exterior of \(C_i\) as P and Q end on the essential cycle \(C'\), which both respect. Hence, we obtain \(r_y=-2\). Thus, we get by Lemmas 3.4 and 3.5 that \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(S)-{{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)={{\,\textrm{rot}\,}}\hspace{0.33325pt}(C_i)+r_v+r_y=4-2-2=0\). If \(C_i\) is an essential cycle, then the cycle \(C'\) is contained in the interior of \(C_i\) as both contain the central face, and \(C_i\) is composed by parts of paths that respect \(C'\). Consequently, the edge xy lies in the interior of \(C_i\) so that we obtain \(r_y=2\). By Lemmas 3.4 and 3.5 we get \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(S)-{{\,\textrm{rot}\,}}\hspace{0.33325pt}(T)={{\,\textrm{rot}\,}}\hspace{0.33325pt}(C_i)+r_v+r_y=0-2+2=0\). It remains to prove Claim 3.7. \(\square \)

Proof of Claim 3.7

We distinguish the four cases given by the definition of \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')\); see Fig. 9b. If S starts at the target of e and ends at the source of \(e'\), we obtain \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')={{\,\textrm{rot}\,}}\hspace{1.05545pt}(e+S+e')={{\,\textrm{rot}\,}}\hspace{1.05545pt}(e_2+S+e'_1)\) as subdividing e and \(e'\) transfers the directions of e and \(e'\) to \(e_2\) and \(e'_1\), respectively. Hence, we obtain

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S')&= {{\,\textrm{rot}\,}}{(S_1 + S + S_2)} \\&= {{\,\textrm{rot}\,}}{(e_3+e_4+e_2+ S + e'_1 + e'_3 +e'_4) }\\&= {{\,\textrm{rot}\,}}{(e_3+e_4+e_2)}+{{\,\textrm{rot}\,}}{(e_2+ S + e'_1)}+ {{\,\textrm{rot}\,}}{(e'_1 + e'_3 +e'_4)}\\&= 0 + {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e') + 0 = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e'). \end{aligned}$$

If S starts at the source of e and ends at the source of \(e'\), we obtain \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')={{\,\textrm{rot}\,}}{(\bar{e}+S+e')}+2={{\,\textrm{rot}\,}}{(\bar{e_1}+S+e'_1)}+2\) and with this we obtain

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S')&= {{\,\textrm{rot}\,}}{(S_1 + S + S_2) }\\&= {{\,\textrm{rot}\,}}{(e_3+e_4+\bar{e_1}+ S + e'_1 + e'_3 +e'_4)} \\&= {{\,\textrm{rot}\,}}{(e_3+e_4+\bar{e_1})}+{{\,\textrm{rot}\,}}{(\bar{e_1} + S + e'_1)}+ {{\,\textrm{rot}\,}}{(e'_1 + e'_3 +e'_4)}\\&= 2 + {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')-2 + 0 = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e'). \end{aligned}$$

If S starts at the target of e and ends at the target of \(e'\), we obtain \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')={{\,\textrm{rot}\,}}{(e+S+\bar{e'})}-2={{\,\textrm{rot}\,}}{(e_2+S+\bar{e'_2})}-2\) and with this we obtain

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S')&= {{\,\textrm{rot}\,}}{(S_1 + S + S_2)} \\&= {{\,\textrm{rot}\,}}{(e_3+e_4+e_2+ S + \bar{e'_2} + e'_3 +e'_4)} \\&= {{\,\textrm{rot}\,}}{(e_3+e_4+e_2)}+{{\,\textrm{rot}\,}}{(e_2+ S + \bar{e'_2})}+ {{\,\textrm{rot}\,}}{(\bar{e'_2} + e'_3 +e'_4)}\\&= 0 + {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')+ 2 - 2 = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e'). \end{aligned}$$

If S starts at the source of e and ends at the target of \(e'\), we obtain \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')={{\,\textrm{rot}\,}}{(\bar{e}+S+\bar{e'})}={{\,\textrm{rot}\,}}{(\bar{e_1}+S+\bar{e'_2})}\) and with this we obtain

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.33325pt}(S')&= {{\,\textrm{rot}\,}}{(S_1 + S + S_2) }\\&= {{\,\textrm{rot}\,}}{(e_3+e_4+\bar{e_1}+ S + \bar{e'_2} + e'_3 +e'_4)} \\&= {{\,\textrm{rot}\,}}{(e_3+e_4+\bar{e_1})+{{\,\textrm{rot}\,}}(\bar{e_1}+ S + \bar{e'_2})}+ {{\,\textrm{rot}\,}}{(\bar{e'_2} + e'_3 +e'_4)}\\&= 2 + {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e') - 2 = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e'). \end{aligned}$$

Altogether, this shows the claim \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,S,e')={{\,\textrm{rot}\,}}\hspace{0.33325pt}(S')\). \(\square \)

Corollary 3.8

If e is the reference edge \(e^\star \) and \(e'\) lies on an essential cycle that is respected by P and Q, then \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,P,e') = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,Q,e')\).

Proof

The statement directly follows from the second statement of Lemma 3.6 by assuming that C is the outermost essential cycle of \(\Gamma \) and \(C'\) is the cycle containing \(e'\). \(\square \)

Using this result, the geometric directions of all edges of a given ortho-radial representation \(\Gamma \) can be determined as follows. Let P be any reference path from the reference edge \(e^\star \) to any edge e, the edge e points right, down, left, and up if \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e^\star , P, e)\) is congruent to 0, 1, 2, and 3, respectively. Edges that point up or down are vertical and edges that point left or right are horizontal. Lemma 3.6 ensures that the result is independent of the choice of the reference path. In fact, Lemma 3.6 even gives a stronger result as we can infer the geometric direction of one edge from the geometric direction of another edge locally without having to resort to paths to the reference edge. We often implicitly make use of this observation in our proofs.

3.2 Drawable Ortho-Radial Representations

In this section we introduce concepts that help us to characterize the ortho-radial representations that have an ortho-radial drawing. To that end, consider an arbitrary bend-free ortho-radial drawing \(\Delta \) of a plane 4-graph G. As we assume throughout this work that the outer and central face are not the same, there is an essential cycle C that lies on the outer face f of \(\Delta \). Let e be a horizontal edge of C that points to the right and that lies on the outermost circle of the ortho-radial grid among all such edges, and let \(R_\Delta \) be the set of all edges \(e'\) with \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e,P,e')=0\) for any path P on f; see Fig. 11. We observe that \(R_\Delta \) is independent of the choice of e, because if there are multiple choices for e, then all of these edges are contained in \(R_\Delta \). We call the edges in \(R_\Delta \) the outlying edges of \(\Delta \). Note that not all outlying edges lie on the outermost circle of \(\Delta \); consider for example the edge \(e'\) in Fig. 11. Without loss of generality, we require that the reference edge of the according ortho-radial representation \(\Gamma \) stems from \(R_\Delta \); as \(R_\Delta \) is not empty and all of the edges in \(R_\Delta \) are possible candidates for being a reference edge, we can always change the reference edge of \(\Gamma \) to one of the edges in \(R_\Delta \).

An ortho-radial representation \(\Gamma \) of a graph G with reference edge \(e^\star \) is drawable if there exists a bend-free ortho-radial drawing \(\Delta \) of G embedded as specified by \(\Gamma \) such that the corresponding angles in \(\Delta \) and \(\Gamma \) are equal and the edge \(e^\star \) is an outlying edge, i.e., \(e^\star \in R_\Delta \). Note that it is not required that \(e^\star \) lies on the outermost circle of \(\Delta \). For example in Fig. 11 the edge \(e'\) is a suitable reference edge, but there is no drawing where \(e'\) lies on the outermost circle. Rather, the requirement is that every path along the outer face from \(e'\) to an edge on the outermost circle has rotation 0. Unlike for orthogonal representations, conditions (i) and (ii) do not guarantee that the ortho-radial representation is drawable; see Fig. 5. Therefore, we introduce a third condition, which is formulated in terms of labelings of essential cycles.

Let e be an edge on an essential cycle C in G and let P be a reference path from the reference edge \(e^\star \) to e that respects C. We define the label of e on C as \(\ell _C(e)={{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e^\star ,P,e)\). By Corollary 3.8 the label \(\ell _C(e)\) of e does not depend on the choice of P. However, if an edge e is contained in two essential cycles \(C_1\) and \(C_2\), then their labels may generally differ, i.e., \(\ell _{C_1}(e) \ne \ell _{C_2}(e)\). In fact, Fig. 12 shows that two cycles \(C_1,C_2\) may share two edges \(e,e'\) such that \(\ell _{C_1}(e) \ne \ell _{C_2}(e)\) and \(\ell _{C_1}(e') = \ell _{C_2}(e')\).

Fig. 11
figure 11

The outer face of an ortho-radial drawing. All outlying edges are marked blue

Fig. 12
figure 12

a Two cycles \(C_1\) and \(C_2\) may have both common edges with different labels (\(\ell _{C_1}(e)=4\ne 0 = \ell _{C_2}(e)\)) and ones with equal labels (\(\ell _{C_1}(e')=\ell _{C_2}(e')=0\)). b All labels of \(C_1[v,w]\) are positive, implying that \(C_1\) goes down. Note that not all edges of \(C_1[v,w]\) point downwards

We call the set of all labels of an essential cycle its labeling.

We call an essential cycle monotone if either all its labels are non-negative or all its labels are non-positive. A monotone cycle is a decreasing cycle if it has at least one strictly positive label, and it is an increasing cycle if it has at least one strictly negative label. We also refer to increasing and decreasing cycles as strictly monotone. An ortho-radial representation is valid if it contains no strictly monotone cycles. The validity of an ortho-radial representation ensures that on each essential cycle with at least one non-zero label there is at least one edge pointing up and one pointing down. We note that whether an essential cycle is monotone crucially depends on the reference edge. In Fig. 11 the cycle bounding the outer face is not monotone if e or \(e'\) is the reference edge, but it is strictly monotone if \(e''\) is the reference edge.

A main goal of this paper is to show that a graph with a given ortho-radial representation can be drawn if and only if the representation is valid. Further, we show how to test validity of a given representation and how to obtain a bend-free ortho-radial drawing from a valid ortho-radial representation in quadratic time. Altogether, this yields our main results:

Theorem 3.9

An ortho-radial representation is drawable if and only if it is valid.

Theorem 3.10

Given an ortho-radial representation \(\Gamma \), it can be determined in \(\text{\O }(n^2)\) time whether \(\Gamma \) is valid. In the negative case a strictly monotone cycle can be computed in \(\text{\O }(n^2)\) time.

Theorem 3.11

Given a valid ortho-radial representation, a corresponding drawing can be constructed in \(\text{\O }(n^2)\) time.

We prove the three theorems in the given order. Sections 46 deal with Theorem 3.9. In Sect. 7 we prove Theorem 3.10. In particular, together with the proof of Theorem 3.9 this already leads to a version of Theorem 3.11, but with a running time of \(\text{\O }(n^4)\). In Sect. 9 we show how to achieve \(\text{\O }(n^2)\) running time proving Theorem 3.11.

4 Transformations of Ortho-Radial Representations

In this section we introduce helpful tools that we use throughout this work. In the remainder of this work we assume that we are given an ortho-radial representation \(\Gamma \) with reference edge \(e^\star \).

Since the reference edge lies on an essential cycle by definition, we can compute the labelings of essential cycles via the rotation of paths as shown in the following lemma. This simplifies the arguments of our proofs.

Fig. 13
figure 13

Illustration of proof for Lemma 4.1. The outermost cycle \(C'\) contains the essential cycle C. There is always a reference path from s on \(C'\) to t on C respecting C. a The cycles C and \(C'\) have vertices in common. b The cycles C and \(C'\) are disjoint

Lemma 4.1

For every edge e on an essential cycle C there is a reference path P from \(e^\star \) to e such that P respects C, starts at the target of \(e^\star \) and ends on the source of e. Moreover, \(\ell _C(e)={{\,\textrm{rot}\,}}{(e^\star +P+e)}\).

Proof

Let Q be a reference path from the reference edge \(e^\star =rs\) to \(e=tu\) respecting C. We construct the desired reference path P as follows. Let \(C'\) be the outermost essential cycle, i.e., \(C'\) is the unique essential cycle such that every edge of \(C'\) bounds the outer face. If C and \(C'\) have a common vertex, we define v to be the first common vertex on \(C'\) after s; see Fig. 13a. We set \(P=C'[s,v] + C[v, t]\). By the choice of v this concatenation is a path. Moreover, it is a reference path from \(e^\star \) to e that respects C. If C and \(C'\) are disjoint, let v be the first vertex of Q lying on C and let w be the last vertex of Q before v that lies on \(C'\); see Fig. 13b. We set \(P=C'[s,w] + Q[w,v] + C[v,t]\). We observe that the concatenation P is a path by the choice of v and w, and that P is a reference path from \(e^\star \) to e respecting C.

By Corollary 3.8 we have \(\ell _{C}(e) = {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e^\star , P,e)\) since P is a reference path from \(e^\star \) to e respecting C. Further, since P starts at the target s of the reference edge \(e^\star \) and ends at the source t of the edge e, we can express the direction of P as \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}(e^\star , P, e)={{\,\textrm{rot}\,}}{(e^\star + P + e)}\). \(\square \)

The next lemma shows how we can change the reference edge \(e^\star \) on the unique essential cycle \(C_o\) whose edges are all incident to the outer face; Fig. 14 illustrates the lemma.

Fig. 14
figure 14

Illustration of proof for Lemma 4.2. The outermost cycle \(C_o\) contains the essential cycle C. Further, there is a reference path P from \(e^\star \) to an edge e on C. a The path P contains the edge \(e^{\star \star }\). b The path P does not contain the edge \(e^{\star \star }\)

Lemma 4.2

Let \(\Gamma \) be an ortho-radial representation and let \(e^\star \) be the reference edge of \(\Gamma \). Further, let \(C_o\) be the essential cycle that lies on the outer face and let \(e^{\star \star }\) be an edge on \(C_o\) such that \({{\,\textrm{rot}\,}}\hspace{1.111pt}(C_o[e^\star ,e^{\star \star }])=0\). For every edge e on an essential cycle C of \(\Gamma \) it holds \(\ell _C(e)=\overline{\ell }_C(e)\), where \(\overline{\ell }_C\) is the labeling of C with respect to \(e^{\star \star }\). In particular, \(\Gamma \) with reference edge \(e^\star \) is valid if and only if \(\Gamma \) with reference edge \(e^{\star \star }\) is valid.

Proof

Let e be an edge of an essential cycle C in \(\Gamma \) and let P be a reference path from \(e^\star \) to e. By Lemma 4.1 we assume that P starts at the target of \(e^\star \) and ends at the source of e. Without loss of generality we assume that only a prefix of P is part of \(C_o\). Further, let \(e^\star =st\) and \(e^{\star \star }=s't'\).

If P contains \(e^{\star \star }\), then

$$\begin{aligned} \ell _C(e)={{\,\textrm{rot}\,}}{(e^\star +P+e)}={{\,\textrm{rot}\,}}{(e^\star +P[t,e^{\star \star }])}+{{\,\textrm{rot}\,}}{(e^{\star \star }+P'+e)}, \end{aligned}$$

where \(P'\) is the suffix of P that starts at \(t'\); see Fig. 14a. By assumption \({{\,\textrm{rot}\,}}{(e^\star +P[t,e^{\star \star }])}=0\) and \(\overline{\ell }_C(e)={{\,\textrm{rot}\,}}{(e^{\star \star }+P'+e)}\).

If P does not contain \(e^{\star \star }\), then \(C_o[t',e^\star ]+P\) is a reference path of e with respect to \(e^{\star \star }\), which contains \(e^\star \); see Fig. 14b. Swapping \(e^\star \) and \(e^{\star \star }\) in the argument of the previous case yields the claim. Note that \({{\,\textrm{rot}\,}}\hspace{1.111pt}(C_o[e^{\star \star },e^\star ])=0\) as \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C_o)=0\). \(\square \)

In our arguments we frequently exploit certain symmetries. For an ortho-radial representation \(\Gamma \) we introduce two new ortho-radial representations, its flip \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) and its mirror \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\). Geometrically, viewed as a drawing on a cylinder, a flip corresponds to rotating the cylinder by an angle of \(\pi \) around a line perpendicular to the axis of the cylinder so that is upside down, see Fig. 15, whereas mirroring corresponds to mirroring it at a plane that is parallel to the axis of the cylinder; see Fig. 16. Intuitively, the first transformation exchanges left/right and top/bottom, and thus preserves monotonicity of cycles, while the second transformation exchanges left/right but not top/bottom, and thus maps increasing cycles to decreasing ones and vice versa. This intuition indeed holds with the correct definitions of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) and \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\), but due to the non-locality of the validity condition for ortho-radial representations and the dependence on a reference edge this requires some care. The following two lemmas formalize flipped and mirrored ortho-radial representations. We denote the reverse of a directed edge e by \(\bar{e}\).

Fig. 15
figure 15

Illustration of flipping the cylinder

Fig. 16
figure 16

Mirroring the cylinder

To define \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) it is necessary that the cycle bounding the central face \(f_c\) contains an edge \(e^{\star \star }\) with \(\ell _{f_c}(e^{\star \star }) = 0\). In particular, such an edge exists if the cycle bounding the central face is not strictly monotone. We choose \(\bar{e^{\star \star }}\) as the reference edge of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\). The central face of \(\Gamma \) becomes the outer face of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) and the outer face of \(\Gamma \) becomes the central face of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\). All other information of \(\Gamma \) is transferred to \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) without modification.

Lemma 4.3

(Flipping) Let \(\Gamma \) be an ortho-radial representation with outer face \(f_o\) and central face \(f_c\). If the cycle bounding the central face is not strictly monotone, then \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) is an ortho-radial representation such that

  1. (i)

    \(\bar{f}_c\) is the outer face of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) and \(\bar{f}_o\) is the central face of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\),

  2. (ii)

    \(\ell ^f_{\bar{C}}(\bar{e})=\ell _{C}(e)\) for all essential cycles C and edges e on C, where \(\ell ^f\) is the labeling in \(\bar{\Gamma }\).

In particular, increasing and decreasing cycles of \(\Gamma \) correspond to increasing and decreasing cycles of \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\), respectively.

Proof

As the local structure is unchanged, \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) is an ortho-radial representation. The essential cycles in \(\Gamma \) bijectively correspond to the essential cycles in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) by reversing the direction of the cycles. That is, any essential cycle C in \(\Gamma \) corresponds to the cycle \(\bar{C}\) in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\). Note that the reversal is necessary since we always consider essential cycles to be directed such that the center lies in its interior, which is defined as the area locally to the right of the cycle.

Consider any essential cycle C in \(\Gamma \). We denote the labeling of C in \(\Gamma \) by \(\ell _C\) and the labeling of \(\bar{C}\) in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) by \(\ell ^f_{\bar{C}}\). We show that for any edge e on C, \(\ell _C(e) = \ell ^f_{\bar{C}}(\bar{e})\), which in particular implies that any monotone cycle in \(\Gamma \) corresponds to a monotone cycle in \(\bar{\Gamma }\) and vice versa. By Lemma 4.1 there is a reference path P from the target of \(e^\star \) to the source of the edge e respecting C. Similarly, there is a path Q from the target of e to the source of \(e^{\star \star }\) that lies in the interior of C. The path \(\bar{Q}\) is a reference path from \(e^{\star \star }\) to \(\bar{e}\) respecting \(\bar{C}\) in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\).

Assume for now that \(P+e+Q\) is simple. We shall see at the end how the proof can be extended if this is not the case. By the choice of \(e^{\star \star }\), we have

$$\begin{aligned} 0 = \ell _{f_c}(e^{\star \star }) = {{\,\textrm{rot}\,}}{(e^\star + P + e + Q + e^{\star \star })} = {{\,\textrm{rot}\,}}{(e^\star + P + e)} + {{\,\textrm{rot}\,}}{(e + Q + e^{\star \star })}. \end{aligned}$$
(1)

Hence, \( {{\,\textrm{rot}\,}}{(e^\star + P + e)} = -{{\,\textrm{rot}\,}}{(e+Q+e^{\star \star })} ={{\,\textrm{rot}\,}}{(\bar{e^{\star \star }} +\bar{Q} + \bar{e})}\) and in total

$$\begin{aligned} \ell ^f_{\bar{C}}(\bar{e}) = {{\,\textrm{rot}\,}}{(\bar{e^{\star \star }} + \bar{Q} + \bar{e})} = {{\,\textrm{rot}\,}}{(e^\star + P + e)} = \ell _C(e). \end{aligned}$$
(2)

Thus, any monotone cycle in \(\Gamma \) corresponds to a monotone cycle in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) and vice versa.

Fig. 17
figure 17

Illustration of proof for Lemma 4.3. a The path P is a reference path from \(e^{\star }\) to e in \(\Gamma \) respecting C and the path Q is a reference path from \(e^{\star \star }\) to \(\bar{e}\) in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) respecting \(\bar{C}\). b The edge e is subdivided by a vertex x. Afterwards, G is cut at C such that the interior and the exterior get their own copies of C. The copies are connected by an edge between x and \(x'\)

If \(P+e+Q\) is not simple, we make it simple by cutting G at C such that the interior and the exterior of C get their own copies of C; see Fig. 17. We connect the two parts by an edge between two new vertices x and \(x'\) on the two copies of e, which we denote by vw in the exterior part and \(v'w'\) in the interior part. The new edge is placed perpendicular to these copies. The path \(P+vxx'w'+Q\) is simple and its rotation is 0. Hence, the argument above implies \(\ell ^f_{\bar{C}}(\bar{e}) = \ell _C(e)\). \(\square \)

We define \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) as follows. We reverse the direction of all faces and reverse the order of the edges around each vertex. The outer and central face are equal to those in \(\Gamma \) (except for the directions) and the reference edge is \(\bar{e^\star }\). By this definition \((e_1, e_2)\) is a combinatorial angle in \(\Gamma \) if and only if \((\bar{e}_2, \bar{e}_1)\) is a combinatorial angle in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\). We define \({{\,\textrm{rot}\,}}_{\textrm{mirror}\hspace{0.3888pt}(\Gamma )}(\bar{e}_2,\bar{e}_1) = {{\,\textrm{rot}\,}}_\Gamma (e_1, e_2)\), where the subscript indicates the ortho-radial representation that defines the rotation. Thus, edges that point left in \(\Gamma \) point right in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) and vice versa, but the edges that point up (down) in \(\Gamma \) also point up (down) in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\).

Lemma 4.4

(Mirroring) Let \(\Gamma \) be an ortho-radial representation with outer face \(f_o\) and central face \(f_c\). Then, \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) is an ortho-radial representation such that

  1. (i)

    \(\bar{f}_o\) is the outer face of \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) and \(\bar{f}_c\) is the central face of \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\),

  2. (ii)

    \(\ell ^m_{\bar{C}}(\bar{e})=-\ell _{C}(e)\) for all essential cycles C and edges e on C, where \(\ell ^m\) is the labeling in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\).

In particular, increasing and decreasing cycles of \(\Gamma \) correspond to decreasing and increasing cycles of \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\), respectively.

Proof

Note that the construction of \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) satisfies the conditions for ortho-radial representations. Let \(e=tu\) be an edge on an essential cycle C and let P be a reference path from \(e^\star =rs\) to e that respects C; by Lemma 4.1 we assume that P starts at s and ends at t. After mirroring, P still is a reference path from \(e^\star \) to e, but its rotation in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) may be different from its rotation in \(\Gamma \). As above, to distinguish the directions and rotations of paths in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) from the ones in \(\Gamma \), we include \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) and \(\Gamma \) as subscripts to \({{\,\textrm{rot}\,}}\) and \({{\,\mathrm{dir\hspace{0.94437pt}}\,}}\).

As P starts at s and ends at t we have by definition

$$\begin{aligned} {{\,\textrm{dir}\,}}_{\Gamma }(e^\star , P, e)&={{\,\textrm{rot}\,}}_{\Gamma }(e^\star + P + e),\\ {{\,\textrm{dir}\,}}_{\textrm{mirror}\hspace{0.3888pt}(\Gamma )}(\bar{e^\star }, P, \bar{e})&={{\,\textrm{rot}\,}}_{\textrm{mirror}\hspace{0.3888pt}(\Gamma )}(e^\star + P + e). \end{aligned}$$

As for any path Q we have \({{\,\textrm{rot}\,}}_{\Gamma }(Q) = -{{\,\textrm{rot}\,}}_{\textrm{mirror}\hspace{0.3888pt}(\Gamma )}(Q)\), we obtain \({{\,\textrm{dir}\,}}_{\textrm{mirror}\hspace{0.3888pt}(\Gamma )}(\bar{e^\star }, P, \bar{e}) = -{{\,\textrm{dir}\,}}_{\Gamma }(e^\star , P, e)\). By the definition of labels as directions of reference paths we directly obtain that \(\ell ^m_{\bar{C}}(\bar{e}) = -\ell _{C}(e)\). In particular, if C is increasing (decreasing) in \(\Gamma \), then \(\bar{C}\) is decreasing (increasing) in \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\). \(\square \)

5 Properties of Labelings

In this section we study the properties of labelings in more detail to derive useful tools for proving Theorem 3.9. Throughout this section, we are given an instance \((G,\mathcal E,f_c,f_o)\) with an ortho-radial representation \(\Gamma \) and a reference edge \(e^\star \). The following observation follows immediately from the definition of labels and the fact that the rotation of any essential cycle is 0.

Observation 5.1

Let C be an essential cycle. Then, for any two edges e and \(e'\) on C, it holds that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(C[e,e'])=\ell _C(e')-\ell _C(e)\).

The rest of this section is devoted to understanding the relationship between labelings of essential cycles that share vertices or edges. The following technical lemma is a key tool in this respect; see also Fig. 18.

Fig. 18
figure 18

Illustration of proof for Lemma 5.2. The essential cycles \(C_1\) and \(C_2\) intersect each other having a common vertex v. The essential cycle C bounds the central face of H

Lemma 5.2

Let \(C_1\) and \(C_2\) be two essential cycles and let \(H=C_1+C_2\) be the subgraph of G formed by \(C_1\) and \(C_2\). Let v be a common vertex of \(C_1\) and \(C_2\) that is incident to the central face of H. For \(i=1,2\), let further \(u_i\) and \(w_i\) be the vertices preceding and succeeding v on \(C_i\), respectively. Then \(\ell _{C_1}(vw_1) = \ell _{C_1}(u_1v) + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(u_1vw_1) = \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1)\). Moreover, if \(w_1=w_2\), then \(\ell _{C_1}(vw_1)=\ell _{C_2}(vw_2)\).

Proof

By Observation 5.1 it holds that \(\ell _{C_1}(vw_1) = \ell _{C_1}(u_1v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_1vw_1)\).

Let C be the cycle that bounds the central face of H. First assume that the edge \(vw_1\) is incident to the central face of H. Every reference path that respects \(C_1\) also respects C. Hence,

$$\begin{aligned} \ell _{C}(vw_1) = \ell _{C_1}(vw_1). \end{aligned}$$

Therefore, our goal is to show \(\ell _{C}(vw_1) = \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1)\).

Let P be a reference path from the reference edge rs to \(u_2v\) respecting \(C_2\). By Lemma 4.1 we assume that P starts at the target of the reference edge. Further, we assume that P contains either \(u_2\) or v but not both.

Let x be the first vertex of P that lies on \(C_2\). If \(x\ne v\), then \(Q = P[s, x] + C_2[x, u_2]\) is a reference path for \(u_2v\) that respects \(C_2\) and does not contain v. Then, \(Q' = Q + u_2v\) is a reference path for \(vw_1\) respecting C. Hence,

$$\begin{aligned} \ell _{C}(vw_1)= & {} {{\,\textrm{rot}\,}}{(e^\star + Q' + vw_1)} = {{\,\textrm{rot}\,}}{(e^\star + Q + u_2v)} + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1) \\= & {} \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1). \end{aligned}$$

Now assume that \(x=v\). Let \(Q = P[s, v]\) and let y be the vertex before v on Q. The vertex y lies strictly in the exterior of \(C_2\) and thus not on C. In particular, \(y\ne w_1\).

By local consistency we get

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{0.7222pt}(yvu_2) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(w_1vy) = 2. \end{aligned}$$

Since Q respects \(C_2\) and thus also C, we find

$$\begin{aligned} \ell _{C_2}(u_2v)&= {{\,\textrm{rot}\,}}{(e^\star + Q + vu_2) }- 2 = {{\,\textrm{rot}\,}}\hspace{1.111pt}(e^\star + Q) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(yvu_2) - 2, \\ \ell _{C}(vw_1)&= {{\,\textrm{rot}\,}}{(e^\star + Q + vw_1)}= {{\,\textrm{rot}\,}}\hspace{1.111pt}(e^\star + Q) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(yvw_1). \end{aligned}$$

Subtracting the first equation from the second we get

$$\begin{aligned} \ell _{C}(vw_1) - \ell _{C_2}(u_2v)&= {{\,\textrm{rot}\,}}\hspace{0.66666pt}(yvw_1) - {{\,\textrm{rot}\,}}\hspace{0.66666pt}(yvu_2) + 2\\&= -{{\,\textrm{rot}\,}}\hspace{0.7222pt}(w_1vy) - {{\,\textrm{rot}\,}}\hspace{0.66666pt}(yvu_2) + 2\\&= {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1), \end{aligned}$$

where the last step uses the equation obtained by local consistency.

If \(vw_1\) does not lie on C, then the edge \(vw_2\) does. By swapping the roles of \(C_1\) and \(C_2\) and using the same argument as above, we obtain

$$\begin{aligned} \ell _{C_1}(u_1v) + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(u_1vw_2) = \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_2). \end{aligned}$$

Since \(vw_1\) lies locally to the left of both \(u_1vw_2\) and \(u_2vw_2\), it is \({{\,\textrm{rot}\,}}\hspace{0.66666pt}(u_ivw_1)={{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_ivw_2)-\alpha \) for \(i=1,2\) and the same constant \(\alpha \), which is either 1 or 2. Hence, we get

$$\begin{aligned} \ell _{C_1}(vw_1)&= \ell _{C_1}(u_1v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_1vw_1) = \ell _{C_1}(u_1v)+ {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_1vw_2)-\alpha \\ {}&= \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_2) -\alpha = \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1). \end{aligned}$$

Finally, if \(w_1=w_2\), i.e., \(vw_1\) lies on both \(C_1\) and \(C_2\), then \(\ell _{C_1}(vw_1) = \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1) =\ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_2) = \ell _{C_2}(vw_2)\). \(\square \)

Corollary 5.3

Let \(C_1\) and \(C_2\) be two essential cycles, let \(H=C_1+C_2\) be the subgraph of G formed by \(C_1\) and \(C_2\), and let e be an edge that lies on both \(C_1\) and \(C_2\) and that is incident to the central face of H. Then \(\ell _{C_1}(e) = \ell _{C_2}(e)\).

This allows us to prove an important criterion to exclude strictly monotone cycles. We call an essential cycle C horizontal if \(\ell _C(e) = 0\) for all edge e of C. We show that a strictly monotone cycle and a horizontal cycle cannot share vertices.

Proposition 5.4

Let \(C_2\) be a horizontal cycle and let \(C_1\) be an essential cycle that shares at least one vertex with \(C_2\). Then \(C_1\) is not strictly monotone.

Fig. 19
figure 19

Illustration of proof for Proposition 5.4. All edges of \(C_2\) are labeled with 0. In this situation there are edges on \(C_1\) with labels \(-1\) and 1. Hence, \(C_2\) is neither increasing nor decreasing

Proof

The situation is illustrated in Fig. 19.

If the two cycles are equal, the claim clearly holds. Otherwise, we show that one can find two edges on \(C_1\) whose labels have opposite signs.

Let v be a shared vertex of \(C_1\) and \(C_2\) that is incident to the central face f of \(H=C_1 + C_2\) and such that the edge \(vw_1\) on C is not incident to f. For \(i=1,2\) denote by \(u_i\) and \(w_i\) the vertex preceding and succeeding v on \(C_i\), respectively. By Lemma 5.2 it is

$$\begin{aligned} \ell _{C_1}(vw_1)=\ell _{C_2}(u_2v)+{{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1) = {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1), \end{aligned}$$
(3)

where the second equality follows from the assumption that \(\ell _{C_2}(u_2v)=0\).

Let y be the first common vertex of \(C_1\) and \(C_2\) on the central face f after v. That is, \(f[v,y]\) is a part of one of the cycles \(C_1\) and \(C_2\), and it intersects the other cycle only at v and y. For \(i=1,2\), we denote by \(x_i\) and \(z_i\) the vertices preceding and succeeding y on \(C_i\). Again by Lemma 5.2 (this time swapping the roles of \(C_1\) and \(C_2\)), we have

$$\begin{aligned} 0 = \ell _{C_2}(yz_2) = \ell _{C_1}(x_1y)+{{\,\textrm{rot}\,}}\hspace{0.7222pt}(x_1yz_2). \end{aligned}$$
(4)

Overall, we have \(\ell _{C_1}(vw_1) = {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1)\) and \(\ell _{C_1}(x_1y) = -{{\,\textrm{rot}\,}}\hspace{0.7222pt}(x_1yz_2)\).

By construction \(vw_1\) and \(x_1y\) lie on the same side of \(C_2\). Hence, \(u_2vw_1\) and \(x_1yz_2\) both make a right turn if \(vw_1\) and \(x_1y\) lie in the interior of \(C_2\) and a left turn otherwise. Thus, it is \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1)={{\,\textrm{rot}\,}}\hspace{0.7222pt}(x_1yz_2)\ne 0\), and therefore \(\ell _{C_1}(vw_1)\) and \(\ell _{C_1}(x_1y)\) have opposite signs. Hence, \(C_1\) is not strictly monotone. \(\square \)

In many cases we cannot assume that one of two essential cycles sharing a vertex is horizontal. However, we can still draw conclusions about their intersection behavior from their labelings and find conditions under which shared edges have the same label on both cycles.

Intuitively, positive labels can often be interpreted as going downwards and negative labels as going upwards. In Fig. 12b all edges of \(C_1[v,w]\) have positive labels and in total the distance from the center decreases along this path, i.e., the distance of v from the center is greater than the distance of w from the center. Yet, the edges on \(C_1[v,w]\) point in all possible directions—even upwards. One can still interpret a maximal path with positive labels as leading downwards with the caveat that this is a property of the whole path and does not impose any restriction on the directions of the individual edges.

Using this intuition, we expect that a path P going down cannot intersect a path Q going up if P starts below Q. In Lemma 5.5, we show that this assumption is correct if we restrict ourselves to intersections on the central face.

Lemma 5.5

Let \(C_1\) and \(C_2\) be two simple, essential cycles in G sharing at least one vertex. Let \(H = C_1 + C_2\), and denote the central face of H by f. Let v be a vertex that is shared by \(C_1\) and \(C_2\) that is incident to f and, for \(i=1,2\), let \(u_i\) and \(w_i\) be the vertices preceding and succeeding v on \(C_i\), respectively.

  1. (i)

    If \(\ell _{C_1}(u_1v)\geqslant 0\) and \(\ell _{C_2}(u_2v)\leqslant 0\), then \(u_2v\) lies in the interior of \(C_1\).

  2. (ii)

    If \(\ell _{C_1}(vw_1)\geqslant 0\) and \(\ell _{C_2}(vw_2)\leqslant 0\), then \(vw_2\) lies in the exterior of \(C_1\).

Proof

The second case follows from the first by taking the mirror representation; this reverses the order on the cycles and changes the sign of each label by Lemma 4.4, but does not change the notion of interior and exterior. It therefore suffices to consider the first case.

Since the central face f lies in the interior of both \(C_1\) and \(C_2\) and v lies on the boundary of f, one of the edges \(vw_1\) and \(vw_2\) is incident to f. We denote this edge by vx and it is either \(x=w_1\) (as in Fig. 20a) or \(x=w_2\). By Lemma 5.2, we have \(\ell _{C_1}(u_1v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_1vx) = \ell _{C_2}(u_2v) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vx)\). Applying \(\ell _{C_1}(u_1v)\geqslant 0\) and \(\ell _{C_2}(u_2v)\leqslant 0\), we obtain \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_1vx) \leqslant {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vx)\). Therefore, \(u_2v\) lies to the right of or on \(u_1vx\) and thus in the interior of \(C_1\). \(\square \)

The next lemma is a direct consequence of Lemma 5.5 when applied to decreasing and increasing cycles.

Lemma 5.6

A decreasing and an increasing cycle do not have any common vertex.

Fig. 20
figure 20

Possible intersection of two cycles C and \(C'\) at v. a The labels of the incoming edges satisfy \(\ell _{C_1} (u_1v)\geqslant 0\) and \(\ell _{C_2}(u_2v)\leqslant 0\). The edges \(vw_1\) and \(vw_2\) could be exchanged. b The labels of the outgoing edges satisfy \(\ell _{C_1}(vw_1)\geqslant 0\) and \(\ell _{C_2}(vw_2)\leqslant 0\). The edges \(u_1v\) and \(u_2v\) could be exchanged

Fig. 21
figure 21

Illustration of proof for Lemma 5.6. The cycle \(C_1\) is increasing and the cycle \(C_2\) is decreasing. The edge of \(C_2\) ending at v strictly lies in the exterior of \(C_1\) and the edge of \(C_2\) starting at w strictly lies in the interior of \(C_1\). Hence, the edge of \(C_2\) ending at x strictly lies in the interior of \(C_1\), which contradicts Lemma 5.5

Proof

For an illustration see Fig. 21. Let \(C_1\) be an increasing and \(C_2\) a decreasing cycle. Assume that they have a common vertex. But then there also is a common vertex on the central face f of the subgraph \(C_1+C_2\). Consider any maximal common path P of \(C_1\) and \(C_2\) on f. We denote the start vertex of P by v and the end vertex by w. Note that v may equal w. By Lemma 5.5 the edge to v on the decreasing cycle \(C_2\) lies strictly in the exterior of \(C_1\), where the strictness follows from the maximality of P. Similarly, the edge from w on \(C_2\) lies strictly in the interior of \(C_1\). Hence, \(C_2[w,v]\) crosses \(C_1\). Let x be the first intersection of \(C_1\) and \(C_2\) on f after w. Then the edge to x on \(C_2\) lies strictly in the interior of \(C_1\), contradicting Lemma 5.5. \(\square \)

For the correctness proof in Sect. 7, a crucial insight is that for essential cycles using an edge that is part of a regular face, we can find an alternative cycle without this edge in a way that preserves labels on the common subpath.

Lemma 5.7

If an edge e belongs to both a simple essential cycle C and a regular face f, then there exists a simple essential cycle \(C'\) that can be decomposed into two paths P and Q such that

  1. (i)

    P or \(\bar{P}\) lies on f,

  2. (ii)

    \(Q = C \cap C'\), and

  3. (iii)

    \(\ell _C(e) = \ell _{C'}(e)\) for all edges e on Q.

Fig. 22
figure 22

The edge e cannot lie on both the outer and the central face. In both cases \(C'\) can be subdivided in two paths P and Q on C and f, respectively. Here, these paths are separated by the vertices a and b. a The cycle bounding the outer face is \(C'\). The edge e does not lie on the outer face, and hence the cycle bounding this face is defined as \(C'\). b The cycle bounding the central face is \(C'\)

Proof

Consider the graph \(H=C+f\) composed of the essential cycle C and the regular face f. Since e is incident to f, the edge e cannot lie on both the outer and the central face in H. If e does not lie on the outer face, we define \(C'\) as the cycle bounding the outer face but directed such that it contains the center in its interior; see Fig. 22a. Otherwise, \(C'\) denotes the cycle bounding the central face; see Fig. 22b.

Since C lies in the exterior of f, the intersection of C with \(C'\) forms one contiguous path Q. Setting \(P=C'-Q\) yields a path that lies completely on f (it is possible though that P and f are directed differently).

By the construction of \(C'\) the edges of Q are incident to the central face of \(C+C'\). Then Lemma 5.2 implies that \(\ell _{C}(e) = \ell _{C'}(e)\) for all edges e of Q. \(\square \)

The last lemma of this section shows that we can replace single edges of an essential cycle C with complex paths without changing the labels of the remaining edges on C.

Lemma 5.8

Let C be an essential cycle in an ortho-radial representation \(\Gamma \) and let uv be an edge of C. Consider an ortho-radial representation \(\Gamma '\) that is created by replacing uv with a path P such that the interior vertices of P do not belong to \(\Gamma \), i.e., they are newly inserted vertices in \(\Gamma '\). If the cycle \(C'=C[v,u]+P\) is essential, then the labels of C and \(C'\) coincide on \(C[v,u]\,({=}\,C'[v,u])\).

Proof

For an illustration of the proof see Fig. 23. Let \(e=xy\) be an arbitrary edge on C[vu] and let R be a reference path from the reference edge \(e^\star \) to e that respects C. We first construct a new reference path \(R'\) that does not contain uv as follows. Let w be the first vertex of R that lies on C. If C[wx] does not contain e, we define \(R'=R-R[w,x]+C[w,x]\) and otherwise \(R'=R-R[w,x]+\bar{C}[w,y]\). We observe that \(R'\) is again a reference path of e that respects C. Further, it can be partitioned into a prefix that only consists of edges that do not belong to C and a suffix that only consists of edges that belong to C[vu].

We now show that \(R'\) is a reference path of e in \(\Gamma '\) that respects \(C'\). As \(R'\) does not use uv, it is still contained in \(\Gamma '\) and hence it is a reference path of e. So assume that \(R'\) does not respect \(C'\). Hence, \(R'\) and \(C'\) have a vertex z in common such that the outgoing edge \(e'\) of \(R'\) at z strictly lies in the interior of \(C'\). As \(R'\) respects C, this vertex lies on P. It cannot be an intermediate vertex of P, because these are newly inserted in \(\Gamma '\). Hence, z is either u or v and thus part of C[vu]. In particular, it occurs on \(R'\) after w, which implies that \(e'\) belongs to C. This contradicts that \(e'\) strictly lies in the interior of \(C'\). Altogether, this shows that \(R'\) is a reference path of e both in \(\Gamma \) and \(\Gamma '\) such that C and \(C'\) are respected. Consequently, \(\ell _C(e) = \ell _{C'}(e)\). \(\square \)

Fig. 23
figure 23

Illustration of the proof for Lemma 5.8. The reference path \(R'\) (green) for the edge xy is constructed based on the reference path R. Replacing the edge uv with a path P, does not impact \(R'\), which implies that the label of xy remains the same

6 Characterization of Rectangular Ortho-Radial Representations

Throughout this section, assume that \(I=(G,\mathcal E,f_c,f_o)\) is an instance with an ortho-radial representation \(\Gamma \) and a reference edge \(e^\star \). We prove Theorem 3.9 for the case that \(\Gamma \) is rectangular. In a rectangular ortho-radial representation the central face and the outer face are horizontal cycles, and every regular face is a rectangle, i.e., it has exactly four right turns, but no left turns.

We first observe that a bend-free ortho-radial drawing \(\Delta \) can be described by an angle assignment together with the lengths of its vertical edges and the angles of the circular arcs representing the horizontal edges; we call the angles of the circular arcs central angles. We define two flow networks that assign consistent lengths and central angles to the vertical edges and horizontal edges, respectively. These networks are straightforward adaptions of the networks used for drawing rectangular graphs in the plane [34]. In the following, vertex and edge refer to the vertices and edges of G, whereas node and arc are used for the flow networks.

Fig. 24
figure 24

Flow networks \(N_{\textrm{ver}}\) and \(N_{\textrm{hor}}\) (blue arcs) for an example graph G (black edges)

The network \(N_{\textrm{ver}}=(F_{\textrm{ver}},A_{\textrm{ver}})\) contains one node for each face of G except for the central and the outer face. All nodes have a demand of 0. For each vertical edge e in G, which we assume to be directed upwards, there is an arc \(a_e=fg\) in \(N_{\textrm{ver}}\), where f is the face to the left of e and g the one to its right. The flow on fg has the lower bound \(l(fg)=1\) and upper bound \(u(fg)=\infty \). An example of this flow network is shown in Fig. 24a.

Similarly, the network \(N_{\textrm{hor}}=(F_{\textrm{hor}},A_{\textrm{hor}})\) assigns the central angles of the horizontal edges. There is a node for each face of G, and an arc \(a_e=fg\) for every horizontal edge e in G such that f lies locally below e and g lies locally above e. Additionally, \(N_{\textrm{hor}}\) includes one arc from the outer to the central face. Again, all edges require a minimum flow of 1 and have infinite capacity. The demand of all nodes is 0. Figure 24b shows an example of such a flow network. Valid flows in these two flow networks then yield an ortho-radial drawing of \(\Gamma \).

Lemma 6.1

A pair of valid flows in \(N_{\textrm{hor}}\) and \(N_{\textrm{ver}}\) corresponds to a bend-free ortho-radial drawing of \(\Gamma \) and vice versa.

Proof

Given a bend-free ortho-radial drawing \(\Delta \) of \(\Gamma \), we can extract flows in the two networks. For each vertical edge e we set the flow \(\varphi _{\textrm{ver}}(a_e)\) of the corresponding arc \(a_e\) to \(l_e/l_{\min }\), where \(l_e\) is the length of e in \(\Delta \) and \(l_{\min }\) is the length of the shortest edge in \(\Delta \). With the scaling, we ensure that the flow of each arc is at least 1. Similarly, for the horizontal edges we assign to each arc \(a_e\) of each horizontal edge e the flow \(\varphi _{\textrm{hor}}(a_e) = \alpha _e/\alpha _{\min }\), where \(\alpha _e\) is the central angle of e in \(\Delta \) and \(\alpha _{\min }\) is the smallest central angle of any horizontal edge in \(\Delta \). Again, the scaling ensures that each arc has flow at least 1. Since the opposing vertical sides of the regular faces have the same lengths and the opposing horizontal sides of the regular faces have the same central angles, the flow is preserved at all nodes.

Conversely, given feasible flows in the flow networks, we construct a corresponding drawing by interpreting the flow values in \(\varphi _{\textrm{ver}}\) as edge lengths, and the flow values in \(\varphi _{\textrm{hor}}\) as central angles. The flow conversation ensures that opposing sides have the same lengths (vertical edges) and same central angles (horizontal edges), respectively. To obtain a drawing, we normalize the central angles so that the total flow on the back edge of \(N_{\textrm{hor}}\) is \(2\pi \). To prove that this works, we reduce it to the orthogonal case by cutting performing a straight-line cut from the central face to the outer face.

Fig. 25
figure 25

Illustration of proof of Lemma 6.1. a The ortho-radial representation is cut along the vertical path that goes from the center to the outer face. b The path P ends at a face at vertex v. The face is divided into two sub-faces

First observe that if there exists a path P of only vertical edges that runs from a vertex incident to the central face to a vertex incident to the outer face, then we can split this path into a left copy \(P_\textrm{l}\) and a right copy \(P_\textrm{r}\) as in Fig. 25a. Then the resulting flow corresponds to an orthogonal drawing (on the standard grid). However, since for each edge e of G its copies on \(P_\textrm{l}\) and \(P_\textrm{r}\) have the same lengths, this orthogonal drawing can be merged into an ortho-radial drawing.

We now show that, if G does not contain such a path, then we can augment G so it contains one. Let P be the maximum length path of only upward edges that starts at a vertex incident to the central face. Assume P ends at a vertex v and that has no edge pointing upward; see Fig. 25b. Since \(\Gamma \) is rectangular, the vertex v then has left and right-pointing edges, and we denote by f the face between them. By assumption f is not the outer face and it is therefore regular. Let B be the right-ward path that bounds the bottom side of f; we denote the first vertex of B by \(b_1\). We observe that v lies on B. Let \(\phi _B = \sum _{e \in B[b_1, v]} \varphi _{\textrm{hor}}(a_e)\) denote the sum of the flow values of \(N_{\textrm{hor}}\) on the arcs that correspond to edges of \(B[b_1, v]\), where \(a_e\) denotes the arc of e in \(N_{\textrm{hor}}\). Consider now the right-ward path \(T=t_1,\dots ,t_k\) that bounds the top side of f. Let i be the smallest index such that \(\phi _T = \sum _{e \in T[t_1,t_i]} \varphi _{\textrm{hor}}(a_e) \ge \phi _B\). If \(\phi _B = \phi _T\), then we add to \(\Gamma \) the vertical edge \(vt_i\), thereby splitting f into a left \(f_\textrm{l}\) and a right face \(f_\textrm{r}\). We then reconnect the incoming arcs of f before v to \(f_\textrm{l}\) and the incoming arcs after v to \(f_\textrm{r}\). Similarly, we reconnect the outgoing arcs of f before \(t_i\) to \(f_\textrm{l}\) and the outgoing arcs of f after \(t_i\) to \(f_\textrm{r}\). Observe that, by construction, we have flow conservation at \(f_\textrm{l}\) and \(f_\textrm{r}\) and we have extended the maximum length of an outward path from the central face.

Now assume \(\phi _B < \phi _T\). In that case, we add a subdivision vertex \(t'\) on the edge \(t_{i-1}t_i\). We then add the edge \(vt'\), thereby again splitting the face f into a left face \(f_\textrm{l}\) and a right face \(f_\textrm{r}\). As before, we reconnect the incoming arcs before v to \(f_\textrm{l}\) and the incoming arcs after v to \(f_\textrm{r}\). The outgoing edges of f that correspond to an edge of \(T[t_1,t_{i-1}]\) we simply reconnect to \(f_\textrm{l}\) and similarly, we reconnect the outgoing edges of f that correspond to an edge of \(T[t_i,t_k]\) to \(f_\textrm{r}\). The flow on the outgoing edge fg that corresponds to \(t_{i-1}t_i\), we split on the two edges \(f_\textrm{l}g\) and \(f_\textrm{r}g\) in such a way that the total outflow of \(f_\textrm{l}\) is \(\phi _B\). Observe that this yields again a valid flow in the augmented flow network. Thus also in this case, we have extended the maximum length of an outward path from the central face. Observe further that a drawing of the modified ortho-radial representation \(\Gamma '\) contains a drawing of \(\Gamma \). It follows that \(\Gamma \) is drawable. \(\square \)

Using this correspondence of drawings and feasible flows, we show the characterization of rectangular graphs.

Theorem 6.2

Let \(\Gamma \) be a rectangular ortho-radial representation and let \(N_{\textrm{hor}}=(F_{\textrm{hor}}, A_{\textrm{hor}})\) and \(N_\text {ver}=(F_{\textrm{ver}}, A_{\textrm{ver}})\) be the flow networks as defined above. The following statements are equivalent:

  1. (i)

    \(\Gamma \) is drawable.

  2. (ii)

    \(\Gamma \) is valid.

  3. (iii)

    For every subset \(S\subseteq F_{\textrm{ver}}\) such that there is an arc from \(F_{\textrm{ver}}\setminus S\) to S in \(N_{\textrm{ver}}\), there is also an arc from S to \(F_{\textrm{ver}}\setminus S\).

Proof

“(i) \(\Rightarrow \) (ii)”: Let \(\Delta \) be a bend-free ortho-radial drawing of G preserving the embedding described by \(\Gamma \) and let C be an essential cycle. Our goal is to show that C is not strictly monotone. To this end, we construct a path P from the reference edge of \(\Gamma \) to a vertex on C such that either the labeling of C induced by P attains both positive and negative values or it is 0 everywhere.

In \(\Delta \) either all vertices of C lie on the same concentric circle, or there is a maximal subpath Q of C whose vertices all have maximum distance to the center of the ortho-radial grid among all vertices of C. In the first case, we may choose the endpoint v of the path P arbitrarily, whereas in the second case we select the first vertex of Q as v; for an example see Fig. 26.

Fig. 26
figure 26

The path P from s to v—constructed backwards by going only up or left—does not intersect the interior of C. The rotations of the edges on P relative to \(e^\star \) are 0 or 1

We construct the path P backwards (i.e., the construction yields \(\bar{P}\)) as follows: Starting at v we choose the edge going upwards from v, if it exists, or the one leading left. Since all faces of \(\Gamma \) are rectangles, at least one of these always exists. This procedure is repeated until the target s of the reference edge is reached.

To show that this algorithm terminates, we assume that this was not the case. As G is finite, there must be a first time a vertex w is visited twice. Hence, there is a cycle \(C'\) in \(\Delta \) containing w that contains only edges going left or up. As all drawable essential cycles with edges leading upwards must also have edges that go down [21], all edges of \(C'\) are horizontal. By construction, there is no edge incident to a vertex of \(C'\) that leads upwards. The only cycle with this property, however, is the one enclosing the outer face because G is connected. But this cycle contains the reference edge, and therefore the algorithm halts.

This not only shows that the construction of P ends, but also that P is a path (i.e., the construction does not visit a vertex twice). Thus, P is a reference path from the reference edge \(e^\star \) to the edge \(vv'\), where \(v'\) is the vertex following v on C. Further, P respects C as \(\bar{P}\) starts at the outermost circle of the ortho-radial grid that is used by C and as by construction all edges of \(\bar{P}\) point left or upwards.

By the construction of P, the label of \(vv'\) induced by P is 0. If all edges of C are horizontal, this implies \(\ell _C(e)=0\) for all edges e of C, which shows that C is not strictly monotone. Otherwise, we claim that the edges \(e_-=uv\) and \(e_+=wx\) directly before and after Q on C have labels \(-1\) and \(+1\), respectively. Since all edges on Q are horizontal and \(e_-\) goes down, we have \({{\,\textrm{rot}\,}}{(C[v,x])}=1\) and therefore \(\ell _C(e_+)=1\). Similarly, \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(uvv')=1\) implies that \(\ell _C(uv)=\ell _C(vv') - {{\,\textrm{rot}\,}}\hspace{0.7222pt}(uvv')=-1\).

“(ii) \(\Rightarrow \) (iii)”: Instead of proving this implication directly, we show the contrapositive. That is, we assume that there is a set \(S\subsetneq F_\text {ver}\) of nodes in \(N_\text {ver}\) such that S has no outgoing but at least one incoming arc. From this assumption we derive that \(\Gamma \) is not valid, as we find a strictly monotone cycle.

Let \(N_{\textrm{ver}}[S]\) denote the node-induced subgraph of \(N_{\textrm{ver}}\) induced by the set S. Without loss of generality, S can be chosen such that \(N_{\textrm{ver}}[S]\) is weakly connected, i.e., the underlying undirected graph is connected. If \(N_{\textrm{ver}}\) is not weakly connected, at least one weakly-connected component of \(N_{\textrm{ver}}[S]\) possesses an incoming arc but no outgoing arc, and we can work with this component instead.

As each node of S corresponds to a face of G, S can also be considered as a collection of faces of G. To distinguish the two interpretations of S, we refer to this collection of faces by \(\mathcal {S}\). Our goal is to show that the innermost or the outermost boundary of \(\mathcal {S}\) forms a strictly monotone cycle in \(\Gamma \).

Fig. 27
figure 27

A set S of nodes in a graph G such that \(N_\text {ver}[S]\) has no outgoing but two incoming arcs a and \(a'\). The set of faces \(\mathcal {S}\) corresponding to the nodes in S are shaded with blue. The outermost boundary of \(\mathcal {S}\) forms an increasing cycle C. The edges on this cycle with label \(-1\) are exactly those that are crossed by a or \(a'\). All other edges on C are labeled with 0. Note that the edge on C at the bottom is curved because G does not admit an ortho-radial drawing

Figure 27 shows an example of such a set S of nodes. Here, the arcs a and \(a'\) lead from a node outside of S to one in S. These arcs cross edges on the outer boundary of \(\mathcal {S}\), which point upwards.

Let \(\mathcal F\) be the set of faces of \(\mathcal E\) (including the central and outer face). Let Z be a connected component of \(\mathcal F\setminus \mathcal S\) such that there exists an arc from Z to S in \(N_{\textrm{ver}}\) and let C be the cycle in G that separates Z from \(\mathcal S\). If C were non-essential, then \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(C)=4\) and C would therefore contain an upward and a downward edge. One of these edges would correspond to an incoming arc of S and the other edge to an outgoing arc of S, contradicting the choice of S. Thus, C is essential.

As usual we consider C in clockwise direction. We may assume without loss of generality that C contains \(\mathcal S\) in its interior; otherwise, we consider \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\) and \(\bar{C}\). Note that for each edge of C the face locally to the right belongs to \(\mathcal S\) whereas the face locally to the left does not. Hence, upward edges of C correspond to incoming arcs of S and downward edges to outgoing arcs. Since there is an arc from Z to S but not vice versa, the cycle C contains at least one upward but no downward edge. Hence, there is some integer k such that all labels of C belong to \(L_k=\{4k, 4k+1, 4k+2\}\). Since the numbers in \(L_k\) are either all non-negative (if \(k\geqslant 0\)) or all negative (if \(k<0\)), the cycle C is monotone. Moreover, C is not horizontal because it has an upward edge.

“(iii) \(\Rightarrow \) (i)”: By Lemma 6.1 the existence of a drawing is equivalent to the existence of feasible flows in \(N_{\textrm{hor}}\) and \(N_{\textrm{ver}}\). If a flow network N contains for each arc a a cycle \(C_a\) that contains a, then routing one unit flow along each of these cycles \(C_a\) and adding all flows gives a circulation in N where at least one unit flows along each arc. Hence, it suffices to prove that in \(N_{\textrm{hor}}\) and in \(N_{\textrm{ver}}\) each arc is contained in a cycle.

Note that \(N_{\textrm{hor}}\) without the arc from the outer face g to the central face f is a directed acyclic graph with f as its only source and g as its only sink. For each arc \(a\ne gf\) in \(N_{\textrm{hor}}\) there is a directed path \(P_a\) from f to g via a. Adding the arc gf, we obtain the cycle \(C_a=P_a+gf\).

For \(N_{\textrm{ver}}\) we consider an arc \(a=fg\), and we define the set \(S_g\) of all nodes h for which there exists a directed path from g to h in \(N_{\textrm{ver}}\). By definition, there is no arc from a vertex in \(S_g\) to a vertex not in \(S_g\). As \(N_{\textrm{ver}}\) satisfies (iii), \(S_g\) does not have any incoming arcs either. Hence, \(f\in S_g\) and there is a directed path \(P_a\) from g to f. Then \(C_a=P_a+fg\) is the desired cycle. \(\square \)

By [21] the angle assignment defined by an ortho-radial drawing of a graph is locally consistent (in the sense of Definition 3.1). Therefore, Theorem 6.2 implies the characterization of ortho-radial drawings for rectangular graphs.

Corollary 6.3

(Theorem 3.9 for Rectangular Ortho-Radial Representations) A rectangular ortho-radial representation is drawable if and only if it is valid.

We note that we can construct the flows in \(N_{\textrm{hor}}\) and \(N_{\textrm{ver}}\) using standard techniques based on flows in planar graphs with multiple sinks and sources [25]. With this a drawing can be computed in \(\text{\O }(n^{\frac{3}{2}})\) time.

7 Drawable Representations of Planar 4-Graphs

In the previous section we proved that a rectangular ortho-radial representation is drawable if and only if it is valid. We extend this result to general ortho-radial representations by reduction to the rectangular case. In Sect. 7.1 we present a procedure that augments a given instance such that all faces become rectangles. For readability we defer some of the proofs to Sect. 7.2. In Sect. 7.3 we use the rectangulation procedure and Corollary 6.3 to show Theorem 3.9. We remark that all our proofs are constructive, but make use of tests whether certain modified ortho-radial representations are valid. We develop an efficient testing algorithm for this in Sect. 8.

7.1 Rectangulation Procedure

Throughout this section, we are given an instance \(I=(G,\mathcal E,f_c,f_o)\) with a valid ortho-radial representation \(\Gamma \) and a reference edge \(e^\star \). The core of the argument is a rectangulation procedure that successively augments G with new vertices and edges to a graph \(G'\) along with a valid rectangular ortho-radial representation \(\Gamma '\). Then, \(\Gamma '\) is drawable by Corollary 6.3, and removing the augmented parts yields a drawing of \(\Gamma \).

Fig. 28
figure 28

Examples of augmentations. a The candidate edges of u are \(e_1,e_2\) and \(e_3\). b Insertion of vertical edge uz. c \(\Gamma ^{u}_{e_1}\) contains a decreasing cycle. d \(\Gamma ^{u}_{e_2}\) is valid. e Insertion of horizontal edge \(uw_{i}\) because there is a horizontal path from \(w_i\) to u

The rectangulation procedure works by augmenting non-rectangular faces one by one, thereby successively removing concave angles at the vertices until all faces are rectangles. Traversing the boundary of a face in clockwise direction yields a sequence of left and right turns, where a degree-1 vertex contributes two left turns. Note that concave angles correspond exactly to left turns in this sequence. Consider a face f with a left turn (i.e., a concave angle) at u such that the following two turns when walking along f (in clockwise direction) are right turns; see Fig. 28. We call u a port of f. We define a set of candidate edges (or just candidates) that contains precisely those edges vw of f, for which \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u, vw]) = 2\); see Fig. 28a. We treat this set as a sequence, where the edges appear in the same order as in f, beginning with the first candidate after u. The augmentation \(\Gamma ^u_{vw}\) with respect to a candidate edge vw is obtained by splitting the edge vw into the edges vz and zw, where z is a new vertex, and adding the edge uz in the interior of f such that the angle formed by zu and the edge following u on f is \(\pi /2\). The direction of the new edge uz in \(\Gamma ^{u}_{vw}\) is the same for all candidate edges. If this direction is vertical, we call u a vertical port and otherwise a horizontal port. We note that any vertex with a concave angle in a face becomes a port during the augmentation process. For regular faces Tamassia [31] shows that they always contain a port. Moreover, the following observation can be proven analogously.

Observation 7.1

If u is a port of a face f and vw is a candidate edge for u, then \(\Gamma ^u_{vw}\) is an ortho-radial representation.

However, an augmentation \(\Gamma ^u_{vw}\) is not necessarily valid. We prove that we can always find an augmentation that is valid. The crucial ingredient is the following proposition.

Fig. 29
figure 29

The outer and the central face are rectangulated by adding cycles of length 3. The cycle \(C'\) is conne- cted to an arbitrary edge xy that has label 0 and \(C''\) is connected to a new vertex on the old reference edge rs. The edge uv is selected as the new reference edge

Proposition 7.2

Let G be a planar 4-graph with valid ortho-radial representation \(\Gamma \), let f be a regular face of G and let u be a port of f with candidate edges \(e_1=v_1w_1,\dots ,e_k=v_kw_k\). Then the following facts hold:

  1. 1.

    If u is a vertical port, then \(\Gamma ^u_{e_1}\) is a valid ortho-radial representation; see Fig. 28b.

  2. 2.

    If u is a horizontal port, then \(\Gamma ^u_{e_1}\) does not contain an increasing cycle and \(\Gamma ^u_{e_k}\) does not contain a decreasing cycle; see Fig. 28c, d.

  3. 3.

    Let \(P_i\) be the maximal path in \(\Gamma \) that contains the vertex \(w_i\) of the candidate edge \(e_i=v_iw_i\) and that consists of only horizontal edges. If u is a horizontal port and \(\Gamma ^u_{e_i}\) contains a decreasing cycle and \(\Gamma ^u_{e_{i+1}}\) contains an increasing cycle, then u is an endpoint of \(P_i\) and adding the horizontal edge uz to the other endpoint z of \(P_i\) yields a horizontal cycle; see Fig. 28e. In particular, \(\Gamma + uz\) is valid.

To increase the readability we split the proof of Proposition 7.2 into the separate Lemmas 7.37.7, which we defer to Sect. 7.2.

We are now ready describe the rectangulation procedure. Let G be a planar 4-graph with valid ortho-radial representation \(\Gamma \). Without loss of generality, we can assume that G is connected, otherwise we can treat the connected components separately. We further insert triangles in both the central and outer face and suitably connect these to the original graph; see Fig. 29. Namely, for the central face g we identify an edge e on the simple cycle C bounding g such that \(\ell _C(e)=0\). Since \(\Gamma \) is valid and C is an essential cycle, such an edge exists. We then insert a new cycle \(C'\) of length 3 inside g and connect one of its vertices to a new vertex on e. The new cycle \(C'\) now forms the boundary of the central face. Analogously, we insert into the outer face a cycle \(C_o\) of length 3 which contains G and is connected to the reference edge \(e^\star \). We choose an arbitrary edge \(e^{\star \star }\) on \(C_o\) as new reference edge. We observe that there is a path P from \(e^{\star \star }\) to \(e^{\star }\) with rotation 0. Hence, each reference path from \(e^\star \) to an essential cycle in \(\Gamma \) can be extended by P such that the new path is a reference path with respect to \(e^{\star \star }\) and has the same rotation.

After this preprocessing any face f that is not a rectangle is regular, and it therefore contains a port u. If any of the candidate augmentations \(\Gamma ^u_{e_i}\) is valid, then \(\Gamma ^u_{e_i}\) has fewer concave corners than \(\Gamma \), and we continue the augmentation procedure with \(\Gamma ^u_{e_i}\). On the other hand, if none of these augmentations is valid, then each \(\Gamma ^u_{e_i}\) contains a strictly monotone cycle. Let i be the smallest index such that \(\Gamma ^u_{e_i}\) contains an increasing cycle and note that such an index i exists and that \(i>1\) by property 2 of Proposition 7.2. Then, by definition of i, \(\Gamma ^u_{e_{i-1}}\) contains a decreasing cycle and \(\Gamma ^u_{e_i}\) contains an increasing cycle. But then property 3 of Proposition 7.2 guarantees the existence of a vertex z such that \(\Gamma +uz\) is valid and has fewer concave corners than \(\Gamma \). Using this procedure we can iteratively augment \(\Gamma \) to a rectangular ortho-radial representation that contains a subdivision of the ortho-radial representation \(\Gamma \).

7.2 Proof of Proposition 7.2

Throughout this section, we assume that we are in the situation described by Proposition 7.2. That is, G is a planar 4-graph with valid ortho-radial representation \(\Gamma \), and u is a port of a regular face f with candidate edges \(e_1=v_1w_1,\dots ,e_k=v_kw_k\). After possibly replacing \(\Gamma \) with \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\), we may assume that the edge uz resulting from an augmentation with a candidate is directed to the right or up. By Lemma 4.3 there is a one-to-one correspondence between increasing (decreasing) cycles in \(\Gamma \) and increasing (decreasing) cycles in \(\textrm{flip}\hspace{0.3888pt}(\Gamma )\).

Lemma 7.3

If u is a vertical port, then \(\Gamma ^u_{e_1}\) is a valid ortho-radial representation.

Fig. 30
figure 30

Illustration of proof for Lemma 7.3. In this illustration it is assumed that inserting the edge uz into a valid ortho-radial representation creates an increasing cycle C that uses uz. However, then there is cycle \(C'\) not using uz that is also increasing

Proof

Assume for the sake of contradiction that \(\Gamma ^u_{e_1}\) contains a strictly monotone cycle C. As \(\Gamma \) is valid, C must contain the new edge uz in either direction (i.e., uz or zu). Let \(f'\) be the new rectangular face of \(G+uz\) containing u, \(v_1\) and z, and consider the subgraph \(H=C+f'\) of \(G+uz\). According to Lemma 5.7 there exists an essential cycle \(C'\) that does not contain uz. Moreover, \(C'\) can be decomposed into paths P and Q such that P lies on \(f'\) and Q is a part of C; see Fig. 30.

The goal is to show that \(C'\) is increasing or decreasing. We present a proof only for the case that C is an increasing cycle. The proof for decreasing cycles can be obtained by flipping all inequalities.

For each edge e on Q the labels \(\ell _C(e)\) and \(\ell _{C'}(e)\) are equal by Lemma 5.7, and hence \(\ell _{C'}(e)\leqslant 0\). For an edge e of P, there are two possible cases: e either lies on the side of \(f'\) parallel to uz or on one of the two other sides. In the first case, the label of e is equal to the label \(\ell _C(uz)\) (\(\ell _C(zu)\) if C contains zu instead of uz). In particular the label is negative.

In the second case, we first note that \(\ell _{C'}(e)\) is even, since e points left or right. Assume that \(\ell _{C'}(e)\) was positive and therefore at least 2. Then, let \(e'\) be the first edge on \(C'\) after e that points to a different direction. Such an edge exists, since otherwise \(C'\) would be an essential cycle whose edges all point to the right, but they are not labeled with 0. This edge \(e'\) lies on Q or is parallel to uz. Hence, the argument above implies that \(\ell _{C'}(e')\leqslant 0\). However, \(\ell _{C'}(e')\) differs from \(\ell _{C'}(e)\) by at most 1, which requires \(\ell _{C'}(e')\geqslant 1\). Therefore, \(\ell _{C'}(e)\) cannot be positive.

We conclude that all edges of \(C'\) have a non-positive label. If all labels were 0, C would not be an increasing cycle by Proposition 5.4. Thus, there exists an edge on \(C'\) with a negative label and \(C'\) is an increasing cycle in \(\Gamma \). But as \(\Gamma \) is valid, such a cycle does not exist, and therefore C does not exist either. Hence, \(\Gamma ^u_{e_1}\) is valid. \(\square \)

Lemma 7.4

If u is a horizontal port, then \(\Gamma ^u_{e_1}\) contains no increasing cycle.

Proof

Let \(f'\) be the new rectangular face of \(\Gamma ^u_{e_1}\) containing \(u,v_1\) and z, and assume for the sake of contradiction that there is an increasing cycle C in \(\Gamma ^u_{e_1}\). This cycle must use either uz or zu. Similar to the proof of Lemma 7.3, we find an increasing cycle \(C'\) in \(\Gamma \), contradicting the validity of \(\Gamma \).

Applying Lemma 5.7 to C and \(f'\) yields an essential cycle \(C'\) without uz and zu that can be decomposed into a path P on \(f'\) and a path \(Q\subseteq C\setminus f'\) such that all edges of Q have non-positive labels. We show in the following that the edges of P also have non-positive labels.

If C contains uz, there are three possibilities for an edge e of P, which are illustrated in Fig. 31: The edge e lies on the left side of \(f'\) and points up, e is parallel to uz, or \(e=v_1z\). In the first case \(\ell _{C'}(e)=\ell _{C}(uz)-1<0\) and in the second case \(\ell _{C'}(e)=\ell _C(uz)\leqslant 0\). If \(e=v_1z\), C cannot contain \(zv_1\) and therefore \(zw_1\in C\). Then, \(\ell _{C'}(e)=\ell _C(zw_1)< 0\). In all three cases the label of e is at most 0.

If C contains zu, the label of zu has to leave a remainder of 2 when it is divided by 4 since zu points to the left. As the label is also at most 0, we conclude \(\ell _C(zu)\leqslant -2\). The edges of P lie either on the left, top or right of \(f'\). Therefore, the label of any edge e on P differs by at most 1 from \(\ell _{C}(zu)\), and thus we get \(\ell _{C'}(e)\leqslant 0\).

Summarizing the results above, we see that all edges on \(C'\) are labeled with non-positive numbers. The case that all labels of \(C'\) are equal to 0 can be excluded, since C would not be an increasing cycle by Proposition 5.4. Hence, \(C'\) is an increasing cycle, which was already present in \(\Gamma \), contradicting the validity of \(\Gamma \). \(\square \)

Lemma 7.5

If u is a horizontal port, then \(\Gamma ^u_{e_k}\) contains no decreasing cycle.

Proof

Let uz be the new edge inserted in \(\Gamma ^u_{e_k}\). In \(\Gamma ^u_{e_k}\), the face f is split in two parts. Let \(f'\) be the face containing \(v_k\) and \(f''\) the one containing \(w_k\). Assume for the sake of contradiction that there is a decreasing cycle C in \(\Gamma ^u_{e_k}\). Then, either uz or zu lies on C. By Lemma 5.7 there exists an essential cycle \(C'\) that can be decomposed into a path P on \(f''\) and \(Q=C \cap C'\); see Fig. 32a. For all edges e of Q, we have \(\ell _C(e)=\ell _{C'}(e)\geqslant 0\) by Lemma 5.7. Since \(C'\) is already present in \(\Gamma \) and \(\Gamma \) is valid, \(C'\) cannot be decreasing. Moreover, since C and \(C'\) intersect, \(C'\) cannot be horizontal by Proposition 5.4. Therefore, \(C'\) must contain an edge xy with \(\ell _{C'}(xy) < 0\), which hence has to lie on P.

Fig. 31
figure 31

The increasing cycle C contains uz. There are three possibilities for edges on \(C'\) that lie not on C: They lie on the left side of \(f'\) (like \(e_1\)), on the top (like \(e_2\)), or on the right side formed by only the edge \(v_1z\)

Fig. 32
figure 32

The situation in the proof of Lemma 7.5. The cycle C is decreasing and it is assumed that \(\ell _{C'}(xy)<0\). a The decomposition of \(C'\) into P and Q. b The reference paths R and \(C'[b,x]\) from ab to xy

Our goal is to show that there must be a candidate on f after y and in particular after the last candidate \(e_k\)—a contradiction. The following claim gives a sufficient condition for the existence of such a candidate.

Claim 7.6

If \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,yx]) \leqslant 2\), then there is a candidate on \(f[yx, u]\).

To prove Claim 7.6, we determine for each edge e on f the value \(r(e):={{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e])\). By assumption, it is \(r(yx)\leqslant 2\). For the last edge \(e_{\text {last}}\) on \(f[yx, u]\) it is \(r(e_{\text {last}})={{\,\textrm{rot}\,}}\hspace{0.33325pt}(f)-{{\,\textrm{rot}\,}}\hspace{0.33325pt}(tuv) = 5\), where t and v are the preceding and succeeding vertices of u on f, respectively. Here, we use that f is a regular face (i.e., \({{\,\textrm{rot}\,}}\hspace{0.33325pt}(f)=4\)) and \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(tuv)=-1\) since u is a port.

Note that for two consecutive edges \(e,e'\) on the boundary of f, it is \(r(e') \leqslant r(e)+1\). Therefore, there exists an edge e that lies between yx and \(e_{\text {last}}\) on the boundary of f that satisfies \(r(e) = 2\). Hence, e is a candidate that lies after yx on the boundary of f. This finishes the proof of Claim 7.6.

To finish the proof of the lemma it hence suffices to show that \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,yx]) \leqslant 2\). As \(e_k\) is a candidate, we have \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u, zw_k]) = 2\) and therefore

$$\begin{aligned} {{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u, yx]) = {{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u, zw_k]) + {{\,\textrm{rot}\,}}\hspace{1.111pt}(f[zw_k, yx]) = {{\,\textrm{rot}\,}}\hspace{1.111pt}(f[zw_k, yx]) + 2. \end{aligned}$$

Thus, it suffices to show \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[zw_k, yx]) \leqslant 0\).

We present a detailed argument for the case that C uses uz as illustrated in Fig. 32. At the end of the proof, we briefly outline how the argument can be adapted if C uses zu.

If C uses uz, then P is directed such that \(f''\) lies to the left of P. Thus, \(C'\) lies in the interior of C. Let now ab be the last edge of Q, and let R be the path defined by \(C[b, uz] + f[zw_k,y]\); see Fig. 32b. Both R and \(C'[b,x]\) are reference paths from ab to xy that lie in the interior of C and in the exterior of \(C'\). Applying the second statement of Lemma 3.6 hence gives

$$\begin{aligned} {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(ab, R, xy) = {{\,\textrm{dir}\,}}{(ab, C'[b,x], xy)}. \end{aligned}$$
(5)

The direction along R is defined as

$$\begin{aligned} {{\,\mathrm{dir\hspace{0.94437pt}}\,}}(ab, R, xy)&= {{\,\textrm{rot}\,}}{(ab + R + yx)} - 2 \\&= {{\,\textrm{rot}\,}}{(ab + C[b, uz] + f[zw_k,y] + yx) }- 2\\&= {{\,\textrm{rot}\,}}{(C[ab, uz] + f[zw_k,yx]) }- 2\\&= {{\,\textrm{rot}\,}}\hspace{1.111pt}(C[ab, uz]) + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(uzw_k) + {{\,\textrm{rot}\,}}{(f[zw_k,yx])} - 2\\&= \ell _C(uz) - \ell _C(ab) + {{\,\textrm{rot}\,}}{(f[zw_k,yx])} - 1. \end{aligned}$$

The last step uses \({{\,\textrm{rot}\,}}{(C[ab, uz])} = \ell _C(uz) - \ell _C(ab)\) and \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(uzw_k)=1\).

The rotation along \(C'[b,x]\) is defined as

$$\begin{aligned} {{\,\textrm{dir}\,}}{(ab, C'[b,x], xy)}&= {{\,\textrm{rot}\,}}{(ab + C'[b, x] + xy)}\\&= {{\,\textrm{rot}\,}}{(C'[ab, xy])}\\&= \ell _{C'}(xy) - \ell _{C'}(ab)\\&= \ell _{C'}(xy) - \ell _{C}(ab). \end{aligned}$$

The last step uses that \(\ell _C(ab) = \ell _{C'}(ab)\) by Lemma 5.7. Altogether, we obtain

$$\begin{aligned} \ell _{C}(uz) - \ell _{C}(ab) + {{\,\textrm{rot}\,}}{(f[zw_k, yx]) }- 1 = \ell _{C'}(xy) - \ell _{C}(ab), \end{aligned}$$

which can be rearranged to

$$\begin{aligned} {{\,\textrm{rot}\,}}{(f[zw_k, yx])} = \ell _{C'}(xy) - \ell _{C}(uz) + 1. \end{aligned}$$

With \(\ell _{C'}(xy) \leqslant -1\) and \(\ell _C(uz) \geqslant 0\) we obtain \({{\,\textrm{rot}\,}}{(f[zw_k,yx])} \leqslant 0\). This completes the proof for the case that uz lies on C.

If zu lies on C, we consider the flipped representation \(\textrm{flip}\hspace{0.3888pt}(\Gamma ^u_{e_k})\). In \(\textrm{flip}\hspace{0.3888pt}(\Gamma ^u_{e_k})\) the cycle \(\bar{C}\) is decreasing and contains the edge uz. The cycle \(\bar{C'}\) is not decreasing and contains the edge yx with label \(\ell ^f_{\bar{C'}}(yx) = \ell _{C'}(xy) < 0\). Moreover, the cycle \(\bar{C}\) contains \(\bar{C'}\) in its interior. Thus, the argument above can be applied to \(\bar{C}\), \(\bar{C'}\), and yx instead of \(C,C'\), and xy. \(\square \)

Lemma 7.7

Let \(P_i\) be the maximal path that contains the vertex \(w_i\) of the candidate edge \(e_i=v_iw_i\) and that consists of only horizontal edges. If u is a horizontal port and \(\Gamma ^u_{e_i}\) contains a decreasing cycle and \(\Gamma ^u_{e_{i+1}}\) contains an increasing cycle, then u is an endpoint of \(P_i\) and adding the horizontal edge uz to the other endpoint z of \(P_i\) yields a horizontal cycle. In particular, \(\Gamma + uz\) is valid.

Fig. 33
figure 33

Three possibilities how the path between w and \(v'\) can look like: a \(w=v'\), b all edges point right, and c all edges point left. In the first two cases the edge uw is inserted and in c \(uv'\) is added

Proof

Figure 33 illustrates three possibilities of the path. Let \(z_{i}\) be the new vertex inserted in \(\Gamma ^u_{e_i}\) and \(z_{i+1}\) the one in \(\Gamma ^u_{e_{i+1}}\). Since both \(uz_{i}\) and \(uz_{i+1}\) point to the right, there is no augmentation of \(\Gamma \) containing both edges. We compare \(\Gamma ^u_{e_i}\) and \(\Gamma ^u_{e_{i+1}}\) by the following construction (see also Fig. 34), which models all important aspects of both representations: Starting from \(\Gamma \) we insert new vertices \(z_{i}\) on \(e_i\) and \(z_{i+1}\) on \(e_{i+1}\). We connect u and \(z_i\) by a path of length 2 that points to the right and denote its internal vertex by x. Furthermore, a path of length 2 from x via a new vertex y to \(z_{i+1}\) is added. The edge xy points down and \(yz_{i+1}\) to the right. In the resulting ortho-radial representation \(\widetilde{\Gamma }\) the edge \(uz_i\) in \(\Gamma ^u_{e_i}\) is modeled by the path \(uxz_i\). Similarly, the edge \(uz_{i+1}\) in \(\Gamma ^u_{e_{i+1}}\) is modeled by the path \(uxyz_{i+1}\) in \(\widetilde{\Gamma }\).

Take any decreasing cycle in \(\Gamma ^u_{e_i}\). As \(\Gamma \) is valid, this cycle must contain either \(uz_i\) or \(z_iu\). We obtain a cycle \(C_1\) in \(\widetilde{\Gamma }\) by replacing \(uz_i\) with \(uxz_i\) (or \(z_iu\) with \(z_ixu\)). Note that ux and \(xz_i\) have the same label as \(uz_i\), and the labels of all other edges on the cycles stay the same by Lemma 5.8. Therefore, \(C_1\) is a decreasing cycle.

Fig. 34
figure 34

Illustration of proof for Lemma 7.7. a \(\Gamma ^u_{e_i}\) is obtained by inserting the edge \(uz_{i}\) into \(\Gamma \). b \(\Gamma ^u_{e_{i+1}}\) is obtained by inserting the edge \(uz_{i+1}\) into \(\Gamma \). c \(\widetilde{\Gamma }\) is obtained by combining \(\Gamma ^u_{e_{i}}\) and \(\Gamma ^u_{e_{i+1}}\)

Similarly, there exists an increasing cycle in \(\Gamma ^u_{e_{i+1}}\), which contains \(uz_{i+1}\) or \(z_{i+1}u\). Replacing \(uz_{i+1}\) with \(uxyz_{i+1}\) (or \(z_{i+1}u\) with \(z_{i+1}yxu\)) we get a cycle \(C_2\) in \(\widetilde{\Gamma }\). By Lemma 5.8 the labels of \(C_2\) are non-positive outside of \(uxyz_{i+1}\) (or \(z_{i+1}yxu\)) and there is an edge with negative label. Consequently, the only edge of \(C_2\) that may have a positive label is the edge e between x and y. Since \(C_1\) and \(C_2\) intersect, Lemma 5.6 implies that \(C_2\) is not increasing. Thus, the label of e is positive. If \(e=yx\), then e points upwards. Hence, \(\ell _{C_2}(e) \equiv 3 \mod 4\), which implies that \(\ell _{C_2}(e)\geqslant 3\). Thus, its succeeding edge has a positive label as well contradicting that e is the only edge on \(C_2\) with a positive label. Hence, the cycle \(C_2\) contains the edge xy and consequently the edge ux.

Using this construction we show that one endpoint of \(P_i\) is u and the other is another vertex of f. To that end, we prove the following claims.

Claim 7.8

The cycles \(C_1\) and \(C_2\) both contain the edge ux and it is \(\ell _{C_1}(ux)=\ell _{C_2}(ux)=0\).

Claim 7.9

The vertices \(w_i\) and \(v_{i+1}\) have a degree of at least 2. Further, \(C_1\) contains \(w_i\) and \(C_2\) contains \(v_{i+1}\).

Claim 7.10

The edges of \(f[w_i,v_{i+1}]\) are part of \(P_i\). In particular, \(C_2\) contains \(w_i\) or \(C_1\) contains \(v_{i+1}\).

Claim 7.11

The right endpoint of \(P_i\) is u and the left endpoint z lies on f.

Using these claims we prove the lemma as follows. Due to Claim 7.11 we can insert the horizontal edge uz into \(\Gamma \) obtaining a horizontal cycle \(P_i+uz\). The resulting ortho-radial representation is valid, because any strictly monotone cycle necessarily contains uz and hence shares a vertex with a horizontal cycle, contradicting Lemma 5.4. This finishes the proof. In the following we prove the claims.

Fig. 35
figure 35

Illustration of proof for Claim 7.8 of Lemma 7.7

Claim 7.8. Let \(H=C_1+C_2\) be the graph formed by the two cycles \(C_1\) and \(C_2\) and let \(\tilde{f}\) be its central face. We first show that ux is incident to \(\tilde{f}\). If all edges of \(\tilde{f}\) belong to one of the two cycles, say \(C_1\), then \(\tilde{f} = C_1\) since \(C_1\) is simple. Thus, ux is incident to \(\tilde{f}\). Otherwise, there is an edge e of \(C_2\setminus C_1\) on \(\tilde{f}\) whose source v lies on \(C_1\); see Fig. 35. Let \(x_1\) and \(x_2\) be the succeeding vertices of v on \(C_1\) and \(C_2\), respectively. As \(C_1\) is a decreasing cycle, we have \(\ell _{C_1}(vx_1)\geqslant 0\). If \(\ell _{C_2}(vx_2)\leqslant 0\), then by Lemma 5.5 the edge \(e=vx_2\) lies in the exterior of \(C_1\), which contradicts the choice of e. Hence, we have \(\ell _{C_2}(vx_2) > 0\), which implies that \(e = xy\). Further, the cyclic order of the vertex x implies that ux is the predecessor of xy on the central face.

Since \(C_2\) contains ux, the central face \(\tilde{f}\) lies to the right of ux. Since \(C_1\) is also directed such that \(\tilde{f}\) lies to the right of \(C_1\), it cannot contain xu, but it contains ux. By Lemma 5.2 we further obtain that \(\ell _{C_1}(ux)=\ell _{C_2}(ux)=0\).

Claim 7.9. We consider the setting in \(\widetilde{\Gamma }\); see Fig. 34c. From Claim 7.8 we obtain \(\ell _{C_1}(xz_i)=0\). Consequently, since \(C_1\) is a decreasing cycle and since \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(xz_iw_i)=1\) and \({{\,\textrm{rot}\,}}\hspace{0.66666pt}(xz_iv_i)=-1\), the cycle contains the edge \(z_iw_i\) but not the edge \(z_iv_i\). In particular, this implies that \(w_i\) has a degree of at least 2, as otherwise \(C_1\) would not be simple. Similarly, from Claim 7.8 we obtain \(\ell _{C_1}(yz_{i+1})=0\). Consequently, since \(C_2\) has only non-positive labels except on xy and since \({{\,\textrm{rot}\,}}\hspace{0.66666pt}(xz_{i+1}v_{i+1})=-1\) and \({{\,\textrm{rot}\,}}\hspace{0.66666pt}(xz_{i+1}w_{i+1})=1\), the cycle contains the edge \(z_{i+1}v_{i+1}\) but not the edge \(z_{i+1}w_{i+1}\). In particular, this implies that \(v_{i+1}\) has a degree of at least 2, as otherwise \(C_2\) would not be simple.

Claim 7.10. Let \(e_s\) be the direct successor of \(e_i\) and let \(e_p\) be the direct predecessor of \(e_{i+1}\) on the boundary of f. In order to show the claim, we do a case distinction on the rotations \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(e_i,e_s)\) and \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(e_p,e_{i+1})\). From Claim 7.9 it follows that \({{\,\textrm{rot}\,}}\hspace{0.66666pt}(e_i,e_s)\in \{-1,0,1\}\) and \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(e_p,e_{i+1}) \in \{-1,0,1\}\). Further, it cannot be both \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(e_i,e_f)= 1\) and \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(e_p,e_{i+1})= 1\). Otherwise, since \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e_i])=2\) and \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e_{i+1}])=2\), it would hold \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e_s])=3\) and \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e_p])=1\). In that case, there would be a further candidate edge e with \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e])=2\) between \(e_i\) and \(e_{i+1}\). Thus, we obtain \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_i,e_s)\in \{-1,0\}\) or \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_p,e_{i+1})\in \{-1,0\}\),

First, assume that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_i,e_s)=0\). We obtain \(e_s=e_{i+1}\) and hence \(e_p=e_i\). Otherwise, \(e_s\) would be a candidate edge between \(e_i\) and \(e_{i+1}\). Consequently, \(f[w_i,v_{i+1}]\), which consist of the single vertex \(v=w_{i}=v_{i+1}\), trivially belongs to \(P_i\). Moreover, by Claim 7.8 the cycle \(C_2\) then also contains \(w_i\) and \(C_1\) contains \(v_{i+1}\). The very same argument can be applied for \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_{p},e_{i+1})=0\), as we also obtain \(e_s=e_{i+1}\) and \(e_p=e_i\). In particular, we obtain \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_i,e_s)=0\) if and only if \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_p,e_{i+1})=0\).

Fig. 36
figure 36

Illustration of proof for Claim 7.10 of Lemma 7.7

Now, assume that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_i,e_s)=-1\) or \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_p,e_{i+1})=-1\). We first consider the case that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_i,e_s)=-1\); see Fig. 36a. We observe that \(C_1\) contains \(e_s\) as it also contains the vertex \(w_i\) by Claim 7.8. Let \(Q_i\) be the maximal horizontal path on f that starts at \(w_i\). We observe that \(Q_i\) is a prefix of \(P_i\), and the cycle \(C_1\) shares at least \(e_s\) with \(Q_i\). Since by Claim 7.8 the cycle \(C_1\) has label 0 on ux, it also has label 0 on any of its edges that lie on \(Q_i\). In fact, this implies that \(C_1\) completely contains the path \(Q_i\). Otherwise, it would contain an edge that does not belong \(Q_i\), but starts at an intermediate vertex of \(Q_i\). By the choice of \(Q_i\) such an edge has a negative label since its preceding edge has label 0, which contradicts that \(C_1\) is decreasing. For the same reason, the edge e that succeeds \(Q_i\) on f has a negative label. Hence, the edge e is the candidate \(e_{i+1}\). Consequently, \(C_1\) contains \(v_{i+1}\) and \(f[w_i,v_{i+1}]=Q_i\), which shows Claim 7.10. For the case that \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_p,e_{i+1})=-1\) we use similar arguments; see Fig. 36b. Let \(Q_{i+1}\) be the maximal horizontal path on f that starts at \(v_{i+1}\) when going along f counterclockwise. The first edge of \(Q_{i+1}\) is \(e_p\), which also belongs to \(C_2\). Further, \(C_2\) has label 0 on any of its edges that belong to \(Q_{i+1}\). Consequently, \(C_2\) contains \(Q_{i+1}\) completely, as otherwise it would contain an edge that points downwards, contradicting that \(C_{2}\) has only non-positive labels except for the edge xy. Hence, the edge of f that is incident with the endpoint of \(Q_{i+1}\) and does not belong to \(Q_{i+1}\) is the candidate edge \(e_i\), which concludes the proof.

Claim 7.11. We first show that u is the right endpoint of \(P_i\). To that end, let \(H=C_1+C_2\) be the graph formed by the two cycles \(C_1\) and \(C_2\) and let \(\tilde{f}\) be its central face. From the proof of Claim 7.8 we know that ux is incident to the central face. Further, from Claims 7.9 and 7.10 it follows that \(C_1\) and \(C_2\) have the vertex \(w_{i}\) or the vertex \(v_{i+1}\) in common; see Figs. 36a and 36b, respectively. Let \(v=w_i\) in the former case and let \(v=v_{i+1}\) in the latter case.

We first show that \(C_1[v,x]=C_2[v,x]\). Assume that this is not the case. Consider the maximal common prefix of \(C_1[v,x]\) and \(C_2[v,x]\), and let w be the endpoint of that prefix. As v is incident to \(\tilde{f}\), this also applies to w. Further, by Lemma 5.5 the outgoing edge of w on \(C_2\) lies in the exterior of \(C_1\). Let t be the first intersection of \(C_1\) and \(C_2\) on \(\tilde{f}\) after w. Then the edge to t on \(C_2\) lies strictly in the exterior of \(C_1\) contradicting Lemma 5.5.

Hence, we have \(C_1[v,x]=C_2[v,x]\); we denote that path by P. Since ux is incident to \(\tilde{f}\), all edges of P are incident to \(\tilde{f}\) as well. Hence, by Corollary 5.3 all edges of P have the same label on \(C_1\) and \(C_2\). Since \(C_1\) is decreasing, i.e., its labels are non-negative, and the labels on \(C_2\) are non-positive on \(C_2[z_{i+1},u]\), the labels of the edges of P are 0. Therefore, these edges are horizontal. As \(f[w_i,v_{i+1}]\) also belongs to \(P_i\), we conclude that u is the right endpoint of \(P_i\).

Fig. 37
figure 37

Illustration of proof for Claim 7.11 of Lemma 7.7

Finally, we argue that z belongs to the face f. As by Claim 7.10, \(f[w_i,v_{i+1}]\) belongs to \(P_i\), the vertex z belongs to a prefix Q of \(P_i\) that does not contain any edge of \(f[w_i,v_{i+1}]\) and ends either at \(w_i\) or at \(v_{i+1}\); see Figs. 37a and 37b, respectively. If Q is empty, \(w_i\) or \(v_{i+1}\) is z, respectively, which shows the claim. So assume that Q is not empty. Let vw be the last edge of Q, i.e., depending on the considered case we either have \(w=w_i\) or \(w=v_{i+1}\). By the local ordering of the incident edges of w, the path Q lies in the interior of f. Further, vw is incident to f on both sides, as otherwise the two other incident edges of w could not be incident to f as well. Hence, we obtain \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,wv])=3\) and \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,vw])=0\). Thus, the path f[wvvw] of f consists only of horizontal edges, as otherwise there would be an edge e on that path with \({{\,\textrm{rot}\,}}\hspace{1.111pt}(f[u,e])=2\), which contradicts the choice of \(e_i\) and \(e_{i+1}\). Altogether, the path f[wvvw] is \(\bar{Q}+Q\), which proves that z belongs to f. \(\square \)

7.3 Proof of the Main Theorem

We are now ready to prove the characterization of drawable ortho-radial representations.

Theorem 7.12

An ortho-radial representation is drawable if and only if it is valid.

Proof

Fig. 38
figure 38

Illustration of proof for Theorem 3.9

For an illustration of the proof see Fig. 38. If \(\Gamma \) is a valid ortho-radial representation, then using the rectangulation procedure of Sect. 7.1 we obtain a valid rectangular ortho-radial representation \(\Gamma '\) that contains a subdivision of \(\Gamma \). Then \(\Gamma '\) has a drawing \(\Delta '\) by Theorem 6.3, and a drawing \(\Delta \) of \(\Gamma \) is obtained from \(\Delta '\) by removing edges that are in \(\Gamma '\) but not in \(\Gamma \), and by undoing subdivisions. It remains to show that the reference edge \(e^\star \) of \(\Gamma \) is an outlying edge in \(\Delta \), which then implies that \(\Gamma \) is drawable.

Let \(C_o\) be the essential cycle that is part of the outer face of \(\Gamma \) and let \(e_o\) be an outermost horizontal edge of \(C_o\) in \(\Delta \), i.e., an horizontal edge of \(C_o\) with maximum distance to the center; see Fig. 38a. To show that \(e^\star \) is an outlying edge in \(\Delta \), we show \({{\,\textrm{rot}\,}}{(C_o[e_o, e^\star ])}= 0\).

Let \(C_T\) be the essential cycle that forms the outer face of \(\Gamma '\). Further, let l be the ray that emanates from the center of \(\Delta '\) and goes through the source vertex v of \(e_o\). Let \(p_1,\dots ,p_k\) be the intersection points of l with \(\Delta '\) from v on. We observe that \(p_1=v\) and \(p_k\) lies on \(C_T\). For each intersection point \(p_i\) with \(1\leqslant i \leqslant k\) we insert a vertex \(v_i\) at \(p_i\) if there is no vertex so far. Further, we add vertical edges to \(\Delta '\) such that the new drawing contains the path \(P=v_1\ldots v_k\). We denote the resulting drawing by \(\Delta ''\); see Fig. 38b.

By the construction of the rectangulation the drawing \(\Delta ''\) further contains a path Q that connects a subdivision vertex \(u_1\) on \(e^\star \) with a vertex \(u_2\) on \(C_T\). We observe that the cycle \(C=C_o[v_1,u_1]+Q+T[u_2,v_k]+\bar{P}\) is essential. Moreover, by construction the path \(C[u_1,v_1]=Q+C_T[u_2,v_k]+\bar{P}\) has rotation 2. Since C has a left bend at both \(v_1\) and \(u_1\) it follows that \(C_o[v_1,u_1]\) has rotation 0. Consequently, \(e^\star \) is an outlying edge in \(\Delta \). Altogether, we obtain that \(\Gamma \) is drawable.

Conversely, assume that \(\Gamma \) is drawable. Hence, \(\Gamma \) has a drawing \(\Delta \) in which the reference edge \(e^\star \) of \(\Gamma \) is an outlying edge. By Lemma 4.2 we can assume without loss of generality that \(e^\star \) lies on the outermost circle that is used by an essential cycle of \(\Delta \). By [21] the representation \(\Gamma \) satisfies conditions (i) and (ii) of Definition 3.1. To prove that \(\Gamma \) is valid, we show how to reduce the general case to the more restricted one, where all faces are rectangles. By Corollary 6.3 the existence of a drawing and the validity of the ortho-radial representation are equivalent.

Given the drawing \(\Delta \), we augment it such that all faces are rectangles. This rectangulation is similar to the one described in Sect. 7.1 but works with a drawing and not only with a representation. We first insert the missing parts of the innermost and outermost circle that are used by \(\Delta \) such that the outer and the central face are already rectangles. For each left turn on a face f at a vertex u, we then cast a ray from v in f in the direction in which the incoming edge of u points. This ray intersects another edge in \(\Delta \). Say the first intersection occurs at the point p. Either there already is a vertex z drawn at p or p lies on an edge. In the latter case, we insert a new vertex, which we call z, at p. We then insert the edge uz in G and update \(\Delta \) and \(\Gamma \) accordingly.

Repeating this step for all left turns, we obtain a drawing \(\Delta '\) and an ortho-radial representation \(\Gamma '\) of the augmented graph \(G'\); see Fig. 38c for an example of \(\Delta '\). As the labelings of essential cycles are unchanged by the addition of edges elsewhere in the graph, any increasing or decreasing cycle in \(\Gamma \) would also appear in \(\Gamma '\). But by Corollary 6.3\(\Gamma '\) is valid, and hence neither \(\Gamma \) nor \(\Gamma '\) contain increasing or decreasing cycles. Thus, \(\Gamma \) is valid. \(\square \)

We remark that the proof of Theorem 3.9 is in fact constructive and it can easily be implemented in polynomial time, provided that we can check in polynomial time whether a given ortho-radial representation is valid. We develop such an algorithm with running time \(\text{\O }(n^2)\) in Sect. 8. In Sect. 9 we show how compute a rectangulation of \(\Gamma \) in time \(\text{\O }(n^2)\).

8 Validity Testing

In this section, we show how to check whether a given ortho-radial representation is valid in polynomial time, which yields the following statement.

Theorem 8.1

Given an ortho-radial representation \(\Gamma \), it can be determined in \(\text{\O }(n^2)\) time whether \(\Gamma \) is valid. In the negative case a strictly monotone cycle can be computed in \(\text{\O }(n^2)\) time.

The two conditions for ortho-radial representations are local and checking them can easily be done in linear time. Throughout this section, we therefore assume that we are given an instance \(I=(G,\mathcal E,f_c,f_o)\) with an ortho-radial representation \(\Gamma \) and a reference edge \(e^\star \). The condition for validity however references all essential cycles of which there may be exponentially many. We present an algorithm that checks whether \(\Gamma \) contains a strictly monotone cycle and computes such a cycle if one exists. The main difficulty is that the labels on a decreasing cycle C depend on a reference path P that runs from \(e^\star \) to C and respects C. However, we know neither the path P nor the cycle C in advance, and choosing a specific cycle C may rule out certain paths P and vice versa.

We only describe how to search for decreasing cycles; increasing cycles can be found by searching for decreasing cycles in the mirrored representation by Lemma 4.4. A decreasing cycle C is outermost if it is not contained in the interior of any other decreasing cycle. Clearly, if \(\Gamma \) contains a decreasing cycle, then it also has an outermost one. We first show that in this case this cycle is uniquely determined.

Lemma 8.2

If \(\Gamma \) contains a decreasing cycle, there is a unique outermost decreasing cycle.

Proof

Assume that \(\Gamma \) has two outermost decreasing cycles \(C_1\) and \(C_2\), i.e., \(C_1\) does not lie in the interior of \(C_2\) and vice versa. Let C be the cycle bounding the outer face of the subgraph \(H=C_1+C_2\) that is formed by the two decreasing cycles. By construction, \(C_1\) and \(C_2\) lie in the interior of C, and we claim that C is a decreasing cycle contradicting that \(C_1\) and \(C_2\) are outermost. To that end, we show that \(\ell _C(e)=\ell _{C_1}(e)\) for any edge e that belongs to both C and \(C_1\), and \(\ell _C(e)=\ell _{C_2}(e)\) for any edge e that belongs to both C and \(C_2\). Hence, all edges of C have a non-negative label since \(C_1\) and \(C_2\) are decreasing. By Proposition 5.4 there is at least one label of C that is positive, and hence C is a decreasing cycle.

It remains to show that \(\ell _C(e)=\ell _{C_1}(e)\) for any edge e that belongs to both C and \(C_1\); the case that e belongs to both C and \(C_2\) can be handled analogously. Let \(\Gamma _H\) be the ortho-radial representation \(\Gamma \) restricted to H. We flip the cylinder to exchange the outer face with the central face and vice versa. More precisely, Lemma 4.3 implies that the reverse edge \(\bar{e}\) of e lies on the central face of the flipped representation \(\textrm{flip}\hspace{0.3888pt}(\Gamma _H)\) of \(\Gamma _H\). Further, it proves that \(\ell ^f_{\bar{C}}(\bar{e})=\ell _{C}(e)\) and \(\ell ^f_{\bar{C_1}}(\bar{e})=\ell _{C_1}(e)\), where \(\ell ^f\) is the labeling in \(\bar{\Gamma _H}\). Hence, by Corollary 5.3 we obtain \(\ell ^f_{\bar{C}}(\bar{e})= \ell ^f_{\bar{C_1}}(\bar{e})\). Flipping back the cylinder, again by Lemma 4.3 we obtain \(\ell _C(e)=\ell _{C_1}(e)\). \(\square \)

The core of our algorithm is an adapted left-first DFS. Given a directed edge e it determines the outermost decreasing cycle C in \(\Gamma \) such that C contains e in the given direction and e has the smallest label among all edges on C, if such a cycle exists. By running this test for each directed edge of G as the start edge, we find a decreasing cycle if one exists.

More precisely, the DFS visits each vertex at most once and it maintains for each visited vertex v a reference edge \(\textrm{ref}(v)\), the edge of the search tree via which v was visited. Whenever it has a choice which vertex to visit next, it picks the first outgoing edge in clockwise direction after the reference edge that leads to an unvisited vertex. In addition to that, we employ a filter that ignores certain outgoing edges during the search. To that end, we define for all outgoing edges e incident to a visited vertex v a search label \(\tilde{\ell }(e)\) by setting \(\tilde{\ell }(e) = \tilde{\ell }(\textrm{ref}(v)) + {{\,\textrm{rot}\,}}{(\textrm{ref}(v) + e)}\) for each outgoing edge e of v. In our search we ignore edges with negative search labels. For a given directed edge vw in G we initialize the search by setting \(\textrm{ref}(w) = vw\), \(\tilde{\ell }(vw) = 0\) and then start searching from w.

Let T denote the directed search tree with root w constructed by the DFS in this fashion. If T contains v, then this determines a candidate cycle C containing the edge vw. If C is a decreasing cycle, which we can easily check by determining a reference path, we report it. Otherwise, we show that there is no outermost decreasing cycle C such that vw lies on C and has the smallest label among all edges on C.

It is necessary to check that C is essential and decreasing. For example the cycle in Fig. 39 is found by the search and though it is essential, it is non-decreasing. This is caused by the fact that the label of vw is actually \(-4\) on this cycle but the search assumes it to be 0.

Lemma 8.3

Assume that \(\Gamma \) contains a decreasing cycle. Let C be the outermost decreasing cycle of \(\Gamma \) and let vw be an edge on C with the minimum label, i.e., \(\ell _C(vw) \leqslant \ell _C(e)\) for all edges e of C. Then the left-first DFS from vw finds C.

Fig. 39
figure 39

The search from vw finds the non-decreasing cycle C. Edges are labeled \(\ell _{C}(e)/\tilde{\ell }(e)\)

Fig. 40
figure 40

Path Q and its prefix P that leaves C once and ends at a vertex p of C

Proof

Assume for the sake of contradiction that the search does not find C. Let T be the tree formed by the edges visited by the search. Since the search does not find C by assumption, a part of \(C[w,v]\) does not belong to T. Let xy be the first edge on \(C[w,v]\) that is not visited, i.e., \(C[w,x]\) is figurea part of T but \(xy\not \in T\). There are two possible reasons for this. Either \(\tilde{\ell }(xy) < 0\) or y has already been visited before via anotherfigurefrom w with \(Q\ne C[w,y]\).

The case \(\tilde{\ell }(xy)<0\) can be excluded as follows. By the construction of the labels \(\tilde{\ell }\), for any path P from w to a vertex z in T and any edge \(e'\) incident to z we have \(\tilde{\ell }(e') = {{\,\textrm{rot}\,}}{(vw+P+e')}\). In particular, \(\tilde{\ell }(xy) = {{\,\textrm{rot}\,}}\hspace{1.111pt}(C[vw, xy]) = \ell _C(xy) - \ell _C(vw) \geqslant 0\) since the rotation can be rewritten as a label difference (see Observation 5.1) and vw has the smallest label on C.

Hence, T contains a path Q from w to x that was found by the search before and Q does not completely lie on C. There is a prefix of Q (possibly of length 0) lying on C followed by a subpath not on C until the first vertex p of Q that again belongs to C; see Fig. 40. We set \(P=Q[w, p]\) and denote the vertex where P leaves C by b. By construction the edge vw lies on \(C[p,b]\). The subgraph \(H=P+C\) that is formed by the decreasing cycle C and the path P consists of the three internally vertex-disjoint paths \(P[b,p]\), \(C[b,p]\) and \(\bar{C}[b,p]\) between b and p. Since edges that are further left are preferred during the search, the clockwise order of these paths around b and p is fixed as in Fig. 40. In H there are three faces, bounded by C, \(\bar{C}[b,p]+\bar{P}[p,b]\) and \(P[b,p]+\bar{C}[p,b]\), respectively. Since C is an essential cycle and it bounds a face in H, it bounds the central face and one of the two other faces is the outer face. These two possibilities are shown in Fig. 41. We denote the cycle bounding the outer face but in which the edges are directed such that the outer face lies locally to the left by \(C'\). That is, the boundary of the outer face is \(\bar{C'}\). We distinguish cases based on which of the two possible cycles constitutes \(\bar{C'}\).

Fig. 41
figure 41

The two possible embeddings of the subgraph formed by the decreasing cycle C and the path P, which was found by the search

If \(\bar{C'}=\bar{C}[b,p]+\bar{P}[p,b]\) forms the outer face of H, vw lies on \(C'\) as illustrated in Fig. 41a and we show that \(C'\) is a decreasing cycle, which contradicts the assumption that C is the outermost decreasing cycle. Since P is simple and lies in the exterior of C, the path P is contained in \(C'\), which means \(C'[w, p]= P\). The other part of \(C'\) is formed by \(C[p, w]\). Since C forms the central face of H, the labels of the edges on \(C[p,w]\) are the same for C and \(C'\) by Proposition 5.2. In particular, \(\ell _C(vw) = \ell _{C'}(vw)\) and all the labels of edges on \(C[p,w]\) are non-negative because C is decreasing. The label of any edge e on both \(C'\) and P is \(\ell _{C'}(e) = \ell _{C'}(vw) + {{\,\textrm{rot}\,}}{(vw + P[w, e])} = \ell _C(vw) + \tilde{\ell }(e) \geqslant 0\). Thus, the labeling of \(C'\) is non-negative. Further, not all labels of \(C'\) are 0 since otherwise C would not be a decreasing cycle by Proposition 5.4. Hence, \(C'\) is decreasing and contains C in its interior, a contradiction.

If \(\bar{C'} = \bar{C}[p,b]+P[b,p]\), the edge vw does not lie on \(C'\); see Fig. 41b. We show that \(C'\) is a decreasing cycle containing C in its interior, again contradicting the choice of C. As above, Proposition 5.2 implies that the common edges of C and \(C'\) have the same labels on both cycles. It remains to show that all edges xy on \(\bar{P}[p,b]\) have non-negative labels. To establish this we use paths to the edge that follows b on C. This edge bc has the same label on both cycles and thus provides a handle on \(\ell _{C'}(xy)\). We make use of the following equations, which follow immediately from the definition of the (search) labels.

$$\begin{aligned} \ell _{C'}(bc)&= \ell _{C'}(xy) + {{\,\textrm{rot}\,}}{(\bar{P}[xy,db]) }+ {{\,\textrm{rot}\,}}\hspace{0.66666pt}(dbc) \\ {}&= \ell _{C'}(xy) - {{\,\textrm{rot}\,}}{(P[bd,yx]) }- {{\,\textrm{rot}\,}}\hspace{0.7222pt}(cbd)\\ \ell _{C}(bc)&= \ell _{C}(vw) + {{\,\textrm{rot}\,}}{(C[vw,ab])} + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(abc)\\ \tilde{\ell }(yx)&= {{\,\textrm{rot}\,}}{(C[vw,ab])} + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(abd) + {{\,\textrm{rot}\,}}{(P[bd,yx])}. \end{aligned}$$

Since \(\ell _C(bc) = \ell _{C'}(bc)\) and \({{\,\textrm{rot}\,}}\hspace{0.66666pt}(abd) = -{{\,\textrm{rot}\,}}\hspace{0.7222pt}(dba)\), we thus get

$$\begin{aligned} \ell _{C'}(xy)&= \ell _{C}(vw) + {{\,\textrm{rot}\,}}{(C[vw,ab])} + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(abc) +{{\,\textrm{rot}\,}}{(P[bd,yx])} + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(cbd)\\&= \ell _{C}(vw) + \tilde{\ell }(yx) + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(dba) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(abc) + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(cbd). \end{aligned}$$

Since \(\ell _C(vw) \geqslant 0\) and \(\tilde{\ell }(yx) \geqslant 0\) (as yx was not filtered out), it follows that \(\ell _{C'}(xy) \geqslant {{\,\textrm{rot}\,}}\hspace{0.66666pt}(abc) + {{\,\textrm{rot}\,}}\hspace{0.66666pt}(dba) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(cbd) = 2\) as this is the sum of clockwise rotations around a degree-3 vertex. Hence, \(C'\) is decreasing and contains C in its interior, a contradiction. Since both embeddings of H lead to a contradiction, we obtain a contradiction to our initial assumption that the search fails to find C. \(\square \)

The left-first DFS clearly runs in \(\text{\O }(n)\) time. In order to guarantee that the search finds a decreasing cycle if one exists, we run it for each of the \(\text{\O }(n)\) directed edges of G. Since some edge must have the lowest label on the outermost decreasing cycle, Lemma 8.3 guarantees that we eventually find a decreasing cycle if one exists. Increasing cycles can be found by searching for decreasing cycles in the mirror representation \(\textrm{mirror}\hspace{0.3888pt}(\Gamma )\) (Lemma 4.4). Altogether, this proves Theorem 3.10.

9 Efficient Rectangulation Procedure

Let G be a planar 4-graph with valid ortho-radial representation \(\Gamma \). By Theorem 3.9\(\Gamma \) is drawable. The proof of Theorem 3.9 is constructive and shows how to augment \(\Gamma \) to a valid rectangular ortho-radial representation \(\Gamma ^\star \). Then a drawing \(\Delta ^\star \) of \(\Gamma ^\star \) can be computed by determining flows in two flow networks by Theorem 6.1. A drawing \(\Delta \) of \(\Gamma \) can be finally obtained by undoing augmentation steps. Hence, it remains to show how a valid ortho-radial representation can be rectangulated efficiently.

To follow the construction of the proof of Theorem 3.9, one needs to determine efficiently whether an augmentation yields a valid ortho-radial representation \(\Gamma ^u_{vw}\). We call such an augmentation a valid augmentation. Since each valid augmentation reduces the number of concave angles, we obtain a rectangulation after \(\text{\O }(n)\) valid augmentations. Moreover, there are \(\text{\O }(n)\) candidates for each augmentation, each of which can be tested for validity (and increasing/decreasing cycles can be detected) in \(\text{\O }(n^2)\) time by Theorem 3.10. Thus, the rectangulation algorithm can be implemented to run in \(\text{\O }(n^{4})\) time.

In the remainder of this section we present an improvement to \(\text{\O }(n^{2})\) time, which is achieved in three steps. First, we show that, due to the nature of augmentations, each validity test can be done in \(\text{\O }(n)\) time. This reduces the running time of the augmentation procedure to \(\text{\O }(n^3)\); see Sect. 9.1. Second, we show how to find a valid augmentation for a given port u using only \(\text{\O }(\log n)\) validity tests, thus improving the running time to \(\text{\O }(n^2 \log n)\); see Sect. 9.2. Finally, we design an algorithm that can be used to post-process a valid augmentation and which reduces the number of validity tests to \(\text{\O }(n)\) and the running time to \(\text{\O }(n^2)\) in total; see Sect. 9.3. Altogether, this proves our third main result.

Theorem 9.1

Given a valid ortho-radial representation, a corresponding drawing can be constructed in \(\text{\O }(n^2)\) time.

9.1 1st Improvement—Faster Validity Test

The general test for strictly monotone cycles performs one left-first DFS per edge and runs in \(\text{\O }(n^2)\) time. However, we can exploit the special structure of the augmentation to reduce the running time to \(\text{\O }(n)\). For the proof we restrict ourselves to the case that the inserted edge uz points to the right. The case that it points left can be handled by flipping the representation using Lemma 4.3.

The key result is that in any decreasing cycle of an augmentation the new edge uz has the minimum label. Thus, performing only one left-first DFS starting at uz is sufficient. For increasing cycles the arguments do not hold, but in a second step we show that the test for increasing cycles can be replaced by a simple test for horizontal paths.

Recall that the augmentations \(\Gamma ^u_{vw}\) that are tested during the rectangulation are built by adding one edge uz to a valid representation \(\Gamma \). Hence, any strictly monotone cycle in \(\Gamma ^u_{vw}\) contains the edge uz.

We first show that the new edge uz has label 0 on any decreasing cycle in the augmentation \(\Gamma ^u_{vw}\) if vw is the first candidate. We extend this result afterwards to augmentations to all candidates. Since the label of edges on decreasing cycles is non-negative, this implies in particular that the label of uz is minimum, which is sufficient for the left-first DFS to succeed (see Lemma 8.3).

Fig. 42
figure 42

A decreasing cycle C that uses uz and an essential cycle \(C'\) derived from C

Lemma 9.2

Let \(\Gamma \) be a valid ortho-radial representation and let u be a horizontal port on f with first candidate vw. If \(\Gamma ^u_{vw}\) contains a decreasing cycle C, then C contains uz in this direction and \(\ell _C(uz) = 0\).

Proof

We first consider the case that C uses uz (and not zu) and assume for the sake of contradiction that \(\ell _C(uz)\ne 0\); see Fig. 42. Since uz points right, \(\ell _C(uz)\) is divisible by 4. Together with \(\ell _C(uz) \ge 0\) because C is decreasing, we obtain \(\ell _C(uz) \geqslant 4\). By Lemma 5.7 there is an essential cycle \(C'\) without uz in the subgraph H that is formed by the new rectangular face \(f'\) and C. We show that \(C'\) is a decreasing cycle. We observe that each edge of \(C'\) either lies on \(f'\) or is an edge of C. For any edge e of \(C' \cap C\) Lemma 5.7 gives \(\ell _{C'}(e) = \ell _C(e) \geqslant 0\). Since \(f'\) is rectangular, the labels of edges in \(C'\cap f'\) differ by at most 1 from \(\ell _C(uz)\). By assumption it is \(\ell _C(uz) \geqslant 4\) and therefore \(\ell _{C'}(e)\geqslant 3\) for all edges e in \(C'\cap f'\). Hence, \(C'\) is a decreasing cycle in G contradicting the validity of \(\Gamma \).

If zu lies on C, it is \(\ell _C(zu)\geqslant 2\) and a similar argument yields a decreasing cycle in \(\Gamma \). \(\square \)

While the same statement does not generally hold for all candidates, it does hold if the first candidate creates a decreasing cycle.

Fig. 43
figure 43

The structure used to simulate the simultaneous insertion of uz to vw and \(uz'\) to \(v'w'\)

Lemma 9.3

Let \(\Gamma \) be a valid ortho-radial representation and let u be a horizontal port on f with first candidate vw. Further, let \(v'w'\) be another candidate and denote the edge inserted in \(\Gamma ^u_{v'w'}\) by \(uz'\). If \(\Gamma ^u_{vw}\) contains a decreasing cycle, any decreasing cycle \(C'\) in \(\Gamma ^u_{v'w'}\) uses \(uz'\) in this direction and \(\ell _{C'}(uz') = 0\).

Proof

In order to simulate the simultaneous insertion of two new edges to both vw and \(v'w'\) we use the structure from the proof of Lemma 7.7; see Fig. 43. We denote the resulting augmented representation by \(\widetilde{\Gamma }\). There is a one-to-one correspondence between decreasing cycles in \(\Gamma ^u_{vw}\) and decreasing cycles in \(\widetilde{\Gamma }\) containing uxz. Let C be a decreasing cycle in \(\widetilde{\Gamma }\) containing uxz. By Lemma 9.2 the cycle C contains uxz in this direction, and we have \(\ell _{C}(ux) = 0\).

Similarly, for any decreasing cycle in \(\Gamma ^u_{v'w'}\) there is a cycle in \(\widetilde{\Gamma }\) where \(uz'\) (\(z'u\)) is replaced by the path \(uxyz'\) (\(z'yxu\)). Let \(\widetilde{C'}\) be the cycle in \(\widetilde{\Gamma }\) that corresponds to the decreasing cycle \(C'\) in \(\Gamma ^u_{v'w'}\).

Suppose for now that \(C'\) uses \(uz'\) in this direction, which means that \(\widetilde{C'}\) uses ux. In particular, since \(\ell _{\tilde{C'}}(ux) = \ell _{C'}(uz')\), it holds \(\ell _{\tilde{C'}}(xy)= \ell _{\tilde{C'}}(ux)+1\geqslant 1\). Let \(\tilde{f}\) be the central face of \(H=\widetilde{C}+\widetilde{C'}\). We note that \(\tilde{f}\) is a decreasing cycle by Lemma 5.2 and Proposition 5.4. Since \(\Gamma \) is valid, \(\tilde{f}\) is not exclusively formed by edges of G. Thus, by the construction of H, the path \(uxyz'\) lies on \(\tilde{f}\). Lemma 5.2 therefore implies that \(\ell _{\tilde{C'}}(ux)=\ell _{C}(ux)=0\), where the last equality follows from Lemma 9.2.

Above we assumed that \(C'\) uses \(uz'\) in this direction. This is in fact the only possibility. Assume for the sake of contradiction that \(C'\) contains \(z'u\) and hence \(xu\in \widetilde{C'}\). As above we can argue that the central face \(\tilde{f}\) of \(\widetilde{C}+\widetilde{C}'\) is not exclusively formed by edges of G and that the path \(z'yxz\) lies on \(\tilde{f}\). By Lemma 5.2 we have \(\ell _{\tilde{C'}}(yx) = \ell _{C}(xz) - {{\,\textrm{rot}\,}}\hspace{0.66666pt}(yxz) = -1\). Hence, we obtain \(\ell _{C'}(z'u) = \ell _{\tilde{C'}}(xu) = \ell _{\tilde{C'}}(yx) + {{\,\textrm{rot}\,}}\hspace{0.7222pt}(yxu) = -2\), which contradicts that \(C'\) is a decreasing cycle. \(\square \)

Fig. 44
figure 44

Here, the insertion of the edge uz to the last candidate \(v'w'\) introduces an increasing cycle C with \(\ell _C(uz) = -4\)

Altogether, we can efficiently test which of the candidates \(e_1,\dots ,e_k\) produce decreasing cycles as follows. By Lemma 9.2, if the first candidate is not valid, then \(\Gamma ^{u}_{e_{1}}\) has a decreasing cycle that contains the new edge uz with label 0, which is hence the minimum label for all edges on the cycle. This can be tested in \(\text{\O }(n)\) time by Lemma 8.3. Fact 2 of Proposition 7.2 guarantees that we either find a valid augmentation or a decreasing cycle. In the former case we are done, in the second case Lemma 9.3 allows us to similarly restrict the labels of uz to 0 for the remaining candidate edges, thus allowing us to detect decreasing cycles in \(\Gamma ^u_{e_{i}}\) in \(\text{\O }(n)\) time for \(i=2,\dots ,k\).

It is tempting to use the mirror symmetry (Lemma 4.4) to exchange increasing and decreasing cycles to deal with increasing cycles in an analogous fashion. However, this fails as mirroring invalidates the property that u is followed by two right turns in clockwise direction. For example, in Fig. 44 inserting the edge to the last candidate introduces an increasing cycle C with \(\ell _{C}(uz)=-4\). We therefore give a direct algorithm for detecting increasing cycles in this case.

Let \(e_{i}=v_iw_i\) and \(e_{i+1}={v_{i+1}w_{i+1}}\) be two consecutive candidates for u such that \(\Gamma ^u_{e_{i}}\) contains a decreasing cycle but \(\Gamma ^u_{e_{i+1}}\) does not. If \(\Gamma ^u_{e_{i+1}}\) contains an increasing cycle, then by Fact 3 of Proposition 7.2 the vertices \(w_{i}\), \(v_{i+1}\) and u lie on a horizontal path that starts at a vertex z incident to f and ends at u. The presence of such a horizontal path P can clearly be checked in linear time, thus allowing us to also detect increasing cycles provided that the previous candidate produced a decreasing cycle. If P exists, we insert the edge uz. By Proposition 5.4 this does not produce strictly monotone cycles. Otherwise, if P does not exist, the augmentation \(\Gamma ^u_{e_{i+1}}\) is valid. In both cases we have resolved the horizontal port u successfully.

Summarizing, the overall algorithm for augmenting from a horizontal port u now works as follows. By exploiting Lemmas 9.2 and 9.3, we test the candidates in the order as they appear on f until we find the first candidate e for which \(\Gamma ^u_{e}\) does not contain a decreasing cycle. Using Fact 3 of Proposition 7.2 we either find that \(\Gamma ^{u}_{e}\) is valid, or we find a horizontal path as described above. In both cases this allows us to determine an edge whose insertion does not introduce a strictly monotone cycle. Since in each test for a decreasing cycle the edge uz can be restricted to have label 0, each of the tests takes linear time. This improves the running time of the rectangulation algorithm to \(\text{\O }(n^{3})\).

9.2 2nd Improvement—Fewer Validity Tests

Instead of linearly searching for a suitable candidate for u, we can employ a binary search on the candidates, which reduces the number of validity tests for u from linear to logarithmic. To do this efficiently, we first compute the list of all candidates \(e_1,\dots ,e_k\) for u in time linear in the size of f. Next, we test if the augmentation \(\Gamma ^u_{e_1}\) is valid. If it is, we are done.

Otherwise, we start the binary search on the list \(e_1,\dots ,e_k\), where k is the number of candidates for u. The search maintains a sublist \(e_i,\dots ,e_j\) of consecutive candidates such that \(\Gamma ^u_{e_i}\) contains a decreasing cycle and \(\Gamma ^u_{e_j}\) does not. Note that this invariant holds in the beginning, because we explicitly test for a decreasing cycle in \(\Gamma ^u_{e_1}\) and there is no decreasing cycle in \(\Gamma ^u_{e_{k}}\) by Fact 2 of Proposition 7.2. If the list consists of only two consecutive candidates, i.e., \(j=i+1\), we stop. Otherwise, we set \(m=\lfloor (i+j)/2\rfloor \) and test if \(\Gamma ^u_{e_m}\) contains a decreasing cycle. If it does, we recurse on \(e_m,\dots ,e_j\) and otherwise on \(e_i,\dots ,e_m\). As the invariant is preserved, we end up with two consecutive candidates \(e_i\) and \(e_{i+1}\) such that \(\Gamma ^u_{e_i}\) contains a decreasing cycle and \(\Gamma ^u_{e_{i+1}}\) does not. In this situation Fact 3 of Proposition 7.2 guarantees that we find a valid augmentation. Clearly this only requires \(\text{\O }(\log n)\) validity tests in total. Further, as argued in the previous subsection each of these tests can be performed in linear time. Altogether, we obtain the following lemma.

Lemma 9.4

Using binary search we find a valid augmentation for u in \(\text{\O }(n\log n)\) time.

Since there are \(\text{\O }(n)\) ports to remove, we obtain that any planar 4-graph with valid ortho-radial representation can be rectangulated in \(\text{\O }(n^2\log n)\) time.

Theorem 9.5

Given a valid ortho-radial representation \(\Gamma \), a corresponding rectangulation can be computed in \(\text{\O }(n^2 \log n)\) time.

9.3 3rd Improvement—Linear Number of Validity Tests

In this section we describe an improvement of our algorithm that reduces the total number of validity tests to \(\text{\O }(n)\) such that the running time of our algorithm becomes \(\text{\O }(n^2)\). The improvement adapts the augmentation step for horizontal ports of the rectangulation procedure. Let u be a horizontal port of a face f and let \(e_1,\dots ,e_k\) be its candidate edges. The adapted augmentation step resolves u in two steps.

Step 1. We do a linear scan on \(e_{1},\dots ,e_k\) to search for the first candidate \(e_m\) of u that gives rise to a valid augmentation with an additional edge uz. Recall that z either subdivides \(e_m\) or uz completes a horizontal cycle that contains the source of \(e_m\). We note that we apply m validity tests in this step. In case that \(m<4\), the augmentation step is stopped. Otherwise we continue with the following step.

Step 2. In the following let \(\Gamma _0\) be the valid ortho-radial representation that we obtain after Step 1. We observe that the inserted edge uz splits the face f into two smaller faces. In Step 2.1 we partition the face that contains the edges \(e_1,\dots ,e_{m-1}\) by inserting two paths T and B of constant size that start at subdivision vertices on uz and end at subdivision vertices on \(e_1\) and \(e_{m-1}\), respectively; see Fig. 45. These two paths separate two sub-faces \(f_1\) and \(f_2\) of f that contain the candidate edges \(e_1,\dots ,e_{m-2}\), which are all but a constant number of edges for which we have performed validity tests in Step 1. In Step 2.2. we rectangulate \(f_1\) without performing any validity test and in Step 2.3 we rectangulate \(f_2\) performing a number of validity tests that is proportional to the size of \(f_2\). In the following we describe the three steps in greater detail.

Fig. 45
figure 45

Illustration of Step 1, which inserts R, T and B into \(\Gamma _0\). Depending on whether uz lies on a horizontal cycle C in \(\Gamma _0\), the edge \(r_2r_3\) points a to the right or b downwards

Step 2.1. We adapt \(\Gamma _0\) as follows. We introduce a path \(B=b_1\ldots b_5\) in f that connects a subdivision vertex \(b_1\) on uz with a subdivision vertex on \(e_{m-1}\); see Fig. 45. The edge \(b_1b_2\) points upwards, the edge \(b_3b_4\) points downwards, and the other two edges point to the right. The face that lies to the left of B is the face \(f'\) we seek to rectangulate. Similarly, we introduce a path \(T=t_1\ldots t_5\) in \(f'\) that connects a subdivision vertex \(t_1\) on \(ub_1\) with a subdivision vertex on \(e_{1}\). The edge \(t_1t_2\) points upwards, the edge \(t_3t_4\) points downwards, and the other two edges point to the right. Finally, we subdivide the edge \(ut_1\) by two additional vertices. Altogether, the edge uz has been replaced by a path \(R=r_1\ldots r_6\) with \(r_1=u\), \(r_4=t_1\), \(r_5=b_1\) and \(r_6=z\). As we have obtained the edges of R by subdividing uz, they all point to the right. In the case that uz does not lie on a horizontal cycle, we orient \(r_2r_3\) such that it points downwards.

We denote the resulting ortho-radial representation by \(\Gamma _1\). Further, let \(f_1\) be the face that lies to the right of T, and let \(f_2\) be the face that lies to the left of T.

Step 2.2. We iteratively resolve the ports in \(f_1\) until the face is rectangulated. For each port \(u'\) of \(f_1\) we augment the ortho-radial representation as follows. If \(u'\) is a vertical port, we augment with respect to the first candidate edge and if \(u'\) is a horizontal port we augment with respect to the last candidate edge of \(u'\). The procedure stops when \(f_1\) is completely rectangulated. We denote the resulting ortho-radial representation by \(\Gamma _2\). We emphasize that this step does not execute any validity test.

Step 2.3. Starting with \(\Gamma _2\), we rectangulate the face \(f_2\), which has a constant number of ports, by iteratively applying the original augmentation step. We denote the resulting ortho-radial representation by \(\Gamma _3\).

In the following we show that the modified rectangulation procedure runs in \(\text{\O }(n^2)\) time and yields a valid ortho-radial representation.

Lemma 9.6

The modified rectangulation procedure produces a valid, rectangulated ortho-radial representation.

Since the proof is rather technical, we defer it to Sect. 9.6. In the following we argue the running time. To that end, we first prove that the output rectangulation has linear size.

Lemma 9.7

The rectangulated ortho-radial representation produced by the modified rectangulation procedure has size \(\text{\O }(n)\).

Proof

For the proof we define the potential function

$$\begin{aligned}\Phi =3\cdot \text {horizontal corners of }\Gamma + \text {vertical corners of }\Gamma ,\end{aligned}$$

where a horizontal (vertical) corner is a concave corner that becomes a horizontal (vertical) port of a face during the rectangulation procedure. At the beginning of the rectangulation procedure it holds \(\Phi \leqslant 4 n\), because each vertex with degree greater than 1 can be either a horizontal or a vertical corner, but not both. Further, each vertex with degree 1 is both a horizontal and vertical corner. We show that for each augmentation step of the rectangulation procedure the potential \(\Phi \) decreases by some value \(\Delta \Phi \geqslant 1\) and that the number \(\Delta V\) of inserted vertices is proportional to \(\Delta \Phi \). Since the rectangulation procedure terminates with \(\Phi =0\), Lemma 9.7 follows.

In case that the augmentation step handles a vertical port, this vertical corner is resolved but no new corner is created. Hence, \(\Phi \) decreases by \(\Delta \Phi =1\). Moreover, \(\Delta V = 1\). For the case that the augmentation step handles a horizontal port, we distinguish two sub-cases. If \(m<4\), this horizontal corner is resolved but no new corner is created. Hence, \(\Phi \) decreases by \(\Delta \Phi =3\). Moreover, \(\Delta V \leqslant 1\) (in case that the augmentation step closes a horizontal cycle we have \(\Delta V = 0\)). Now consider the case that \(m\geqslant 4\). Let \(k_1\) and \(k_2\) be the number of the horizontal and vertical corners, respectively, that are resolved during the rectangulation of \(f_1\) and \(f_2\) in Step 2.2 and Step 2.3, excluding those that lie on R, T and B.

Due to the insertion of the vertices \(r_3\) and \(b_4\) the potential increases by at most 2. Further, by resolving the horizontal corner u the potential decreases by 3. Further, rectangulating \(f_1\) and \(f_2\) decreases the potential by \(3k_1 + k_2\). Altogether, we obtain \(\Delta \Phi \geqslant (3 - 2) + 3k_1 + k_2\geqslant 1 + k_1 + k_2\). Moreover, in Step 2.1 we add at most 13 vertices. In Step 2.2 we add \(k_1+k_2\) vertices for the corners not on T and B, and we add three vertices for \(t_4,b_2\), and \(b_3\). In Step 2.3 we add at most three vertices for \(t_2,t_3\), and possibly \(r_2\). In total, we add \(\Delta V \leqslant 19 + k_1 + k_2\) vertices.

In all cases \(\Delta V \leqslant 19 \Delta \Phi \). Altogether, we obtain that the rectangulation procedure terminates (since \(\Phi \) decreases in every rectangulation step) and the resulting rectangulation has \(\text{\O }(n)\) vertices, and therefore \(\text{\O }(n)\) edges. \(\square \)

Lemma 9.8

The modified rectangulation procedure applies \(\text{\O }(n)\) validity tests and runs in \(\text{\O }(n^2)\) time.

Proof

We now show that by replacing the original augmentation step with this adaption, the number of validity tests is linear and the rectangulation procedure runs in \(\text{\O }(n^2)\) time. We use a charging argument that assigns to each vertex and to each edge of the output rectangulation a constant number of the validity tests that have been applied during the rectangulation procedure. Further, we distribute the total running time such that running time linear in the output size is assigned to each vertex and each edge. Hence, by Lemma 9.7 the rectangulation procedure applies \(\text{\O }(n)\) validity tests and runs in \(\text{\O }(n^2)\) time.

Let u be a port that is considered in a rectangulation step. If u is a vertical port, we determine its first candidate edge in \(\text{\O }(n)\) time, which we charge on u. Further, we do not apply a validity test.

If u is a horizontal port, we determine its candidate edges in \(\text{\O }(n)\) time, which we charge on u. Further, we apply m validity tests in Step 1. If \(m<4\), only a constant number of validity tests is applied, which we charge on u. Otherwise, we charge the validity tests of \(e_1\), \(e_{m-1}\) and \(e_{m}\) on u. We observe that after the augmentation step, the horizontal port u is resolved and no further validity tests can be charged on u. Further, we charge the validity test of \(e_i\) with \(2\leqslant i \leqslant m-2\) on \(e_i\). Hence, since by construction the candidates \(e_2,\dots ,e_{m-2}\) belong to rectangles after the augmentation step, each edge can only be charged twice (once from each side).

Step 2.1 has constant running time and applies no validity tests. We charge the running time on u. Step 2.2 requires no validity tests and resolves each concave corner v on \(f_1\) in \(\text{\O }(n)\) time, which we charge on v. Afterwards, the face \(f_1\) is rectangulated and v cannot be charged again. In Step 2.3 we need \(\text{\O }(n)\) time for each concave corner v to identify the candidate edges, which we charge on v. Further, when applying a validity test in this step, we charge it on the corresponding candidate edge. As \(f_2\) has only a constant number of concave corners, each edge of \(f_2\) is charged with at most a constant number of validity tests. Further, since \(f_2\) is rectangulated afterwards its edges cannot be charged again (from the side of \(f_2\)).

Hence, over all rectangulation steps we obtain \(\text{\O }(n)\) validity tests and running time \(\text{\O }(n^2)\). \(\square \)

Altogether, we obtain that any planar 4-graph with valid ortho-radial representation can be rectangulated in \(\text{\O }(n^2)\) time. Using Corollary 6.3 this further implies that a corresponding bend-free ortho-radial drawing can be computed in \(\text{\O }(n^2)\) time.

Theorem 9.9

Given a valid ortho-radial representation \(\Gamma \), a corresponding rectangulation can be computed in \(\text{\O }(n^2)\) time.

9.3.1 Proof of Lemma 9.6

We prove Lemma 9.6 by showing that each rectangulation step yields a valid ortho-radial representation. By Proposition 7.2, Step 1 yields a valid ortho-radial representation \(\Gamma _0\). If Step 2 is not considered, \(\Gamma _0\) is the output of the rectangulation step. So assume that Step 2 is executed. We use the same notation as in the description of the algorithm. In particular, Step 2.1, Step 2.2 and Step 2.3 produce the ortho-radial representations \(\Gamma _1,\Gamma _2\) and \(\Gamma _3\) from the ortho-radial representation of the preceding step. In the following we consider the sub-steps of Step 2 separately and show that \(\Gamma _1,\Gamma _2\) and \(\Gamma _3\) are valid.

Correctness of Step 2.1. In order to show the correctness of the first step we successively add the paths R, T and B to \(\Gamma _0\) and prove the validity of each created ortho-radial representation. To that end, let \(\Gamma _R=\Gamma _0-uz+R\), \(\Gamma _T=\Gamma _R+T\) and \(\Gamma _B=\Gamma _T+B=\Gamma _1\).

Lemma 9.10

The ortho-radial representation \(\Gamma _R\) is valid.

Proof

Let C be an essential cycle in \(\Gamma _R\). If C does not contain R, it is contained in \(\Gamma _0\). Since \(\Gamma _0\) is valid, C is not strictly monotone. It remains to consider the case that C uses R.

If the edge \(r_2r_3\) of R points to the right, R lies on a horizontal cycle by construction. By Proposition 5.4C is not strictly monotone. If \(r_2r_3\) points downwards, the cycle C corresponds to an essential cycle \(C'=C[z,u]+uz\) in \(\Gamma _0\). By Lemma 5.8 the labels of C and \(C'\) coincide on C[zu]. By construction \(C'\) is not horizontal. Hence, it contains edges e and \(e'\) with \(\ell _{C'}(e)=1\) and \(\ell _{C'}(e') = -1\). Since uz is a horizontal edge, we have \(e\ne uz \ne e'\). Therefore, \(\ell _{C}(e) = 1\) and \(\ell _{C}(e') = -1\), that is, C is not strictly monotone. \(\square \)

Next, we prove that \(\Gamma _T\) and \(\Gamma _B\) are valid. To that end, we introduce the following definition. A cascading cycle is a non-monotone essential cycle that can be partitioned into two paths P and Q such that the labels on P are \(-1\) and the labels on Q are non-negative. We further require that the edges incident to the internal vertices of P either all lie in the interior of C or they all lie in the exterior of C. In the first case we call C an outer cascading cycle and in the second case an inner cascading cycle. The path P is the negative path of the cycle. We first prove the following two general lemmata on cascading cycles. The first lemma shows that a cascading cycle cannot be crossed by an increasing cycle.

Lemma 9.11

Let \(C_1\) be a cascading cycle and \(C_2\) an increasing cycle. Either \(C_1\) lies in the interior of \(C_2\) or vice versa.

Proof

We assume without loss of generality that \(C_1\) is an outer cascading cycle. The case that it is an inner cascading cycle can be handled by flipping the cylinder, which exchanges the exterior and interior of essential cycles but keeps the labels.

Let g be the central face of the subgraph formed by the cycles \(C_1\) and \(C_2\). Assume that g is neither \(C_1\) nor \(C_2\). Hence, there exist (not necessarily distinct) vertices v and \(v'\) on g such that \(g[v,v']\) belongs to both \(C_1\) and \(C_2\), the edge that precedes v on g does not belong to \(C_2\), and the edge that succeeds \(v'\) on g does not belong to \(C_1\); see Fig. 46.

For \(i=1,2\) let \(u_i\) and \(w_i\) be the vertices of \(C_i\) that precede and succeed v, respectively. Further, let \(u'_i\) and \(w'_i\) be the vertices of \(C_i\) that precede and succeed \(v'\), respectively. Since \(u_2v\) strictly lies in the exterior of g, we obtain \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_2vw_1) < {{\,\textrm{rot}\,}}\hspace{0.7222pt}(u_1vw_1)\). Hence, Lemma 5.2 gives \(\ell _{C_1}(u_1v)<\ell _{C_2}(u_2v)\). Further, by definition of \(C_1\) and \(C_2\) it holds \(\ell _{C_1}(u_1v)\geqslant -1\) and \(\ell _{C_2}(u_2v)\leqslant 0\). Thus, we obtain \(\ell _{C_1}(u_1v)=-1\) and \(\ell _{C_2}(u_2v)=0\). Since \(C_1\) is an outer cascading cycle this also implies that v is the endpoint of the negative path P of \(C_1\).

Since \(v'w'_1\) strictly lies in the exterior of g, we obtain \({{\,\textrm{rot}\,}}\hspace{0.7222pt}(u'_2v'w'_2)>{{\,\textrm{rot}\,}}\hspace{0.7222pt}(u'_2v'w'_1)\). Further, by the definition of labels we obtain \(\ell _{C_2}(u'_2v')=\ell _{C_2}(v'w'_2)-{{\,\textrm{rot}\,}}\hspace{0.7222pt}(u'_2v'w'_2)\). Applying this in Lemma 5.2 gives \(\ell _{C_1}(v'w'_1)=\ell _{C_2}(v'w'_2)-{{\,\textrm{rot}\,}}\hspace{0.7222pt}(u'_2v'w'_2)+{{\,\textrm{rot}\,}}\hspace{0.7222pt}(u'_2v'w'_1)\). Thus, we obtain \(\ell _{C_1}(v'w'_1) < \ell _{C_2}(v'w'_2)\). Analogously to the arguments above, \(\ell _{C_2}(v'w'_2) = 0\) and \(\ell _{C_1}(v'w'_1)=-1\). Thus, \(v'\) lies on P and it is not the endpoint of P. It follows \(v\ne v'\) and \(C_1-P\) is contained in \(g[v,v']\). Hence, there is an edge e on \(g[v,v']\) with label \(\ell _{C_1}(e)>0\). By Corollary 5.3\(\ell _{C_2}(e)=\ell _{C_1}(e)\), which contradicts that \(C_2\) is an increasing cycle. \(\square \)

Fig. 46
figure 46

Illustration of proof for Lemma 9.11. It is assumed that the central face g is neither the outer cascading cycle \(C_1\) nor the increasing cycle \(C_1\). Further, \(C_1\) and \(C_2\) have the edges \(g[v,v']\) in common. It is proven that any edge of \(C_1[v,v']\) has label 0 and any edge of \(C_1[v',v]\) has label \(-1\), which contradicts that \(C_1\) is a cascading cycle

We use the next lemma to show that the introduced paths T and B do not impact the validity of the ortho-radial representation.

Lemma 9.12

Let C be a cascading cycle in an ortho-radial representation \(\Gamma \) and let P be a sub-path of C such that

  1. (i)

    the intermediate vertices of P have degree 2 in the graph,

  2. (ii)

    P contains the negative path of C, and

  3. (iii)

    P contains an edge e with label \(\ell _{C}(e)>0\).

If \(\Gamma \) without P is valid, then \(\Gamma \) is valid.

Proof

First assume that \(\Gamma \) contains a decreasing cycle \(C'\), which implies that P is contained in \(C'\) (in either direction). Let \(H=C+C'\) be the common sub-graph of C and \(C'\), and let g be the central face of H. We distinguish the following two cases.

Case 1, P is part of g. First assume that C and \(C'\) use P in opposite directions. Since the central face locally lies to the right of any essential cycle, this implies that the central face lies to the left and right of P. Consequently, the central face is not simple, which contradicts that H is biconnected. So assume that C and \(C'\) use P in the same direction. By Proposition 5.2 it holds \(\ell _{C}(e')=\ell _{C'}(e')=-1\) for any edge \(e'\) on the negative path of C. Thus, \(C'\) is not a decreasing cycle.

Case 2, P is not part of g. Let \(C_g\) be the essential cycle formed by g. Since \(C_g\) consists of edges of \(C'\) and C, the corresponding labels of \(C'\) and C also apply on \(C_g\) by Proposition 5.2. Further, since \(C'\) is a decreasing cycle and P is the only part of C that has a negative label on C, the cycle \(C_g\) only has non-negative labels. Since P does not lie on \(C_g\) but on C, \(C'\) has at least one vertex with \(C_g\) in common. By Proposition 5.4 the cycle \(C_g\) is not horizontal. Altogether, \(C_g\) is a decreasing cycle that also exists in \(\Gamma -P\), which contradicts its validity.

Finally, assume that \(\Gamma \) contains an increasing cycle \(C'\), which implies that P is contained in \(C'\) in either direction. Lemma 9.11 implies that the central face g of the subgraph formed by the two essential cycles C and \(C'\) is either C or \(C'\). In particular, P or \(\bar{P}\) lies on g. Hence, both C and \(C'\) use P in the same direction as otherwise g would lie in the exterior of one of these cycles. But this would contradict that they are essential. Hence, they both contain P in this direction and P also lies on g. By Proposition 5.2 both cycles have the same labels on P. Since P contains the edge e with \(\ell _{C}(e)>0\) and thus \(\ell _{C'}(e)>0\), the cycle \(C'\) is not an increasing cycle. \(\square \)

We construct a cascading cycle \(C_T\) in \(\Gamma _T\) as follows. Let C be the outermost decreasing cycle in \(\Gamma ^{u}_{e_{1}}\) and let \(ut_5\) be the newly inserted edge in \(\Gamma ^{u}_{e_{1}}\). We replace \(ut_5\) by \(R[u,r_4]+T\) obtaining the cycle \(C_T\), which is well-defined because C uses \(ut_5\) in that direction by Lemma 9.2.

Lemma 9.13

\(C_T\) is a cascading cycle with negative path \(t_1t_2\) no matter whether \(r_2r_3\) points to the right or downwards.

Proof

Let C be the outermost decreasing cycle in \(\Gamma ^{u}_{e_{1}}\). By Lemma 5.8 the labels of C and \(C_T\) coincide on \(C[t_5,u]\,({=}\,C_T[t_5,u])\). Hence, since C is a decreasing cycle all labels on \(C_T[t_5,u]\) are non-negative. Further, by Lemma 9.2 the edge \(ut_5\) has label 0 on C. If \(r_2r_3\) points to the right the sequence of the labels on \(R[u,r_4]+T\) is therefore \(0,0,0,-1,0,1,0\). If \(r_2r_3\) points downwards the sequence is \(0,1,0,-1,0,1,0\). In both cases \(C_T\) is a cascading cycle. \(\square \)

Applying Lemma 9.11 to the situation of \(C_T\) proves that \(\Gamma _T\) does not contain any increasing cycles. Together with Lemma 9.12 this yields that \(\Gamma _T\) is valid. We analogously prove the validity of \(\Gamma _B\) as for \(\Gamma _T\). Let C be the outermost decreasing cycle in \(\Gamma ^{u}_{e_{m-1}}\) and let \(ub_5\) be the newly inserted edge in \(\Gamma ^{u}_{e_{m-1}}\). We replace \(ub_5\) by \(R[u,r_5]+B\) obtaining the cycle \(C_B\), which is well-defined because C uses \(ub_5\) in that direction by Lemma 9.2.

Lemma 9.14

\(C_B\) is a cascading cycles no matter whether \(r_2r_3\) points to the right or downwards. In particular, \(b_1b_2\) is the negative path of \(C_B\).

Proof

Let C be the outermost decreasing cycle in \(\Gamma ^{u}_{e_{m-1}}\). By Lemma 5.8 the labels of C and \(C_B\) coincide on \(C[b_5,u]\,({=}\,C_B[b_5,u])\). Hence, since C is a decreasing cycle all labels on \(C_B[b_5,u]\) are non-negative. Further, by Lemma 9.3 the edge \(ub_5\) has label 0 on C. If \(r_2r_3\) points to the right the sequence of the labels on \(R[u,r_4]+B\) is therefore \(0,0,0,0,-1,0,1,0\). If \(r_2r_3\) points downwards the sequence is \(0,1,0,0,-1,0,1,0\). In both cases \(C_B\) is a cascading cycle. \(\square \)

Applying Lemma 9.11 to the situation of \(C_T\) proves that \(\Gamma _B\) does not contain any increasing cycles. Together with Lemma 9.12 this yields that \(\Gamma _B\) is valid. The following lemma summarizes the result.

Lemma 9.15

The ortho-radial representation \(\Gamma _B=\Gamma _1\) is valid.

Correctness of Step 2.2. By Lemma 9.15 the ortho-radial representation \(\Gamma _1\) of Step 1 is valid. We now prove that \(\Gamma _2\) is a valid ortho-radial representation. We use the same notation as in the description of the algorithm.

Starting with the valid ortho-radial representation \(\Gamma _1\), the procedure iteratively resolves ports in the face \(f_1\), which locally lies to the right of T. In case that we resolve a vertical port \(u'\) in a representation \(\Pi \), the resulting ortho-radial representation \(\Pi ^{u'}_{e'_1}\) is valid by Fact 1 of Proposition 7.2, where \(e'_1\) is the first candidate of \(u'\). So assume that \(u'\) is a horizontal port. In that case we take \(\Pi ^{u'}_{e'_l}\) for the next iteration, where \(e'_l\) is the last candidate of \(u'\). We observe that the augmentation of \(f_1\) may subdivide edges on the negative paths of \(C_T\) and \(C_B\), but the added edges lie in the interior of \(C_T\) and the exterior of \(C_B\). Hence, \(C_T\) remains an outer cascading cycle and \(C_B\) an inner cascading cycle.

Lemma 9.16

The ortho-radial representation \(\Pi ^{u'}_{e'_l}\) is valid.

Proof

Assume that \(\Pi ^{u'}_{e'_l}\) is not valid. Hence, there is a strictly monotone cycle C that uses \(e=u'z'\), where \(z'\) is the vertex subdividing \(e'_l\). Since \(e'_l\) is the last candidate of \(u'\), the cycle C is increasing by Fact 2 of Proposition 7.2. By construction e strictly lies in the interior of \(C_T\) and the exterior of \(C_B\). This implies that C lies in the interior of \(C_T\) and the exterior of \(C_B\) by Lemma 9.11. In other words, C is contained in the subgraph H formed by the intersection of the interior of \(C_T\) and the exterior of \(C_B\). As \(R[r_1,r_4]\) belongs to both \(C_T\) and \(C_B\), it is incident to the outer and the central face of H. Hence, removing \(R[r_1,r_4]\) leaves a subgraph without essential cycles. Thus, the essential cycle C includes \(R[r_1,r_4]\).

By Proposition 5.2 the labels of C and \(C_T\) are the same on \(R[r_1,r_4]\). If \(r_2r_3\) points downwards, its label is 1, which contradicts that C is increasing. If otherwise \(r_2r_3\) points right, it lies on a horizontal cycle. But then C is not increasing by Proposition 5.4. \(\square \)

Altogether, applying the lemma inductively on the inserted edges, we obtain that \(\Gamma _2\) is valid.

Correctness of Step 2.3. As we only apply the first phase of the augmentation step on \(f_2\), the resulting ortho-radial representation \(\Gamma _3\) is also valid due to the correctness of the first phase. This concludes the correctness proof of the second phase.

10 Bend Minimization

We have considered bend-free ortho-radial drawings so far. In this section we shortly describe how to extend our results to ortho-radial drawings with bends. We model bends by subdividing each edge of G with K degree-2 vertices. Let S denote the set of all these subdivision vertices. A vertex \(v\in S\) is a bend in an ortho-radial representation if for its two incident edges \(e_1\) and \(e_2\) it holds \({{\,\textrm{rot}\,}}\hspace{0.88882pt}(e_1,e_2)\ne 0\). A valid ortho-radial representation of I is bend-minimal if there is no other valid ortho-radial representation of I that has fewer bends. Niedermann and Rutter [27] showed that \(K=2n-4\) subdivision vertices per edge are sufficient for creating bend-minimal valid ortho-radial representations. They propose an integer linear programming formulation for creating valid bend-minimal ortho-radial representations assuming a pre-defined embedding of the graph.

If we do not assume a pre-defined embedding of the graph, finding a bend-minimal drawing becomes \(\mathcal{N}\mathcal{P}\)-hard even for the orthogonal case. Garg and Tamassia [19] showed that the problem Orthogonal Embeddability to decide whether a given planar 4-graph admits an orthogonal drawing without bends is \(\mathcal{N}\mathcal{P}\)-complete. In the remaining part of this section we study the analogous problem Ortho-radial Embeddability for ortho-radial drawings and prove that it is \(\mathcal{N}\mathcal{P}\)-complete as well. We say a graph G admits an ortho-radial (or orthogonal) embedding if there is an embedding of G such that G can be drawn ortho-radially (or orthogonally) without bends.

We give a reduction from Orthogonal Embeddability. To do so, we note that the reduction by Garg and Tamassia [19] actually produces instances \(G=(V,E)\) with a fixed edge \(e \in E\) such that it is \(\mathcal{N}\mathcal{P}\)-complete to decide whether G has an orthogonal embedding where e is incident to the outer face.

Given such a graph, we build a structure around G that yields a graph \(G'\) such that in any ortho-radial embedding of \(G'\) the induced representation \(\Gamma \) of G does not contain any essential cycles. In other words, \(\Gamma \) is actually an orthogonal representation of G. Hence, an ortho-radial embedding of \(G'\) can only exist if G admits an orthogonal embedding. We may assume without loss of generality that G is connected as otherwise, we handle each component separately.

Fig. 47
figure 47

Possible embeddings of \(G'\): In both cases G contains no essential cycles. The roles of \(C_1\) and \(C_3\) can be exchanged

The construction of \(G'\) from G is based on the fact that there is only one way to ortho-radially draw a triangle C, i.e., a cycle of length 3, without bends: as an essential cycle on one circle of the grid. We build a graph H consisting of three triangles called \(C_1,C_2\) and \(C_3\) and denote the vertices on \(C_i\) by \(u_i\), \(v_i\) and \(w_i\). Furthermore, H contains the edges \(u_1u_2\) and \(u_2u_3\). In Fig. 47H is formed by the black edges. To connect H and G, we replace the special edge \(e=uv\) of G by a \(3 \,{\times }\, 3\)-grid and connect one of the degree-3 vertices z of that grid by a path P to \(v_2\), where we choose the length of the path equal to the number of edges in G. The resulting graph is \(G'\); see Fig. 47. The reduction clearly runs in polynomial time. Moreover, if \(G'\) admits an ortho-radial embedding, then the triangles of H must be drawn as essential cycles, and therefore G must be contained in one of the two regular faces of H, and can hence not contain any essential cycles. We therefore find an orthogonal embedding of G. Conversely, if we have an orthogonal embedding of G with e on the outer face, then it can be inserted into a face of the drawing of H and the path P can be drawn as it is sufficiently long. We therefore obtain an ortho-radial embedding of \(G'\). This proves the following theorem.

Theorem 10.1

Ortho-radial Embeddability is \(\mathcal{N}\mathcal{P}\)-complete.

11 Conclusion

In this paper we considered orthogonal drawings of graphs on cylinders. Our main result is a characterization of the plane 4-graphs that can be drawn bend-free on a cylinder in terms of a combinatorial description of such drawings. These ortho-radial representations determine all angles in the drawing without fixing any lengths, and thus are a natural extension of Tamassia’s orthogonal representations. However, compared to those, the proof that every valid ortho-radial representation has a corresponding drawing is significantly more involved. The reason for this is the more global nature of the additional property required to deal with the cyclic dimension of the cylinder.

Our ortho-radial representations establish the existence of an ortho-radial TSM framework in the sense that they are a combinatorial description of the graph serving as interface between the “Shape” and “Metrics” step.

For rectangular plane 4-graphs, we gave an algorithm producing a drawing from a valid ortho-radial representation. Our proof reducing the drawing of general plane 4-graphs with a valid ortho-radial representation to the case of rectangular plane 4-graphs is constructive. We have described an algorithm that checks the validity of an ortho-radial representation in \(\text{\O }(n^{2})\) time. In the positive case, we can also produce a corresponding drawing in the same running time, whereas in the negative case we find a strictly monotone cycle. These algorithms correspond to the “Metrics” step in a TSM framework for ortho-radial drawings. It is an interesting question whether the running time can be improved further.

While bend-minimal orthogonal representations can be created in polynomial time, it remains an open question whether the same can be achieved for bend-minimal valid ortho-radial representations.

Finally, we want to emphasize that we deem the generalization of ortho-radial drawings from the cylinder to the torus or even more complex surfaces an interesting and promising research question. It is far from clear how to transfer our results to the torus as its two cyclic dimensions lead to different types of essential cycles.