Journal of Graph Algorithms and Applications Monotone Simultaneous Embeddings of Upward Planar Digraphs

We study monotone simultaneous embeddings of upward planar di-graphs, which are simultaneous embeddings where the drawing of each digraph is upward planar, and the directions of the upwardness of different graphs can differ. We first consider the special case where each digraph is a directed path. In contrast to the known result that any two directed paths admit a monotone simultaneous embedding, there exist examples of three paths that do not admit such an embedding for any possible choice of directions of monotonicity. We prove that if a monotone simultaneous embedding of three paths exists then it also exists for any possible choice of directions of mono-tonicity. We provide a polynomial-time algorithm that, given three paths, decides whether a monotone simultaneous embedding exists and, in the case of existence, also constructs such an embedding. On the other hand, we show that already for three paths, any monotone simultaneous embedding might need a grid whose size is exponential in the number of vertices. For more than three paths, we present a polynomial-time algorithm that, given any number of paths and predefined directions of monotonicity, decides whether the paths admit a monotone simultaneous embedding with respect to the given directions, including the construction of a solution if it exists. Further, we show several implications of our results on monotone simultaneous embeddings of general upward planar digraphs. Finally, we discuss complexity issues related to our problems.


Introduction
Let {G i = (V, E i )|1 ≤ i ≤ k} be a set of k distinct planar graphs sharing the same vertex set.A simultaneous embedding of these graphs is a set of their planar drawings {Γ i |1 ≤ i ≤ k} such that each vertex of V is represented by the same point in the plane in each of the drawings.Simultaneous embeddings were introduced as a model for visual comparison of different relations of the same object set, as well as for a visualization of dynamic changes of a single relation.If one restricts how the edges in the drawing must be realized, simultaneous embeddings can be specialized as follows.In geometric simultaneous embeddings all edges are required to be straight segments.In simultaneous embeddings with fixed edges, there is no special restriction on the shape of the edges, but the common edges of the graphs are required to be drawn in the same way in each of the drawings.Bläsius, Kobourov, and Rutter [4] give an extensive overview of the known results for these types of simultaneous embeddings.
Simultaneous embeddings were also studied for upward planar digraphs.A directed graph (digraph, for short) is called upward planar if it admits a planar drawing so that all its edges are represented by curves, monotonically increasing in a common direction, which is traditionally called upward.Upward drawings are motivated by a desire of a clearer expression of a hierarchy among a set of objects.An upward simultaneous embedding of k upward planar digraphs is a set of upward planar drawings of given graphs, such that each vertex is represented by the same point in the plane in each of the drawings.However, the choice of direction of "upwardness" to be common for all graphs does not make any sense.It is easy to see that for any two graphs G 1 = (V, E 1 ) and G 2 = (V, E 2 ), an upward simultaneous embedding with only one direction of upwardness does not exist if G = (V, E 1 ∪ E 2 ) contains a directed cycle.Motivated by this simple fact, Giordano et al. [8] considered upward simultaneous embeddings where the directions of upwardness are different.They showed that any two upward planar digraphs admit an upward simultaneous embedding, where the directions of upwardness differ by π/2.Giordano, Liotta, and Whitesides [9] gave a characterization of upward simultaneous embeddable digraphs with respect to the same direction.Pampel [19, p. 71] considered upward simultaneous embeddings of directed paths where the directions of upwardness are different and only a subset of vertices is common to all paths.This problem is known as Strictly Monotone Trajectory Drawing.Pampel [19, p. 71] showed that the problem is NP-hard even for paths with four vertices.
In this paper we study upward simultaneous embeddings for more than two graphs and different directions of upwardness.We formalize the problem as follows.Let v be a vector in R 2 .A drawing of a directed graph G = (V, E) is called v-monotone if its edges are represented by (directed) curves which are monotonically increasing in the direction of v. Let V = { v 1 , . . ., v k } (k > 1) be a set of vectors and let G = {G 1 , G 2 , . . ., G k } be a set of k distinct upward planar digraphs sharing the same vertex set.A V-monotone simultaneous embedding of G is a set {Γ 1 , . . ., Γ k } of planar drawings such that: (1) Γ i is a v i -monotone drawing of G i (1 ≤ i ≤ k) and (2) an equally labeled vertex is represented by the same point in all drawings of the set.A monotone simultaneous embedding of G is a V-monotone simultaneous embedding for some set V of vectors.
Monotone simultaneous embeddings of a set of graphs is closely related to so-called monotone drawings of graphs.In the latter a single graph is provided as an input and it is asked to be drawn such that there exists a monotone (usually straight-line edge) path between each pair of vertices.Monotone drawings of planar graphs have been studied in [1,2,14].These drawings are motivated by the desire to ease the visual tracking of a path between any two vertices.While monotonicity of a path contributes to the ease of path-following, it does not make a too significant difference, since a monotone path can be still rather wiggly.One possibility to make a path "smoother" is to require that the slopes of the edges of the path lie in a given small wedge.Notice that a wedge of angle π would correspond to a monotone path.The smaller the wedge is, the "smoother" the path becomes.We call this variant of monotone simultaneous embedding a wedge-monotone simultaneous embedding (or a W -monotone simultaneous embedding, when W = {w 1 , . . ., w k } is a set of wedges, and w i , 1 ≤ i ≤ k is the wedge where the edges of graph G i are required to lie).
We study the following problem.Given a set G of upward planar digraphs, we ask whether it admits a monotone simultaneous embedding.In order to shed light on this problem we also consider the following constrained version: Given a set G of upward planar digraphs and a set V of vectors, with |G| = |V|, we study whether G admits a V-monotone simultaneous embedding.
Observe that if a monotone simultaneous embedding of G exists, it is naturally associated with a vector set V. However, these vectors are not required to be radially ordered around the origin.In case of monotone simultaneous embeddings of a sequence of graphs, this will be a requirement.But we return to this point in the next section, after explaining how the sequences and sets of paths are related.
We remark that determining whether a monotone simultaneous embedding exists is more restricted than the Strictly Monotone Trajectory Drawing problem (see e.g.[19]), since in the former each vertex is shared by all of the paths.Observe that in a monotone simultaneous embedding of paths, it holds that, if we draw the edges straight-line, the resulting drawing of each path taken independently is intersection-free.Thus, if a monotone simultaneous embedding of a set of paths exists, then a geometric simultaneous embedding of these paths exists as well.In [5] it was shown that any two paths admit a geometric simultaneous embedding, which also happens to be monotone.It was also shown that there exists a set of three paths that do not admit a geometric simultaneous embedding.This implies that the same three paths do not admit a monotone simultaneous embedding.The same fact follows from the work of Asinowski [3] on suballowable sequences, as will be explained in more detail in Section 2.1.
Recall that in monotone simultaneous embeddings, as defined above, there is a restriction on how the edges are drawn, that is, they are required to be represented by monotone curves in some direction.This fact makes monotone simultaneous embeddings completely different from simultaneous embeddings of undirected graphs, for which it is known that any number of planar graphs admits a simultaneous embedding [18].As we have already mentioned, for monotone simultaneous embeddings this is not the case, and the existence of a monotone simultaneous embedding strongly depends on the choice of the directions of monotonicity.Intuitively, it is clear that the choice of such directions becomes more restricted as the order among the vertices of graphs becomes more strict.We first look at the core of this problem by assuming that each of our graphs is a simple directed spanning path (i.e., directed from one end of the path to the other) of the common vertex set V .Then we prove several implications of our results on general upward planar digraphs.
We start with introducing some tools in Section 2, namely relations to circular sequences of point sets and the dual representation of the considered problem.Our main results are concentrated in Sections 3-5 and are as follows.
• In Section 3.1 we consider sets of three directed paths.In contrast to sets of two paths which always admit a monotone simultaneous embedding (see also [5,8]), there exist sets of three paths which do not admit such an embedding [3,5].We show that, if a monotone simultaneous embedding for three directed paths exists, then it also exists for any set of predefined directions.We also show that this result is tight with respect to the number of paths, i.e., it does not hold for four or more paths.Further, we provide an example of three paths for which any monotone simultaneous embedding requires a grid of exponential (w.r.t. the number of vertices) size.We also discuss the implication of this result for wedge-monotone simultaneous embeddings.
• In Section 3.2 we consider larger sets of paths.We show that, given any set P = {P 1 , . . ., P k } of paths and a set V = { v 1 , . . ., v k } of vectors, we can decide in polynomial time whether P admits a V-monotone simultaneous embedding, including the construction of a solution if it exists.Together with the results from Section 3.1, this implies that, for k = 3, the existence of a monotone simultaneous embedding (without predefined directions) can be decided in polynomial time, which answers a question posed by Asinowski in [3].In case of existence, such an embedding can be constructed in polynomial time as well.
• In Section 4 we derive several implications of the aforementioned results on upward planar digraphs.Based on work of Giordano et al. [9], we first show that, given a set of k upward planar digraphs, the question whether they admit a monotone simultaneous embedding can be reduced to the same question for k paths, under the condition that the order of the vertices of the graphs in the projection on their direction of monotonicity is fixed.
We then state several results on monotone simultaneous embeddings of upward planar digraphs that are implied by this fact.
• Finally, in Section 5 we discuss the complexity of monotone simultaneous embeddings of k paths (on the same vertex set V ) when the directions of JGAA, 19(1) 87-110 (2015) 91 monotonicity are not predefined.We show that the construction problem becomes intractable for k > 3 and give reasons why the complexity of the decision problem does not directly follow from the NP-hardness of deciding stretchability of pseudo-line arrangements [22].Also, we consider a generalization of monotone simultaneous embeddings of paths and show NP-hardness of this version of the problem.
We conclude in Section 6 with several open problems.

