A Characterization of Horoidal Digraphs

In this paper we investigate the upward embedding problem on the horizontal torus. The digraphs that admit upward embedding on this surface are called horoidal digraphs. We shall characterize the horoidal digraphs, combinatorially. Then, we construct a new digraph from an arbitrary digraph in such a way that the new digraph has an upward embedding on sphere if and only if it is horoidal. By using these constructed digraphs, we show that the decision problem whether a digraph has an upward embedding on the horizontal torus is NP-Complete.


Introduction
We call a digraph horoidal if it has an upward drawing with no edge crossing on the horizontal torus; an embedding of its underlying graph so that all directed edges are monotonic and point to the direction of z-axis. Throughout this paper, by surfaces we mean two-dimensional compact orientable surfaces such as sphere, torus and connected sum of tori with a fixed embedding in three-dimensional space R 3 . In this paper we deal with upward drawing with no edge crossing (hereafter it will be referred as upward embedding) on a special embedding of the ring torus in R 3 which we call the horizontal torus. This surface is denoted by T h .
There are major differences between graph embedding and upward embedding of digraphs. Despite the fact that the vertical torus and the horizontal torus are two special embeddings of the ring torus in three-dimensional space R 3 , and are topologically equivalent, Dolati, Hashemi and Khosravani [11] have shown that a digraph with the underlying graph with genus one, may have an upward embedding on the vertical torus, and may fail to have an upward embedding on the horizontal torus. In addition, while Filotti, Miller and Reif [12] have shown that the question whether an undirected graph has an embedding on a fixed surface has polynomial time algorithm, the decision problem of upward embedding testing is NP-complete, even on sphere and plane. In the following we review the results on upward embedding from the characterization and computational complexity point of view.

Plane
A digraph is called upward planar if it has an upward embeding on the plane.
Characterization An st-digraph is a single source and single sink digraph in which there is an arc from the source to the sink. Di Battista and Tamassia [7] and Kelly [19], independently, characterized the upward planarity of digraphs. [7], Kelly [19]) A digraph is upward planar if and only if it is a spanning subgraph of an st-digraph with planar underlying graph.

