1 Introduction
A visibility representation of a graph is a set of disjoint geometric objects representing vertices chosen from a family of allowed objects (e.g., axisaligned rectangles in the plane) where sees if and only if . Typically, the meaning of “sees” is that there exists a line segment (perhaps axisaligned, perhaps positive width) from to that does not intersect for any other ; such a line segment is called a lineofsight. Many different classes of visibility representations may be defined by changing the family of allowed objects and the meaning of “sees.” For example, bar visibility representations (BVRs) use horizontal line segments as vertices and vertical linesofsight for edges [9, 11, 21, 20, 7, 14, 15]; rectangle visibility representations (RVRs) use (solid) axisaligned rectangles as vertices and axisaligned linesofsight for edges [8, 22, 18, 2, 5, 16]; and unit square visibility representations (USVRs) use axisaligned unit squares and axisaligned linesofsight for edges [4]. The popularity of this type of graph representation lies partly in its potential applicability to problems in VLSI design and the production of readable representations of planar and nonplanar graphs. Determining which graphs or families of graphs have visibility representations of a particular type is a fascinating area of research.
Our focus in this work is on the simultaneous visibility representation of pairs of graphs that share the same vertex set (see Fig. 1). A simultaneous visibility representation (SVR) of and is a visibility representation that, using vertical linesofsight, represents and, using horizontal linesofsight, represents . Streinu and Whitesides [19] describe a beautiful connection between a pair of directed planar graphs and their planar duals that determines if the pair has a directed simultaneous visibility representation using rectangles (a directed RSVR) , where an edge directed from to in or is realized by a lowtohigh or lefttoright, respectively, lineofsight from to . Evans et al. [13] extended this to the family of geometric objects called Lshapes, which are the union of two axisaligned segments in the plane that share a common endpoint and come in four orientations: . They gave a polynomial time algorithm for determining if a pair of directed graphs has a directed simultaneous visibility representation using Lshapes, , in which the orientation of is given by (a directed LSVR).
The complexity of determining if a pair of undirected graphs has a simultaneous visibility representation using Lshapes was stated as an open problem [13]. In this paper, we show (Section 3) that the problem is complete. What is surprising about this result is the simplicity of the graphs for which the problem is hard: For Lshapes (and many other families of shapes including rectangles), one graph can be a set of disjoint paths and the other a set of disjoint copies of a tree with 3 leaves connected to a root by paths of length 2 (). For unit squares (and for translates of any specified connected shape with positive width and height), one graph can be a set of disjoint paths and the other a set of disjoint claws ().
This limits the families of graphs for which we can reasonably hope to efficiently determine a simultaneous visibility representation. We describe a linear time algorithm (Section 4) that can determine if a pair of undirected paths has a simultaneous visibility representation using Lshapes, all with the same orientation (an LSVR). The algorithm is quite simple but relies on characterizing those pairs of paths for which such a representation is possible. Note that determining the same question for representations using rectangles, unit squares, and Lshapes with more than one orientation is easy.
Our work has aspects of both visibility representation and simultaneous geometric graph embedding (SGE). SGE is the problem of deciding, given a set of planar graphs on the same set of vertices, whether the vertices can be placed in the plane so that each graph has a straightline drawing on the placed vertices. As in our problem, SGE, which is hard [12], asks to represent several specified graphs using one common vertex set representation. However, the hardness result for SGE does not directly imply hardness of deciding simultaneous visibility representation. Similarly, deciding if a graph has an RVR [18] or a USVR [4] is hard, but since the input does not specify which edges should be realized as vertical versus horizontal linesofsight, the problems are quite different. Choosing how the graph should be split into vertical and horizontal parts is an additional opportunity (or burden) for deciding if these representations exist.
Rather than requiring the visibility representation to partition the edges of the graph in a prescribed manner between vertical and horizontal visibilities, Beidl et al. [1] require that the visibility edges (linesofsight) obey the same embedding as a prescribed embedding of the original graph, which may include edge crossings. They can decide if such a restricted RVR exists in polynomial time, and in linear time if the graph is 1planar. Di Giacomo et al. [10] show that deciding if a similarly restricted orthopolygon^{1}^{1}1a polygon whose edges are axisaligned. visibility representation exists for a given embedded graph takes polynomial time as well.
2 Preliminaries
In this paper, we will assume that vertex shapes are connected and closed (rather than open) sets in the plane, and that linesofsight are 0width (rather than positivewidth) and exist between two shapes if and only if the corresponding vertices are connected by an edge. This implies that and must have strongvisibility representations [20] to have a simultaneous visibility representation. For visibility graphs, these choices make a difference since, for example, can be represented if linesofsight are positivewidth (an visibility representation) but does not have a strongvisibility representation [20]. However, for our results, we could adopt either model with only minor modifications to our proofs.
Let be an SVR of . Given a subset , we let . For a vertex , let and be the orthogonal projections of onto the axis and axis respectively. For a set of vertices , let and . Set , , , and . We write if , and similarly, if . We also use the shorthand for . What follows are three basic properties of visibility representations. See Fig. (a)a for an illustration of Property 2.
Note: For brevity, the following properties are stated for vertical visibility representations only but also hold for horizontal visibility representations by symmetry.
Property 1
In a (vertical) visibility representation of a graph , for any and any there exists a path in from to for some and such that for all .
Proof
Consider the intersection of and the infinite vertical line . Since this line intersects both and , there must be two vertices and such that and both intersect the line. Let be the sequence of vertices in that intersect the line in order along the line from to . and have an unblocked vertical visibility segment between them for all , which implies a path between and that connects and in .
Property 2
In a (vertical) visibility representation of a graph , if an endpoint of is strictly contained in and for , then there is a cycle in .
Proof
Since an endpoint of is strictly contained in , there exists and such that . By Property 1, there exists a path from to (following the vertical line through ) that, since , contains , and a path from to (following the vertical line through ) that does not contain . The union of these two paths contains a cycle.
Property 3
In a (vertical) visibility representation of a graph , if is the only path from to in and and are both above or both below for , then .
Proof
If , then by Property 1, there exists a path from to (following the vertical line through ) that, since and are both above or both below , does not include , a contradiction.
3 Hardness
In this section, we study the complexity of determining if a pair of undirected graphs has a simultaneous visibility representation. We consider two variants of this problem: (i) using unit squares (Section 3.1) and (ii) using rectangles (Section 3.2). Our techniques easily generalize to other connected shapes. In the case of Lshapes, our results settle an open question of Evans et al. [13].
To begin, we state two lemmas common to Sections 3.1 and 3.2 (see Fig. 2). We will use these lemmas to characterize how the gadgets used in our hardness proofs can be drawn.
Lemma 1
Let be a connected graph with a (vertical) visibility representation . If is a cut vertex whose removal from creates components then for at most two components .
Proof
Since is connected, intersects and if in addition , then since is connected, is a contiguous interval that strictly contains an endpoint of . If three components have this property then for two of them, say and , and strictly contain the same endpoint and thus contain a point . By Property 1, contains a path (following the vertical line through ) between and that does not contain , a contradiction.
Lemma 2
Let be a graph with a (vertical) visibility representation . If and are two components in then either ^{3}^{3}3 means for all and , or vice versa.
Proof
Since each component is connected, its projection forms a contiguous interval. And yet since and are disconnected in , by Property 1, . Thus either , or vice versa.
3.1 USSVR recognition
In this section, we prove that determining if a pair of undirected graphs has a simultaneous visibility representation using unit squares (USSVR) is complete. We reduce from the wellknown complete problem of Monotone NotAllEqual 3SAT [17]. In this variant of 3SAT, every clause has three positive literals of which exactly one or two must be satisfied.
The main result of this section can be summarized as follows.
Theorem 3.1
Deciding if a pair of undirected graphs has a USSVR is complete.
Construction. Let be an instance of Monotone NotAllEqual 3SAT with clauses and variables . For convenience, let us denote the variables appearing in clause as and the corresponding literals as . We construct a pair of graphs and such that admits a USSVR if and only if is satisfiable.
Order and its literals according to the order in which they appear in . For each clause , we create a clause vertex and three literal vertices . Our reduction relies on two types of gadgets which we describe below.
Satisfiability Gadgets. For each clause , we construct a satisfiability gadget, denoted , by introducing edges for .
Consistency Gadgets. For each variable with corresponding literals (in order), we construct a variable consistency gadget, denoted , by introducing edges for all . Similarly, if are the clauses of (in order), we construct a clause consistency gadget, denoted , by introducing edges for all .
Intuitively, the satisfiability gadgets allow us to encode local constraints on the literals for each clause. We use this to enforce “notallequal” satisfiability. By contrast, the consistency gadgets allow us to encode global constraints that span multiple clauses; i.e., relating literals that correspond to the same variable. This completes our construction of ; see Fig. 3 for an example.
Correctness. Lemmas 3 and 4 establish the correctness of our reduction. Hence, since our construction of requires time, USSVR recognition is hard. Note that every USSVR can be redrawn on an grid such that its visibilities are not changed by preserving the order of the endpoints in the and projections of its unit squares [4]. This gives a certificate using polynomiallymany bits that can be readily verified in polynomial time. Thus, USSVR recognition is complete.
Lemma 3
If admits a USSVR, then is satisfiable.
Proof
Let be a USSVR for . We construct a truth assignment as follows. For every variable , we define
We claim that satisfies . To see this, let us consider any clause . By construction, is a cut vertex whose removal from creates three components, each containing one literal vertex that is adjacent to . Then by Lemma 1, for at least one such vertex, say , . But in fact, since is a USSVR, we have . Hence, for every , .
Applying Property 3, we see that and must not be both above or both below . Moreover, since every consistency gadget in our construction is a component of , Lemma 2 implies that for all variables , either , or vice versa. Therefore, either for , implying that satisfies exactly one literal in , or , implying that satisfies exactly two. By repeating this argument for all clauses in , we see that satisfies .
Lemma 4
If is satisfiable, then admits a USSVR.
Proof
Let be a truth assignment satisfying . To construct a USSVR for , we first represent and as two sets of intervals on the and axes respectively. The construction of these intervals is as follows.
Suppose are the clauses of in order. For each clause , since satisfies exactly one or two of its literals, there must be one, say , that attains a unique truth value. We represent both and on the axis by the interval . Moreover, assuming and are in order, we represent their corresponding literal vertices on the axis as the intervals and respectively, for some positive but small .
Let be a bijection satisfying if and only if for each . For each variable consistency gadget , we represent its vertices on the axis by the interval . We also represent the clause consistency gadget similarly, replacing with .
Observe that each vertex in is represented by two unit intervals, one on the axis and one on the axis. Thus, for each , we can define to be the Cartesian product of its two corresponding intervals. To see that this gives a valid USSVR for , we make three observations.