Relation to circular sequences
The problem of monotone simultaneous embedding is strongly related to the circular sequence of a point set (see Goodman and Pollack [10,12] for details).
The circular sequence of a point set was also used in the related work by Giordano, Liotta, and Whitesides [9].Let be any line and S = {s 1 , . . ., s n } be a labeled set of points.Consider the orthogonal projection of S on .This gives a permutation of the indices of the points.Continuously rotate counterclockwise.Every time a supporting line of two points (i.e., the line defined by these two points) becomes normal to , two indices change their position (we omit details concerned with collinear point triples and parallel supporting lines).After having rotated by 180 • , the initial permutation of indices is reversed.Every pair of indices changed their relative position exactly once.This sequence of permutations defines the circular sequence of a point set S, which we denote by Σ(S). 1 An arbitrary periodic sequence of index permutations (not connected to any point set) which fulfills these properties (i.e., every pair changes its relative position exactly once per half-period) is called an allowable sequence.Hence, a circular sequence is an allowable sequence that stems from a projection of a point set on a rotating line.In our problem we are given a set of permutations (paths) and the question is whether there exists a point set such that its circular sequence contains the given set of permutations. 2In a related work, Asinowski [3] considered similar questions for allowable sequences: He introduced suballowable sequences, which are subsequences of allowable sequences, and investigated their properties; see also the remarks in Section 3. The following observations stem from properties of both, circular and allowable, sequences and most of them can also be found in (or derived from) [3].
Observation 1 A set {P 1 , . . ., P k } of directed paths on a common set of n vertices admits a monotone simultaneous embedding if and only if there exists a set S of n labeled points, such that for each i = 1, . . ., k, the circular sequence Σ(S) contains a permutation of indices defined either by P i or by its reverse path.
Note that only for a circular sequence Σ one can construct a point set S such that Σ = Σ(S).This fact gives us a necessary condition for the existence of monotone simultaneous embeddings.This necessary condition is the target of the remainder of this section, for which we need further preparation.Consider a set P of paths on a vertex set V = {v 1 , . . ., v k }.We denote by I(i, P ) the index of v i in path P ∈ P. A set of vectors which are all directed to the same half-plane is called adjusted.Given two indices i and j, we denote by P adj ij the set of paths which results from reversal of some of the paths of P so that I(i, P ) < I(j, P ) for each P ∈ P. If P = P adj ij for some indices i, j, 1 ≤ i, j ≤ n, then P is called adjusted.Recalling Observation 1, and noticing that in an adjusted set of paths some indices i and j do not switch their position, we get the following.
Until now we only talked about sets of paths.In order to relate a set of paths to a circular sequence we need to consider an order among the elements of a set of paths.Thus, we will denote by P an ordering of the elements of P. Analogously to circular sequences, if for any triple of paths P a , P b , P c ∈ P , where a < b < c, there exists a pair of vertices v i , v j ∈ V with I(i, P a ) < I(j, P a ) and I(i, P b ) > I(j, P b ) for which it holds that I(i, P c ) < I(j, P c ), we say that the sequence P of paths is non-allowable.It is allowable otherwise.More generally, a set P of paths is called allowable if its elements can be ordered to form an allowable sequence of paths.See Figure 1 for an example.The set of paths in Figure 1 (a) is not adjusted.Reversing P b results in an adjusted set of paths, shown in Figure 1 (b).The corresponding sequence P a , P b , P c , P d of paths (as given by the depicted order) is non-allowable.Moving P d to the front results in an allowable sequence of paths, see Figure 1 (c).Note that it may make sense that a sequence of paths contains the same path twice.(We will see that this is the case if the sequence of paths is associated with a sequence of vectors.)Proposition 3 Let P be an adjusted set of k paths on the same set of n vertices.An allowable sequence P of paths -if it exists -is unique up to reversal and can be constructed within O(kn 2 ) time.
Proof: The fact that, if there exists P which is an allowable sequence of paths then it is unique up to reversal, follows from the basic properties of allowable sequences (see [3,10]).
In the following, we provide a constructive algorithm similar to the one discussed in [3, page 4751] in order to be able to analyze its running time.
Let i and j be two arbitrary indices.We partition P into two sets P 1 = {P ∈ P : I(i, P ) > I(j, P )} and P 2 = {P ∈ P : I(i, P ) < I(j, P )}.In an allowable sequence P the elements of P 1 (resp.P 2 ) appear consecutive.Thus, an allowable P is either P 1 concatenated with P 2 or the other way around.We assume that the former happens, in the latter case the arguments are similar.Consider two indices k and l, that change their relative position among the elements of P 1 (resp.P 2 ).Then they cannot change it in P 2 (resp.P 1 ) as well.The collection P 1 (resp.P 2 ) can be partitioned recursively by the pair (k, l).Since the indices k and l change their relative position among the elements of P 1 (resp.P 2 ), we have to arrange the resulting two partitions in a way that the second (resp.first) partition have the same relative position of k and l as the elements of P 2 (resp.P 1 ).If at some recursive step we cannot apply this partition operation, this implies that no allowable sequence P exists.
For the running time of this algorithm, note that in O(kn) time, all paths can be preprocessed such that checking whether I(i, P ) < I(j, P ) can be done in constant time.Then each step of the above recursion takes O(k) time.Together with the fact that there are O(n 2 ) pairs of indices that can switch their position, we obtain a total running time of O(kn + kn 2 ) = O(kn 2 ).
We are now ready to state a necessary condition for the existence of monotone simultaneous embeddings that stems from the properties of circular sequences.
Lemma 1 Let P be a set of k paths on a set of n vertices.If P admits a monotone simultaneous embedding then for every pair of indices (i, j), 1 ≤ i, j ≤ n, the set P adj ij is allowable.
Proof: Assume that P admits a monotone simultaneous embedding.We will show that for any possible choice of indices 1 ≤ i, j ≤ n, the set P adj ij is allowable.Let S be a set of points representing vertices of the paths in P, in a { v 1 , . . ., v k }monotone simultaneous embedding of P. Let i and j be two arbitrary indices.Rotate S and vectors { v 1 , . . ., v k } until the line supporting i and j is vertical and i appears before j in the positive y-direction.Let S be the resulting point set.Reverse those vectors of { v 1 , . . ., v k } that point in the negative ydirection and also the corresponding paths of P. Let { v 1 , . . ., v k } and P denote the resulting vectors and paths, respectively.In P , index i appears before index j in each of the paths.Thus we have that P = P adj ij .Moreover, for any path P a ∈ P , the permutation defined by P a is an element of Σ(S ) (the corresponding element of Σ(S ) is created when points of S are projected on the line given by v a ).Thus, the constructed P adj ij is allowable.Lemma 1 and Proposition 3 imply the following.Corollary 4 If a set P of k paths with n vertices admits a monotone simultaneous embedding, then for every i, j, 1 ≤ i, j ≤ n, there exists an ordering P adj ij of P adj ij which is allowable.The sequence P adj ij can be computed within O(kn 2 ) time.
We observe that Corollary 4 allows us to restrict considerations to allowable adjusted sequences of paths.Any question that can be resolved in polynomial time for an allowable adjusted sequence of k paths is also polynomial-time solvable for a set of k paths.
Recall that, if an allowable sequence P 1 , . . ., P k of paths admits a monotone simultaneous embedding, where P i is embedded monotone in direction v i for 1 ≤ i ≤ k, then the sequence v 1 , . . ., v k of vectors is ordered around the origin.Thus, for P 1 , . . ., P k it makes sense to talk about v 1 , . . ., v k -monotone simultaneous embeddings, where the vectors appear in this order around the origin.Moreover, a monotone simultaneous embedding of a sequence of paths is refined to be a v 1 , . . ., v k -monotone simultaneous embedding.To emphasize the difference with the previous definition, in monotone simultaneous embeddings of a set of paths, no order was required on the vectors.