Theorem 1.1 (Di Battista and Tamassia
Testing The decision problem associated with plane is stated as follows.

Problem 1 Upward embedding testing on plane (Upward planarity testing) INSTANCE: Given a digraph D. QUESTION: Does D have an upward embedding on plane?
This decision problem has polynomial time algorithms for some special cases; Bertolazzi, Di Battista, Liotta, and Mannino [5] have given a polynomial-time algorithm for testing the upward planarity of three connected digraphs. Thomassen [21] has characterized upward planarity of the single source digraphs in terms of forbidden circuits. By combining Thomassen's characterization with a decomposition scheme Hutton and Lubiw [18] have given a polynomial-time algorithm to test if a single source digraph with n vertices is upward planar in O(n 2 ). Bertolazzi, Di Battista, Mannino, and Tamassia [6] have presented an optimal algorithm to test whether a single source digraph is upward planar in the linear time. Papakostas [20] has given a polynomial-time algorithm for upward planarity testing of outerplanar digraphs. The results for the general case is stated in the following theorem. Theorem 1.2 (Garg,Tamassia [13,14], Hashemi, Rival, Kisielewicz [17]) Upward planarity testing is NP-Complete.

Round sphere
A digraph is called spherical if it has an upward embeding on the sphere.

Characterization
The following theorem characterizes the sphericity of digraphs. Dolati and Hashemi [10] have presented a polynomial-time algorithm for upward sphericity testing of the embedded single source digraphs. Recently, Dolati [9] has presented an optimal linear algorithm for upward sphericity testing of this class of digraphs.
The results of the general case is stated in the following theorem.

Horizontal torus
Another surface to be mentioned is horizontal torus. Here we recall its definition. The surface obtained by the revolving of the curve c : (y−2) 2 +(z−1) 2 = 1 round the line L : y = 0 as its axis of the revolution in the yz-plane. In this case the part of T h resulting from the revolving of that part of c in which y ≤ 2 is called inner layer. The other part of T h resulting from the revolving of that part of c in which y ≥ 2 is called outer layer. The curves generating from revolving points (0, 2, 0) and (0, 2, 2) round the axis of revolution are minimum and maximum of the torus and are denoted by c min and c max , respectively. According to our defnition, it is clearly seen that c min and c max are common between the inner layer and the outer layer. Our main results bear characterization of the digraphs that have upward embedding on the horizontal torus; we call them the horoidal digraphs. Note that, this characterization can not be applied for vertical torus.
Because the set of all digraphs that admit upward embedding on horizontal torus is a proper subset of the set of all digraphs that have upward embedding on vertical torus.

Characterization
In the next section we will characterize the horoidal digraphs. Let D be a horoidal digraph that is not spherical. As we will show, in the new characterization, a proper partition of the arcs into two parts will be presented. This partition must be constructed in such a way that the induced subdigraph on each part is spherical. Moreover, the common sources and the common sinks of the two induced subdigraphs must be able to be properly identified. Note that, the arcs set of one of these parts can be cosidered as ∅. Therefore, the set of spherical digraphs is a proper subset of the set of horoidal digraphs.
Testing It has been shown that the following corresponding decision problem is not easy [8]. We will investigate its complexity in details in the next sections. Dolati, Hashemi, and Khosravani [11] have presented a polynomial-time algorithm to decide whether a single source and single sink digraph has an upward embedding on T h . In this paper, by using a reduction from the sphericity testing decision problem, we show that this decision problem is NP-Complete.
Recently, Auer et al. in [1][2][3][4] consider the problem by using the fudamental polygon of the surfaces. They use a vector field for defining the direction of the arcs. By their definition, acyclicity condition is not a necessary condition for a digraph to have upward embbedding.
The rest of this paper is organized as follows. After some preliminaries in Section 2 we present a characterization of a digraph to have an upward embedding on T h in Section 3. Then we show that the decision problem to decide whether a digraph has an upward embedding on the horizontal torus belongs to NP. In section 4 we shall present a polynomial reduction from the sphericity decision problem to the upward embedding testing on T h . In Section 5 we present conclusions and some related open problems.

Preliminaries
Here, we introduce some definitions and notations which we use throughout the paper. By a digraph D we mean a pair D = (V, A) of vertices V , and arcs A. In this paper all digraphs are finite and simple (without loops and multiple edges). A necessary condition for a digraph to have an upward embedding on a surface is that it has no directed cycle, i.e. it is acyclic. For any two vertices u and v of a digraph D, the symbol (u, v) denotes an arc in D that originates from u and terminates at v. A source of D is a vertex with no incoming arcs. A sink of D is a vertex with no outgoing arcs. An internal vertex of D has both incoming and outgoing arcs. Let x be a vertex of D, by od(x) we mean the number of the outgoing arcs of x and by id(x) we mean the number of the incoming arcs to x. A directed path of a digraph D is a list v 0 , a 1 , v 1 , . . . , a k , v k of vertices and arcs such that, . If D is a digraph, then its underlying graph is the graph obtained by replacing each arc of D by an (undirected) edge joining the same pair of vertices. A digraph D is weakly connected or simply connected if, for each pair of vertices u and v, there is a undirected path in D between u and v. We use of the following equivalence relation R on the arcs of a digraph, introduced by Dolati et. al in [11].

Definition 2.5 Given a digraph D = (V, A).
We say two arcs a, a ′ ∈ A(D) are in relation R if they belong to a directed path or there is a sequence P 1 , P 2 , . . . , P k , for some k ≥ 2, of directed paths with the following properties: This partition is used directly in the following theorem.
Theorem 2.6 (Dolati, Hashemi, Khosravani [11]) Given a digraph D. In every upward embedding of D on T h , all arcs that belong to the same class R must be drawn on the same layer.

Characterization
In this section we present a characterization of a digraph that has an upward embedding on the horizontal torus. Then, by using the characterization we show that the decision problem to decide whether a digraph has an upward embedding on the horizontal torus belongs to NP. Here, for the sake of the simplicity, by We need to introduce two more notions. For the sphere S = {(x, y, z) : x 2 + y 2 + z 2 = 1} by the c-circle we mean one obtained from the intersection of S with the plane z = c. For a finite set S, by a permutation π S of S we mean a linear ordering of S. Let D = (V, A, S, T ) be a spherical digraph and π S and σ T be two permutations for S and T, respectively. The digraph D is called ordered spherical with respect to π S and σ T if it has an upward embedding in which the vertices in S and T lie on c 1 -circle and c 2 -circle for some −1 < c 1 < c 2 < 1, and are ordered (cyclically) by π S and σ T , respectively.
Let π S and σ T be two permutations for S and T, respectively. A digraph D = (V, A, S, T ) is called ordered bispherical with respect to π S and σ T , if there is a consistent stable ST -bipartition [A 1 , A 2 ] of A such that D(A 1 ) and D(A 2 ) are ordered spherical with respect to π S and σ T . A super source of type m is denoted by S m and is a single source digraph of order 2m+1 whose vertex set is here the indices are considered modulo m, see Figure 2. The vertices {x 0 , x 1 , . . . , x m−1 } are the sinks of S m . A super sink of type n is denoted by T n and is a single sink digraph of order 2n + 1 whose vertex set is V (T n ) = {t, y 0 , y 1 , . . . , y n−1 , y ′ 0 , y ′ 1 , . . . , y ′ n−1 } and its arc set is  = {s 1 , s 2 , . . . , s m } and its sink set is T = {t 1 , t 2 , . . . , t n }. Assume that π S and σ T are permutations for S and T, respectively. Suppose that S m is a super source whose sink set is {x 0 , x 1 , . . . , x m−1 } and T n is a super sink whose source set is {y 0 , y 1 , . . . , y n−1 }.
Let us denote the single source and single sink digraph obtained as D = (V, A, S, T ) be a digraph and π S and σ T be permutations for S and T, respectively. The digraph is ordered spherical with respect to the permutations π S and σ T if and only if π S Dσ T is spherical.

Lemma 3.7 Let
proof. If π S Dσ T is spherical, then it is not hard to observe that, we can redraw the graph, if necessary, to obtain an upward embedding of π S Dσ T in which the vertices of S lie on a c 1 -circle and also the vertices of T lie on a c 2 -circle preserving their permutations. The proof of the other side of the lemma is obvious. ■ Consider the round sphere S = {(x, y, z)|x 2 + y 2 + z 2 = 1}, by S ϵ z we mean the portion of the sphere between the two level curves obtained by cutting the sphere with parallel planes Z = z and Z = z + ϵ, for all −1 < z < 1 and all 0 < ϵ < 1 − z. Note that, every upward embedding of a digraph D on sphere S can be redrawn to be an upward embedding on S ϵ z , for all −1 < z < 1 and all 0 < ϵ < 1 − z. According to this observation, we can show that for upward embedding of digraphs, each layer of T h is equivalent to the round sphere. It is summarized in the following proposition.

Proposition 3.8 The digraph D has an upward embedding on a layer of T h if and only if it has an upward embedding on the round sphere
By the following theorem we characterize the horoidal digraphs. We assume w.l.o.g. that the digraphs have no isolated vertex. proof. Suppose that D = (V, A, S, T ) has an upward embedding on T h . There are two cases that can be happen for D. Case 1. D has an upward embedding on a layer of T h . In this case, according to Proposition 3.8 it has an upward embedding on sphere. By Theorem 1.3 we conclude that D is a spanning subdigraph of a single source and single sink digraph D ′ = (V, A ′ , S ′ , T ′ ). That means the assertion for this case follows. Because D ′ is an ordered spherical with respect to the unique permutation of S ′ and T ′ . Case 2. D has no upward embedding on a layer of T h . In this case we consider an upward embedding of D on T h . Suppose that, the subset of sources (sinks) that must be placed on c min (c max ) is denoted by S ′ (T ′ ). Now, we add a set of new arcs F to this embedding in such way that all of them point up, they do t' s' and is orderd bispherical with respect to π ′ S and σ ′ T . Conversely, suppose that, there is a superdigraph D ′ = (V, A ′ , S ′ , T ′ ) of D that is an orderd spherical with respect to some permutations of S ′ and T ′ , for some S ′ ⊂ S and T ′ ⊂ T. In this case, D ′ is a horoidal digraph and therefore its subdigraph D is also horoidal. Now, suppose that there are some subsets S ′ ⊂ S and T ′ ⊂ T and some permutations π ′ S and σ ′ T for them such that a superdigraph D ′ = (V, A ′ , S ′ , T ′ ) of D is ordered bispherical with respect to π ′ S and σ ′ T . Let [A 1 , A 2 ] be its corresponding consistent stable S ′ T ′ -bipartition. In this case, the digraphs D ′ (A 1 ) and D ′ (A 2 ) are ordered spherical with respect to π ′ S and σ ′ T . Therefore, the digraph D ′ (A 1 ) and D ′ (A 2 ) can be embedded upwardly on inner layer and outer layer of T h , respectively such that these upward embeddings imposes an upward embedding for D ′ on T h . In other words, D ′ and therefore D has an upward embedding on the horizontal torus. ■ We characterize the horoidal digraphs by the above theorem. Note that, one can not apply it for characterization the digraphs that admit upward embedding on vertical torus. As an example, all arcs in A in every stable {s ′ }{t ′ }-bipartition of every super graph Fig. 3 belong to one part. That means it is inconsistent. Because k 3,3 is a subgraph of the underlying graph of indeced subdigraph on the aforementioned part. Therefore, this digraph is not horoidal. However, one of its upward embeddings on vertical torus is depicted in [11]. Now, by using the characterization stated in Theorem 3.9 we show that Problem 3 belongs to N P. It is summarized in the following theorem. Step 1 of the following two steps can be considered and if it is not sufficient (i.e., if the answer of Step 1 is not true) then another step must be considered, too.
Step 1. Check if the digraph D ′ is an ordered spherical with respect to π ′ S and σ ′ T .
Step 2. Check if the digraphs D ′ (A 1 ) and D ′ (A 2 ) are ordered spherical with respect to π ′ S and σ ′ T . For checking Step 1, it suffices to check if the single source and single sink digraph π ′ S D ′ σ ′ T is spherical. According to Theorem 1.3 it can be done by checking if its underlying graph is planar. Therefore this checking step can be done in polynomial time. If it is revealed that its undrlying graph is not planar then by using [A 1 , A 2 ] we have to consider Step 2. For checkinng Step 2 it is sufficient to check if the single suorce and single sink digraphs D ′ (A 1 ) and D ′ (A 2 ) are ordered spherical with respect to π ′ S and σ ′ T . Similarly, this step can be checked in polynomial time. Therefore the candidate solution can be checked in polynomial time. That means the assertion follows. ■

Source-in-sink-out graph of adigraph
In this section we want to show that the upward embedding testing problem on T h is an NP-hard problem. We do this by a polynomial time reduction from the upward sphericity testing decision problem. Let x and y be two vertices of a digraph D. By y ≺ x we mean the vertex x is reachable from the vertex y.
That means there is a directed path from y to x in D, especially y is reachable from itself by the trivial path. By N + (y) we mean all the reachable vertices from y and by N − (y) we mean all the vertices for which y is a reachable vertex. to introduce some useful properties of these defined subgraphs.

Lemma 4.11 Let x be an internal vertex of a digraph D, then all the arcs in
belong to the same equivalence class with respect to the relation R.
Proof. The internal vertex x has both incoming and outgoing arcs. Let a and a ′ be an incoming arc of x and an outgoing arc of x, respectively. For each arc in A(D O x ) there is a directed path containing that arc and a, therefore they belong to the same equivalence class. Similarly, for each arc in A(D I x ) there is a directed path containing that arc and a ′ , therefore they belong to the same equivalence class. On the other hand, there is a directed path containing a and a ′ , that means they belong to the same equivalence class too. According to the transitive property of R the proof is completed. ■ The relation between the arcs of the out-subgraph rooted at a source vertex and the relation between the arcs of the in-subgraph rooted at a sink vertex are shown in the following lemma. By Definition 2.5 two arcs of a digraph belong to the same equivalence class if they belong to a directed path. In the following lemma we show that two arcs of a source-in-sink-out graph belong to the same class if they belong to the same undirected path (not necessarily directed).
Lemma 4.14 Suppose that D is a digraph. If P is an undirected path in SISO(D), then all the arcs of P belong to the same equivalence class with respect to the relation R.
Proof. It is sufficient to show that each pair of consecutive arcs in P belong to the same equivalence class. To this end let a and a ′ be an arbitrary pair of consecutive arcs of P , and let v be their common vertex. Since the number of the arcs incident with v is at least two, by Lemma 4.13, the vertex v is neither a source vertex of SISO(D) nor a sink vertex of SISO(D). That means v is an internal vertex of SISO(D). Therefore by Lemma 4.11, the arcs a and a ′ belong to the same equivalence class. ■ The following theorem states a key property of the source-in-sink-out graph of a digraph. Proof. Let a = (x, y) and a ′ = (x ′ , y ′ ) be an arbitrary pair of arcs of D. Because of the connectivity of D, there is an undirected path P ′ between x to y ′ . If P ′ does not contain a, we add it to P ′ . In this case the starting point of the obtained undirected path is the vertex y. Similarly, we can add the arc a ′ to the undirected path, if it does not contain this arc. In other words, there is an undirected path P in D that contains a and a ′ . Thus, by Lemma 4.14, a and a ′ belong to the same equivalence class. ■ In the following theorem we observe that either both digraphs D and SISO(D) or none of them have upward embeddings on sphere. Proof. Suppose that we have an upward embedding of D on the round sphere S = {(x, y, z)|x 2 + y 2 + z 2 = 1}. Let S be the set of sources for which the number of their outgoing arcs is more than one and let T be the set of sinks of D for which the number of their incoming arcs is more than one. Without loss of generality, we can assume that none of the sources (sinks) of S (T ) is located at south (north) pole. Otherwise, we may modify the upward embedding to provide an upward embedding on the sphere with this property. Let s ∈ S be an arbitrary source in S with z its height (its z-coordinate) and consider S ϵ z−ϵ , where ϵ is small enough so that this portion contains no vertices of D in its interior. This portion may be partitioned into connected regions bounded by the monotonic curves corresponding to the arcs of D. We consider a point s ′ as an arbitrary point on the circle obtained by cutting the sphere with plane Z = z − ϵ so that the point s and s ′ are on the boundary of a region. Now, we draw the arc (s ′ , s) in the mentioned region by a monotonic curve. Similarly, if we draw an arc (t, t ′ ) for each sink t ∈ T by a monotonic curve without any crossing with other arcs.

Conclusion and some open problems
In this paper, we have presented a characterization for a digraph to have an upward embedding on T h . By that characterization we have shown that the decision problem to decide whether a digraph has an upward embedding on the horizontal torus belongs NP. We have constructed a digraph from a given digraph in such a way that it is horoidal if and only if it is spherical. Finally, we have presented a polynomial time reduction from the sphericity testing decision problem to the upward embedding testing on T h . That means we have shown that the upward embedding testing decision problem on T h is NP-Complete.
The following are some open problems: Dolati et. al in [11] presented a polynomial time algorithm to decide whether a single source and single sink digraph has an upward embedding on T h . Problem 1: Is it possible to find polynomial time algorithms for upward embedding testing of some other classes of digraphs on T h ? Problem 2: Characterize those digraphs which they are shperical if and only if they are horoidal.