Every gadget in (resp., occupies a contiguous interval on the axis (resp., axis) that is disjoint from the intervals of other gadgets.

Every satisfiability gadget in for a clause is drawn such that blocks vertical visibility between and for .

Every consistency gadget in is drawn as a horizontal stack of unit squares (in order from left to right) that share a projection.
The first observation implies that no two gadgets in (resp., ) share an (unwanted) visibility. The next two observations mean that the implied visibilities for each gadget in and are realized exactly. Therefore, is indeed a valid USSVR for . See Fig. 3 for an example construction.
3.2 RSVR recognition
In this section, we present an alternate reduction to prove that determining if a pair of undirected graphs has a simultaneous visibility representation using rectangles (RSVR) is complete. In contrast to the proof given in Section 3.1, here, we reduce from the wellknown complete problem of 3SAT [6].
A new reduction is needed since every pair of edgedisjoint caterpillar forests (as produced for the reduction in Section 3.1) has an RSVR due to Theorem 5 by Bose et al. [2].
Our modified construction is not much more complicated than before: one graph remains a set of disjoint paths while the other is a set of disjoint trees with 3 leaves connected to a root by paths of length 2. This slight modification allows us to prove the following theorem.
Theorem 3.2
Deciding if a pair of undirected graphs has an RSVR is complete.
Construction. Let be an instance of 3SAT with clauses and variables . As before, we denote the variables appearing in clause as and the corresponding literals as .
We adapt the gadgets used in Section 3.1 to this setting as follows. For each clause , we create three additional negated literal vertices and augment by introducing three edges for . Also, for each variable with corresponding literals (in order), we construct a negated variable consistency gadget, denoted , by introducing edges for all . See Fig. 4 for an example.
Correctness. Lemmas 5 and 6 establish the correctness of our reduction. Thus, by a similar argument to the one found in Section 3.1, RSVR recognition is complete.
Lemma 5
If admits an RSVR, then is satisfiable.
Proof
Let be an RSVR for . If, for some variable , we have , or vice versa, we say that is positivelyarranged in . We construct a truth assignment as follows. For each variable , we define
We claim that satisfies . To see this, let us consider any clause . By construction, is a cut vertex whose removal from creates three components, each containing one literal vertex and its negated counterpart. Then by Lemma 1, for at least one literal, say , we have . Hence, .
Applying Property 3, we see that and must not be both above or both below . Moreover, since the consistency gadgets in our construction are components of , Lemma 2 implies that their projections must form disjoint intervals. Therefore, either , or vice versa. Thus, if (i.e., is positive), then is positivelyarranged in ; otherwise, implies that is not positivelyarranged in . In either case, satisfies . By repeating this argument for all clauses in , we see that satisfies .
Lemma 6
If is satisfiable, then admits an RSVR.
Proof
Let be a truth assignment satisfying . To construct an RSVR for , we first represent and as two sets of intervals on the and axes respectively. The construction of these intervals is as follows.
Suppose are the clauses of in order. For each clause , we represent on the axis by the interval . Next, for one of the satisfied literals in , say , we represent both and on the axis by the interval . Finally, assuming that and are in order, we represent and on the axis by the intervals and respectively, for some positive but small . Similarly, we represent and by the intervals and respectively.
Now, suppose are the variables of in an arbitrary order. For each variable , if , we represent the vertices in and on the axis by the intervals and . Otherwise, if , we simply swap the intervals and proceed as before. Finally, we represent every vertex in on the axis by the interval .
Observe that each vertex in is represented by two (nonempty) intervals, one on the axis and one on the axis. Thus, for every , we can define to be the Cartesian product of its two corresponding intervals. To see this gives a valid RSVR for , we make three observations.

Every gadget in (resp., ) occupies a contiguous interval on the axis (resp., axis) that is disjoint from the intervals of other gadgets.

Every satisfiability gadget in for a clause