The Dual Problem
We will work on the problem of monotone simultaneous embedding in the dual plane by using the standard duality transform where a point s = (x s , y s ) is mapped to a non-vertical line l : y = x s x − y s and vice versa.See [7] for properties of the dual transform.In this section we briefly recall some properties of the transform which are used in this paper; see Figure 2 for an example.We denote by S a set of points in the primal (or a set of lines in the dual setting, respectively).Similarly, in the primal setting, single points are denoted by s, and lines are denoted by l.As a special case, we denote vertical lines in the dual by φ.Notation-wise, we do not distinguish between the primal and the dual setting.For example, s is a point in the primal and at the same time a line in the dual.
A well-known property of the duality transform is that the primal point s is below a primal line l if and only if the dual point l is below the dual line s.Further, the infinite set of points on the vertical line φ : x = α (as, e.g., φ 1 in Figure 2) corresponds to the set of lines with slope α (indicated by the directional vector v 1 in Figure 2).Let S be a primal set of n points and let π be Observe the order of projection of the points on the vectors in the primal and the corresponding order of the intersections with the vertical lines in the dual.the order in which the points are traversed by translating a line of slope α below all points in S to a line above all points of S. Then π is also the order in which the dual lines of S intersect the vertical line φ : x = α in negative y-direction.Consider now the lines that are normal to any line of slope α, i.e., the ones of slope (−1/α).The traversal of S by a line of that slope corresponds to the order in which the points of S are projected on .Therefore, this is the order in which the dual lines intersect the vertical line φ : x = (−1/α).Observe also that, for α → 0, the order is given by the slope of the lines.So, we have the following.
Observation 5 Consider a point set S, a directed path P containing the points of S, and a vector v of slope α.The edges of P can be drawn resulting in a v-monotone drawing of P if and only if the dual lines of S intersect the vertical line φ : x = (−1/α) in the same order as they appear either along P or along its reverse.
The vector v and the vertical line φ in the previous observation are said to correspond to each other.Recall that in the monotone simultaneous embedding problem we are given a set {P 1 , . . ., P k } of paths on the same vertex set V and our goal is to determine the positions of vertices V , such that the edges of each P i can be drawn resulting in its v i -monotone drawing for some vector v i , i = 1, . . ., k. Recall also that Corollary 4 allows us to consider only allowable adjusted sequence of paths.The following observations will be repeatedly used in the remainder of the paper.
Observation 6 An adjusted allowable sequence P 1 , . . ., P k of paths on a common set of vertices admits a monotone simultaneous embedding if and only if there exists a sequence of k ordered vertical lines φ 1 , . . ., φ k and a set {s 1 , . . ., s n } of n non-vertical lines that intersect the vertical line φ i , for each i = 1, . . ., k, in the same order as the points {s 1 , . . ., s n } appear along P i .
For the constrained version of monotone simultaneous embeddings we have the following.
Observation 7 An adjusted allowable sequence P 1 , . . ., P k of paths on a common set of vertices admits a v 1 , . . ., v k -monotone simultaneous embedding if and only if there exists a set of n non-vertical lines {s 1 , . . ., s n } that intersect the vertical line φ i , for each i = 1, . . ., k, in the same order as {s 1 , . . ., s n } appear along P i , where φ i is the vertical line in the dual corresponding to the vector v i , i = 1, . . ., k.
3 Monotone Simultaneous Embeddings in the Dual

Two and Three Paths
It is well known that given any sequence P 1 , P 2 of two paths and two vectors v 1 , v 2 , there always exists a v 1 , v 2 -monotone simultaneous embedding of P 1 , P 2 ; see for example [4,5,8].To give some intuition for the more complex cases of three or more paths, we present the following approach which utilizes the dual setting.
Let φ 1 and φ 2 be the two vertical lines along which the order for the paths is defined in the dual.Let the dual lines be labeled in increasing order of appearance in P 1 , and recall that I(i, P 2 ) is the index of s i in P 2 (the function I gives us the order π used before in the form of indices).Let the line s i pass through the point (x φ1 , −i) and (x φ2 , −I(i, P 2 )).This gives us a primal point set allowing a v 1 , v 2 -monotone simultaneous embedding of P 1 , P 2 .
In contrast to two paths, it is not always possible to find a monotone simultaneous embedding of three paths, even if there are no constraints on the directions of monotonicity.This also shows that the necessary condition of Lemma 1 is not sufficient.The proof of the following theorem uses a classical result by Ringel [20] on the stretchability of pseudo-line arrangements based on Pappus' Theorem.Recall that an existence of monotone simultaneous embedding of a set of paths implies an existence of their geometric simultaneous embedding.Recall also that there exists a set of three paths that do not admit a geometric simultaneous embedding [5].Thus, the following theorem also follows from [5].

Theorem 8 ([3, Proposition 8], [5, Theorem 3])
There are allowable path sets of three or more paths that do not admit a monotone simultaneous embedding.
On the positive side, a monotone simultaneous embedding for three paths does not strongly depend on the choice of the vectors: Theorem 9 Suppose that a path set P = {P 1 , P 2 , P 3 } admits a { v 1 , v 2 , v 3 }monotone simultaneous embedding.Then P admits a { v 1 , v 2 , v 3 }-monotone simultaneous embedding, for any vectors v 1 , v 2 , v 3 , provided that their radial order around the origin is the same as the one of v 1 , v 2 , v 3 .
Proof: By Corollary 4, we can assume that sequence P 1 , P 2 , P 3 is allowable and adjusted and hence, also the sequence { v 1 , v 2 , v 3 } is adjusted.Further, we can assume without loss of generality that v 1 is a vector with slope 0. By Observation 6, the dual vertical lines φ 1 , φ 2 , φ 3 , appear in this order from left to right.Further, the dual lines s 1 , . . ., s n that correspond to the vertices, cross each φ i in the order as they appear on P i .Recall the sphere model of the projective plane.Consider a plane and a sphere in R 3 such that the center point is not in the plane.Every line that intersects the plane in one point and passes through the center of the sphere intersects the sphere in two antipodal points, and every line through the center of the sphere intersects the plane, except if the line is parallel to the plane.The union of the points on the sphere defined in this way by lines parallel to the plane represents the line at infinity ∞ .Hence, we are given a bijective mapping from every point in the plane to two antipodal points on the sphere (not on ∞ ).In this mapping, a line in the plane corresponds to a great circle on the sphere.Consider now the vertical lines φ 1 , φ 2 , φ 3 that are crossed by the non-vertical lines s 1 , . . ., s n .If we apply the projective transformation that corresponds to rotating the sphere such that the great circle corresponding to φ 1 equals ∞ , we obtain different lines φ 2 , φ 3 , s 1 , . . ., s n in the plane, corresponding to φ 2 , φ 3 , s 1 , . . ., s n , respectively.The order of intersections of the transformed lines s 1 , . . ., s n on φ i , i ∈ {2, 3}, is identical to the order of intersections of the original lines s 1 , . . ., s n on φ i .Furthermore, the order of the slopes of the transformed lines s 1 , . . ., s n is identical to the order of intersections of s 1 , . . ., s n with φ 1 .Equivalently, φ 1 is the vertical line φ 1 : x = −∞ and hence, φ 1 corresponds to a vector v 1 with slope 0 in the primal.Now we can scale and translate the transformed lines φ 2 , φ 3 , s 1 , . . ., s n such that we have the vectors v 2 and v 3 in any position we want.
In contrast to the statement of Theorem 9, with four paths, we can first encounter the situation where the actual slopes and not just the relative radial order of the vectors influence the existence of a monotone simultaneous embedding.In other words, the statement of Theorem 9 is tight with respect to the number of paths; see Proposition 13 in Section 3.2.
Moreover, even if a monotone simultaneous embedding of three paths exists, an exponential (in the number of vertices) ratio of the smallest and largest distance between vertices of the embedding might be unavoidable.
Proposition 10 There exists a set of three paths such that every monotone simultaneous embedding needs a grid whose size is exponential in the number of vertices of the paths.Proof: Consider the example shown in Figure 3. Let the number of dual lines be any natural number n = 3m + 2, m > 0. The three specified paths are  In order to satisfy the order of s 1 , . . ., s n on φ 1 (at the "far left" of the example), the order of the slopes sl(s i ) of the lines s i has to be such that sl(s i ) < sl(s j ), for each i < j.Because of the given order on φ 2 there are m lines intersecting φ 2 between the intersections of s 1 and s 2 with φ 2 .The same is true on φ 3 .Assuming at least unit distance between two intersections on a vertical line, sl(s 2 ) has to be at least 2m + 2. As sl(s 2 ) has to be strictly smaller than sl(s 3 ), sl(s 3 ) is at least 2m + 3 and analogously sl(s 4 ) is at least 2m + 4. The line s 5 has to intersect φ 2 below the intersection of s 4 , and the intersection of s 5 with φ 3 has to be above the intersection with s 3 .As a result, sl(s 5 ) ≥ sl(s 3 )+sl(s 4 ), i.e., the slope of s 5 is at least 4m+7.In general, sl(s 3i ) ≥ sl(s 3i−1 ) + 1, sl(s 3i+1 ) ≥ sl(s 3i−1 ) + 2, and sl(s 3i+2 ) ≥ 2•sl(s 3i−1 ) + 3 − 2(i − 1), for 1 ≤ i ≤ m.Therefore, we get for the biggest slope on n = 3m + 2 lines, sl(s n ) ≥ 2 m (2m + 3) + 2m − 1 = Ω(n2 n 3 ).This proves that the ratio between minimal distance (unit distance) and maximal distance in the constructed point set is exponential in n.

Fixed Vectors
In this section we restrict considerations to the setting where we are not only given a set of paths, but also have predefined directions of monotonicity.
Theorem 11 Given a set v 1 , . . ., v k of vectors and a set P = {P 1 , . . ., P k } of paths on the same set of n vertices, it can be decided in polynomial time if a { v 1 , . . ., v k }-monotone simultaneous embedding of P exists.If such an embedding exists, it can also be constructed in polynomial time.
Proof: By Corollary 4, if P admits a monotone simultaneous embedding, an allowed adjusted ordering P of P exists and can be computed in polynomial time.W.l.o.g.we can assume that v 1 , . . ., v k is the ordering of adjusted vectors corresponding to P .
Let φ 1 , . . ., φ k be the vertical lines in the dual plane corresponding to the vectors in v 1 , . . ., v k .By Observation 7, in order to check whether P admits a v 1 , . . ., v k -monotone simultaneous embedding we need to check whether there exist non-vertical lines s 1 , . . ., s n that cross φ i as indicated by P i , i = 1, . . ., k.Let y i,j be the y-coordinate of the intersection of the line φ i with the line s j .Then, for every path P i and every pair (s l , s m ) of neighbored vertices in P i , we have the constraint y i,l > y i,m , or, equivalently, y i,l ≥ y i,m + 1 (since any solution can be scaled along the x-axis).Further, let q i be the distance between the vertical lines φ i and φ i+1 .To ensure that s 1 , . . ., s n are straight lines, we have the constraint (y 2,j − y 1,j )/q 1 = (y (i+1),j − y i,j )/q i ) for all 1 ≤ j ≤ n and all 2 ≤ i < k.To conclude, we observe that the constructed linear program can be solved in polynomial time.
Note that this result does not contradict Proposition 10: Although any monotone simultaneous embedding of the example from Figure 3 needs a grid of exponential (w.r.t. the number of vertices) size, the resulting coordinates still admit a representation of only polynomial size.
In [3], Asinowski asked whether deciding realizability of a suballowable sequence with three terms, which, in our terminology, is equivalent to the existence of a monotone simultaneous embedding for three paths, is a tractable problem.Combining Theorem 9 with Theorem 11, we can answer this question in the affirmative.
Corollary 12 Given a set of three paths, it can be decided in polynomial time whether they admit a monotone simultaneous embedding.If such an embedding exists, it can be constructed in polynomial time.
Consider again the linear program in the proof of Theorem 11.If the directions of the monotonicity are not provided as a part of the input, i.e., the distances q i are variables instead of constants, the presented encoding results in a quadratically constrained program.Thus, the program from the proof of Theorem 11 does not provide a means for answering the decision question for the existence of a monotone simultaneous embedding of paths in polynomial time.Moreover, the following proposition suggests that deciding the existence of a monotone simultaneous embedding might be harder for k ≥ 4 than it is for k = 3; see also Section 5.
Proposition 13 There exists a set P = {P 1 , P 2 , P 3 , P 4 } of four paths and two sets of vectors { v 1 , v 2 , v 3 , v 4 } and { v 1 , v 2 , v 3 , v 4 } with the same radial order around the origin, such that P admits a { v 1 , v 2 , v 3 , v 4 }-monotone simultaneous embedding, but does not admit a { v 1 , v 2 , v 3 , v 4 }-monotone simultaneous embedding.Proof: Consider the example shown in Figure 4.If we move the vertical lines φ 2 and φ 3 towards each other while leaving φ 1 and φ 4 unchanged, then the linear program does not have a solution and hence, no simultaneous embedding is possible.
Figure 4: The embeddability of this example depends on the relative distance between the vertical lines.The drawing shows the limit case, the bends in the line show the intended order of intersection.
In the following we discuss the implication of Theorem 11 for wedge-monotone simultaneous embeddings.Let v 1 and v 2 be two vectors such that the clockwise angle between v 1 and v 2 is less than π.It is easy to see that if a path P is both v 1 -monotone and v 2 -monotone then all the edges of P have their slope in the clockwise wedge between v 2 − π/2 and v 1 + π/2.Recall that the same path may appear twice (consecutively) in the adjusted sequence of paths.Together with Theorem 11, this implies the following: JGAA, 19(1) 87-110 (2015) 101 Corollary 14 Given a set of wedges W = {w 1 , . . ., w k } and a set P = {P 1 , . . ., P k } of paths on the same set of n vertices, it can be decided in polynomial time whether P has a W -monotone simultaneous embedding.If such an embedding exists it can be found in polynomial time.

Implications for Upward Planar Digraphs
Up to this point we have considered monotone simultaneous embeddings of directed paths.In this section we show how our results can be applied to provide insight on monotone simultaneous embeddings of more general graph families.More specifically, we consider upward planar digraphs, and upward planar digraphs with Hamiltonian paths.We list several definitions and known results before stating the main result of this section.An st-digraph is a biconnected acyclic digraph with exactly one source s and one sink t.A planar st-digraph is an st-digraph that is planar and embedded in the plane with vertices s and t on the boundary of the external face. 4A topological numbering of a digraph is an assignment of numbers to its vertices, such that for every directed edge (v, v ), the number assigned to v is greater than the number assigned to v. If each vertex is assigned a distinct number, then we talk about topological ordering (see Figure 5(a)).Every planar acyclic digraph has at least one topological ordering, and such an ordering can be computed in O(n) time [6].Let G be an upward planar digraph.A planar st-digraph that includes G as a spanning subgraph is called including planar st-digraph of G.While every upward planar digraph G can be augmented to a planar st-digraph G that has G as a subgraph (see e.g.[6]), it is not generally true that an upward planar digraph G with a topological ordering ρ can be augmented to a planar st-digraph G such that G still fulfills the topological ordering ρ of G (see Figure 5(c)).If the latter is true, we say that G preserves ρ (see Figure 5(b)).However, as the following lemma by Giordano et al. [9] states, it can be tested efficiently whether G exists.
Lemma 2 ([9, Lemma 5]) Let G be an upward planar digraph with n vertices and ρ be a topological ordering of G.There exists an O(n)-time algorithm that tests whether there exists an including planar st-digraph of G that preserves ρ.
Let again G be an upward planar digraph and v be an arbitrary vector.In a v-monotone drawing of G, its vertices, when orthogonally projected on v, imply a topological ordering of G.However, a general upward planar graph can have exponentially many distinct topological orderings.This explains the additional freedom contained in the problem of monotone simultaneous embeddings for upward planar digraphs, since each digraph can appear in such an embedding in many different ways, according to the number of its topological orderings.
Thus, to generalize our results for paths to upward planar digraphs, we have to consider the case where each upward planar digraph is provided together with a topological ordering.More precisely, let G be an upward planar digraph and ρ its topological ordering.A v-monotone drawing of G, such that the order in which its vertices appear in the orthogonal projection on v coincides with ρ, is called ( v, ρ)-monotone.More generally, an upward drawing of G is called ρ-constrained if it is ( v, ρ)-monotone for some vector v.In [9,16], ρ-constrained drawings of upward planar digraphs were considered for so-called book embeddings, drawings where vertices are required to lie on a single oriented line and edges are represented by curves monotonically increasing in the direction of this line.In [9] ρ-constrained book embeddings were utilized to construct a so-called upward point set embedding of an upward planar digraph with a given mapping, that is an upward planar drawing where the positions of the vertices of the graph are provided as a part of the input.The following theorem is a restricted version of [9,Theorem 3].
Theorem 15 ([9]) Let G be an upward planar digraph with n vertices, ρ be a topological ordering of G, and v be a vector.Assume that the vertices of G are positioned in the plane such that their orthogonal projection on v coincides with ρ.Then, the edges of G can be drawn as polygonal lines resulting in a ( v, ρ)-monotone planar drawing if and only if G has an including planar stdigraph G preserving ρ.Also, such a ( v, ρ)-monotone drawing of G (with at most 2n − 3 bends per edge) can be computed in O(n 2 ).
Let G = {G 1 , . . ., G k } be a set of upward planar digraphs with topological orderings O = {ρ 1 , . . ., ρ k }, respectively, and let V = { v 1 , . . ., v k } be a set of vectors.We say that a simultaneous embedding Γ of G is (V, O)-monotone if the drawing of G i implied by Γ is ( v i , ρ i )-monotone, for each i = 1, . . ., k.

JGAA, 19(1) 87-110 (2015) 103
More generally, a simultaneous embedding of G is O-constrained, if it is (V, O)monotone for some vectors V.If G = (V, E) is an upward planar digraph and ρ is a topological ordering of G, the directed path P with vertex set V , which traverses the vertices in the order indicated by the topological ordering ρ, is said to be implied by ρ.Now we are ready to state the main result of this section.
Theorem 16 Let G = {G 1 , . . ., k } be a set of upward planar digraphs on the same set of n vertices and let V = { v 1 , . . ., v k } be a set of vectors.Consider O = {ρ 1 , . . ., ρ k } and P = {P 1 , . . ., P k }, where ρ i is a topological ordering of G i and P i is the directed path implied by ρ i , for i = 1, . . ., k.
The set G admits a (V, O)-monotone simultaneous embedding if and only if the set P of paths admits a V-monotone simultaneous embedding, and each G i , i = 1, . . ., k, has an including planar st-digraph G i that preserves ρ i .In case of existence, a (V, O)-monotone simultaneous embedding of G can be constructed in O(kn 2 ) time.
Proof: For the "only-if" part, let Γ be a (V, O)-monotone simultaneous embedding of G. Recall that the vertices of G i (i = 1, . . ., k), when projected on v i , appear in topological ordering ρ i , and therefore, by the definition of P i , in the order they appear in P i .Thus, if we use the position of the vertices of G i given by Γ, and draw the edges of P i straight-line, we obtain a v i -monotone drawing of P i .Observe that Γ implies a ( v i , ρ i )-monotone drawing of G i , thus, by Theorem 15, G i has an including planar st-digraph G i preserving ρ i .
For the "if" part, let Γ be a V-monotone simultaneous embedding of P and let G i be an including planar st-digraph of G i , preserving ρ i , i = 1, . . ., k.The vertices of P i (therefore of G i ) appear in the orthogonal projection on v i in the same order as they appear in P i , and therefore in the same order as in ρ i .With this placement of vertices, we can apply Theorem 15 k times, to obtain a ( v i , ρ i )monotone drawing Γ i of G i , i = 1, . . ., k.For each vertex v j , all corresponding points s i,j of the drawings Γ i , i = 1, . . ., k, are identical.Therefore, the drawings Γ 1 , . . ., Γ k comprise a (V, O)-monotone simultaneous embedding of G. Finally, the claimed running time for the construction follows directly from Theorem 15.
In the following, using Theorem 16, we derive several implications of Theorem 11 and Corollary 12 for upward planar digraphs.
Corollary 17 Given a set V = { v 1 , . . ., v k } of vectors and a set G = {G 1 , . . ., G k } of upward planar digraphs together with topological orderings O = {ρ 1 , . . ., ρ k }, it can be decided in polynomial time (w.r.t. the input size) whether a (V, O)-monotone simultaneous embedding of G exists.In case of existence, such an embedding can be constructed in polynomial time.
Proof: Let P = {P 1 , . . ., P k }, where P i is the path implied by ρ i , i = 1, . . ., k.By Theorem 16, G admits a (V, O)-monotone simultaneous embedding if and only if (1) the set P of paths admits a V-monotone simultaneous embedding and (2) each G i , i = 1, . . ., k, has an including planar st-digraph G i preserving ρ i .By Theorem 11, Condition (1) can be checked in polynomial time, and the same is true for Condition (2) by Lemma 2. For the construction, the claimed running time follows from Theorem 16.
Corollary 18 Given a set {G 1 , G 2 , G 3 } of three upward planar digraphs and their topological orderings O = {ρ 1 , ρ 2 , ρ 3 }, it can be decided in polynomial time (w.r.t. the input size) whether there exists an O-constrained simultaneous embedding of {G 1 , G 2 , G 3 }.If such an embedding exists, it can be constructed in polynomial time as well.
Observe that if an upward planar digraph is Hamiltonian5 , then it has a unique topological ordering.This topological ordering can be found in O(n) time.Thus, from Corollary 17 and Corollary 18, we derive the following.Corollary 20 Given a set G = {G 1 , G 2 , G 3 } of three Hamiltonian upward planar digraphs, it can be decided in polynomial time (w.r.t. the input size) whether G admits a monotone simultaneous embedding.In case of existence, such an embedding can be constructed in polynomial time.

Complexity issues 5.1 Monotone Simultaneous Embeddings of Paths
In this section we discuss the relation of monotone simultaneous embeddings of paths to stretchability of pseudolines and realizability of circular sequences.
Goodman, Pollack, and Sturmfels [13] showed that for each n there exist order types with n elements such that any realization has coordinates that are doubly exponential in the number of points.Suppose we are given such a realization.Then, we can add a vertical line between every two consecutive crossings as well as before and after all crossings, and derive a vector and a path for each vertical line.Given these vectors and paths as an input, our linear program will produce a solution whose binary representation is exponential in the number of lines.This is, however, no contradiction to the fact that we have a polynomial-time algorithm when we are given the relative distance of the vertical lines: these distances will have a binary representation that is exponential in the number of lines as well, and hence, the algorithm is still polynomial in the input size.On the other hand, if we are only given the sequence of paths (i.e., the circular sequence of the set), the size of a solution will be exponential in the input size, and hence, there cannot be a polynomial-time algorithm for giving a set of points (assuming a sufficiently strict model of computation).This fact, however, does not imply intractability of deciding the simultaneous embeddability of a sequence of paths, even though the possibly large representation of a realization suggests ∃R-hardness (see [21], where these complexity topics are discussed, and, e.g., [15], where similar issues arise).
With respect to deciding simultaneous embeddability, it is interesting to observe the relation between the problem of stretchability of arrangements of pseudo-lines and our setting.Obviously, an algorithm deciding stretchability of pseudo-line arrangements also decides whether a simultaneous embedding of a sequence of paths exists.On the one hand, deciding stretchability is known to be NP-hard [22], and actually equivalent to the existential theory of the reals [17].On the other hand, NP-hardness of the stretchability problem does not directly imply NP-hardness of the problem at hand.However, the problem of deciding whether there exists a point set for a given allowable sequence can easily be reduced to our problem: add a path for every index sequence of the circular sequence (this corresponds to placing a vertical line directly to the right of each crossing in the corresponding pseudo-line arrangement in the Euclidean plane).If there exists a simultaneous embedding of this sequence of paths, then the given allowable sequence can be realized.
Note that there is a significant difference between stretchability of a pseudoline arrangement and realizability of an allowable sequence.Goodman and Pollack [10] give an allowable sequence on five elements that is not the circular sequence of any point set, while the smallest non-stretchable pseudo-line arrangement in the projective plane has nine pseudo-lines [11] (i.e., Ringel's construction using Pappus' Theorem).We are not aware of any work showing hardness of deciding realizability of allowable sequences (it is not obvious to us that, e.g., Shor's construction [22] can also be used in the more constrained setting using allowable sequences, in particular after the transformation to an arrangement with no three pseudo-lines sharing a point).

A Closely Related Problem
The hardness of deciding stretchability of pseudo-lines in the projective plane can be reduced in a straight-forward manner to the following problem closely related to monotone simultaneous embeddings.Given a sequence P 1 , . . ., P k of paths, each containing a subset of arbitrary size of a vertex set V , is there a monotone simultaneous embedding such that the directions of monotonicity appear radially around the origin?We call this problem General Monotone Simultaneous Embedding (GMSE, for short).GMSE is more general than our original problem in the sense that the paths might not contain all the vertices.Since GMSE requires that the directions of monotonicity are radially ordered, it might seem that GMSE is more restricted than our original problem.However, this is not the case, because for the original monotone simultaneous embedding of a set of paths, only one ordering of the paths has to be considered, as was proven in Proposition 3.However, GMSE is more restricted than the Strictly Monotone Trajectory Drawing problem, which was proven to be NP-hard [19], since in the latter it is not required that the directions of monotonicity are radially ordered.
Proof: Take any x-monotone drawing of the pseudo-line arrangement in the Euclidean plane such that every crossing is at its rightmost possible position.Let P 1 be a path that contains all points in the order given by the line v 1 : x = −∞.Sweep the arrangement in x-direction.At a crossing between the pseudolines s i and s j (suppose w.l.o.g.I(i, P 1 ) < I(j, P 1 )), we add the paths s j , s i , s l or s l , s j , s i for all other elements s l , depending on whether the pseudo-line s l is above or below the crossing s i s j .This clearly encodes the orientation of all triples, and therefore the pseudo-line arrangement in the projective plane is unambiguously fixed.Also, since the crossings are drawn at their rightmost possible positions, no further restrictions are imposed on the circular sequence of the resulting set (if such a set exists).If two crossings are independent, we do not care about their relative order, and this is also not captured by the relative order of two paths in which two independent pairs are required to be swapped; the relative order of the crossings is partial, and moving all crossings to the right as far as possible corresponds to constraining the relative order for each crossing in the highest level of the partial order.Hence, if and only if there exists a monotone simultaneous embedding of the paths, the pseudo-line arrangement is stretchable.

Conclusion
In this paper we considered monotone simultaneous embeddings of sets of upward planar digraphs, with both predefined and arbitrary directions of monotonicity, where we first concentrated on the special case of directed spanning paths with the same vertex set.
We proved that if a monotone simultaneous embedding of three directed paths exists, then it also exists for an arbitrary choice of directions with the same circular order.We also presented a polynomial-time decision and construction algorithm.Further, we showed that the existence question for an arbitrary number of paths, but with predefined directions, can be solved in polynomial time as well.
On the other hand, we showed that even if a monotone simultaneous embedding of three given paths exists, it might require an exponential (in the number of vertices) ratio of the smallest and largest distance between points of the embedding.Further, we showed that starting from k = 4, not only the relative circular order of the directions but also the actual choice of the slopes influences monotone simultaneous embeddability.
We also considered the complexity of the problem for k > 3 paths and arbitrary directions.In contrast to Theorem 11, the construction problem becomes intractable for arbitrary directions, since the constructed embedding might require a representation using coordinates of exponential size.However, showing hardness of the decision question remains an open problem for k > 3.
We further showed several implications of the simultaneous embedding of directed paths to upward planar digraphs.However, we had to restrict considerations to the setting where an upward planar digraph is provided together with a topological ordering.The question which remains open is whether our results can be extended to the case where the topological ordering is not provided as a part of the input.
It might be interesting to study what happens if the same edge has to be realized the same way in all of the drawings, i.e., monotone simultaneous embeddings with fixed edges.It seems clear that in this case, if two graphs share an edge, they should have related directions of monotonicity.
Furthermore, it might also be interesting to consider a problem that is "between" the setting with predefined directions and the one with arbitrary directions.More specifically, let A = {α 1 , . . ., α k } be a set of wedges centered at the origin.If a set P = {P 1 , . . ., P k } of paths admits a { v 1 , . . ., v k }-monotone simultaneous embedding, such that v i ∈ α i , we say that P admits an A-monotone simultaneous embedding.As a generalization of monotone simultaneous embeddings with fixed directions, it would be interesting to study the computational complexity of deciding whether a set P of paths admits an A-monotone simultaneous embedding.

6 PFigure 1 :
Figure 1: (a) The set {P a , P b , P c , P d } of paths is not adjusted.(b) Reversing P b to get P b leads to an adjusted set {P a , P b , P c , P d }.(c) The sequence P d , P a , P b , P c is allowable while the sequence P a , P b , P c , P d is non-allowable.

Figure 2 :
Figure 2: A point set (left) and its dual arrangement of lines (right).The two vectors to the left are represented by the two vertical lines in the dual.Observe the order of projection of the points on the vectors in the primal and the corresponding order of the intersections with the vertical lines in the dual.

Figure 3 :
Figure 3: Example for three paths where any monotone simultaneous embedding requires a grid of exponential size.The dual lines are labeled with their index (e.g., s 2 ) and their slope (e.g., 2m + 2).

Figure 5 :
Figure 5: A digraph G with a topological ordering ρ defined by the labels at the vertices.(b) An including planar st-digraph G of G that preserves ρ.(c) An upward planar digraph with a topological ordering for which no including planar st-digraph exists, that would preserve its ordering.

Corollary 19
Given a set V = { v 1 , . . ., v k } of vectors and a set G = {G 1 , . . ., G k } of Hamiltonian upward planar digraphs, it can be decided in polynomial time (w.r.t. the input size) whether a V-monotone simultaneous embedding of G exists.If such an embedding exists, it can be constructed in polynomial time.