The Partial Visibility Representation Extension Problem
 627 Downloads
Abstract
For a graph G, a function \(\psi \) is called a bar visibility representation of G when for each vertex \(v \in V(G)\), \(\psi (v)\) is a horizontal line segment (bar) and \(uv \in E(G)\) if and only if there is an unobstructed, vertical, \(\varepsilon \)wide line of sight between \(\psi (u)\) and \(\psi (v)\). Graphs admitting such representations are well understood (via simple characterizations) and recognizable in linear time. For a directed graph G, a bar visibility representation of G, additionally, puts the bar \(\psi (u)\) strictly below the bar \(\psi (v)\) for each directed edge (u, v) of G. We study a generalization of the recognition problem where a function \(\psi '\) defined on a subset \(V'\) of V(G) is given and the question is whether there is a bar visibility representation \(\psi \) of G with \(\psi (v) = \psi '(v)\) for every \(v \in V'\). We show that for undirected graphs this problem, and other closely related problems, is \(\mathsf {NP}\)complete, but for certain cases involving directed graphs it is solvable in polynomial time.
Keywords
Partial representation extension Planar graphs Bar visibility SPQRtrees Stordering NPcompleteness1 Introduction
The concept of a visibility representation of a graph is a classic one in computational geometry and graph drawing and the first studies on this concept date back to the early days of these fields (see, e.g. [29, 47, 49] for a recent survey). In the most general setting, a visibility representation of a graph is defined as a collection of disjoint sets from an Euclidean space such that the vertices are bijectively mapped to the sets and the edges correspond to unobstructed lines of sight between two such sets. Many different classes of visibility representations have been studied via restricting the space (e.g., to be the plane), the sets (e.g., to be points [6] or line segments [7, 47]) and/or the lines of sight (e.g., to be noncrossing or axisparallel). In this work we focus on a classic visibility representation setting in which the sets are horizontal line segments (bars) in the plane and the lines of sight are vertical. As such, whenever we refer to a visibility representation, we mean one of this type. The study of such representations was inspired by the problems in VLSI design [45, 46] and was conducted by different authors [24, 40, 43] under variations of the notion of visibility. Tamassia and Tollis [47] gave an elegant unification of different definitions and we follow their approach.
A horizontal bar is an open, nondegenerate segment parallel to the xaxis of the coordinate plane. For a set \(\Gamma \) of pairwise disjoint horizontal bars, a visibility ray between two bars a and b in \(\Gamma \) is a vertical closed segment spanned between bars a and b that intersects a, b, and no other bar in \(\Gamma \). A visibility gap between two bars a and b in \(\Gamma \) is an axis aligned, nondegenerate open rectangle spanned between bars a and b that intersects no other bar.

Weak visibility In this model, for each edge \(\{u,v\}\) of G, there is a visibility ray between \(\psi (u)\) and \(\psi (v)\) in \(\psi (V(G))\).

Strong visibility In this model, two vertices u, v of G are adjacent if and only if there is a visibility ray between \(\psi (u)\) and \(\psi (v)\) in \(\psi (V(G))\).

Bar visibility In this model, two vertices u, v of G are adjacent if and only if there is a visibility gap between \(\psi (u)\) and \(\psi (v)\) in \(\psi (V(G))\).
A graph that admits a visibility representation in any of these models is a planar graph, but the converse does not hold in general. Tamassia and Tollis [47] characterized the graphs that admit a visibility representation in these models as follows. A graph admits a weak visibility representation if and only if it is planar. A graph admits a bar visibility representation if and only if it has a planar embedding with all cutvertices on the boundary of the outer face. For both of these models, Tamassia and Tollis [47] presented lineartime algorithms for the recognition of representable graphs, and for constructing the appropriate visibility representations. The situation is different for the strong visibility model. Although the planar graphs admitting a strong visibility representation are characterized in [47] (via strong stnumberings), Andreae [1] proved that the recognition of these graphs is \(\mathsf {NP}\)complete. Summing up, from a computational point of view, the problems of recognizing graphs that admit visibility representations and of constructing such representations are well understood.
Recently, a lot of attention has been paid to the question of extending partial representations of graphs. In this setting a representation of some vertices of the graph is already fixed and the task is to find a representation of the whole graph that extends the given partial representation (see, e.g. [5, 9, 35, 36, 37, 38] for papers that study computational aspects of extending partial representations of geometric intersection graphs). Problems of this kind are often encountered in graph drawing and are sometimes computationally harder than testing for existence of an unconstrained drawing. The problem of extending partial drawings of planar graphs is a good illustration of this phenomenon. On the one hand, by Fáry’s theorem [25], every planar graph can be drawn in the plane so that each vertex is represented as a point, and edges are pairwise noncrossing, straightline segments joining the corresponding points. Moreover, such a drawing can be constructed in linear time [11, 21, 22]. On the other hand, testing whether a partial drawing of this kind (i.e., an assignment of points to some of the vertices) can be extended to a straightline drawing of the whole graph is \(\mathsf {NP}\)hard [44]. However, an analogous problem in the model that allows the edges to be drawn as arbitrary curves instead of straightline segments has a lineartime solution [2]. A similar phenomenon occurs when we consider contact representations of planar graphs. Every planar graph is representable as a disk contact graph [39] or a triangle contact graph [20]. Every bipartite planar graph is representable as a contact graph of horizontal and vertical segments in the plane [19, 31]. Although such representations can be constructed in polynomial time [19, 20, 41], the problems of extending partial representations of these kinds are \(\mathsf {NP}\)hard [8].
In this paper we initiate the study of extending partial visibility representations of graphs. From a practical point of view, it may be worth recalling that visibility representations are not only an appealing way of drawing graphs, but they are also typically used as an intermediate step towards constructing visualizations of networks in which all edges are oriented in a common direction and some vertices are aligned (for example to highlight critical activities in a PERT diagram). Visibility representations are also used to construct orthogonal drawings with at most two bends per edge. See, e.g. [12] for more details about these applications of visibility representations. The partial representation extension problem that we study in this paper occurs, for example, when we want to use visibility representations to incrementally draw a large network and we want to preserve the user’s mental map in a visual exploration that adds a few vertices and edges per time.
Both for weak visibility and for strong visibility, the partial representation extension problems are easily found to be \(\mathsf {NP}\)hard. For weak visibility, the hardness follows easily from results on contact representations by Chaplick et al. [8]. For strong visibility, it follows trivially from results by Andreae [1]. Our contribution is the study of the partial representation extension problem for bar visibility representations. Hence, the central problem for this paper is the following:
Bar Visibility Representation Extension:
Input: \((G, \psi ')\), where G is a graph and \(\psi '\) is a mapping assigning bars to some subset \(V'\) of V(G).
Question: Does G admit a bar visibility representation \(\psi \) with \(\psi V' = \psi '\)?
In Sect. 5 we show that this problem is \(\mathsf {NP}\)complete.
Theorem 1
The Bar Visibility Representation Extension problem is \(\mathsf {NP}\)complete.
The proof is a standard reduction from PlanarMonotone3Sat problem, which is known to be \(\mathsf {NP}\)complete thanks to de Berg and Khosravi [18]. The reduction uses gadgets that simulate logic gates and constructs a planar Boolean circuit that encodes the given formula.
We investigate a few natural modifications of the problem. Most notably, we provide some efficient algorithms for extension problems for directed graphs. A visibility representation introduces a natural orientation to edges of the graph—each edge is oriented from the lower bar to the upper one. The function \(\psi \) is a representation of a digraph G if, additionally to satisfying visibility constraints, it puts the bar \(\psi (u)\) strictly below the bar \(\psi (v)\) for each directed edge (u, v) of G. Note that a planar digraph that admits a visibility representation also admits an upward planar drawing (see e.g., [27]), that is, a drawing in which the edges are represented as noncrossing monotonic upward curves.

G admits an upward planar drawing,

G is a subgraph of a planar stgraph,

G admits a weak visibility representation.
Lemma 2
Let st(G) be a graph constructed from a planar digraph G by adding two vertices s and t, the edge (s, t), an edge (s, v) for each source vertex v of G, and an edge (v, t) for each sink vertex v of G. A planar directed graph G admits a bar visibility representation if and only if the graph st(G) is a planar stgraph.
Since planar stgraphs can be recognized in linear time, planar digraphs that admit a bar visibility representation are also recognizable in linear time. The natural problem that arises is the following:
Bar Visibility Representation Extension for Digraphs:
Input: \((G, \psi ')\), where G is a directed graph and \(\psi '\) is a mapping assigning bars to some subset \(V'\) of V(G).
Question: Does G admit a bar visibility representation \(\psi \) with \(\psi V' = \psi '\)?
Tamassia and Tollis [47] showed that a planar digraph G admits a rectangular bar visibility representation if and only if G is a planar stgraph. In Sect. 4 we give an efficient algorithm for the following problem:
Rectangular Bar Visibility Representation Extension for planar stgraphs:
Input: \((G, \psi ')\), where G is a planar stgraph and \(\psi '\) is a mapping assigning bars to some subset \(V'\) of V(G).
Question: Does G admit a rectangular bar visibility representation \(\psi \) with \(\psi V' = \psi '\)?
The main result in this paper, presented in Sect. 4, is the following.
Theorem 3
The rectangular bar visibility representation extension problem for a planar stgraph with n vertices can be solved in \(O{\left( n\log ^2{n}\right) }\) time.
Our algorithm exploits the correspondence between bar visibility representations and storientations of planar graphs, and utilizes the SPQRdecomposition of planar graphs.
In the study of planar graphs and their representations, it is important to understand the area requirements of a drawing. A common way to measure this is by the smallest integer grid in which a drawing can be realized (see, e.g. [4, 32, 33, 34, 48] for papers that specifically study the area required by visibility representations of graphs and Di Battista and Frati [13] for a survey on compact drawings of graphs).
A visibility representation is a grid representation when all bars used in the representation have integral coordinates. Any visibility representation can be easily modified into a grid representation. However, this transformation does not preserve coordinates of the bars. In particular, it might not preserve the partial representation. We can show that the (Rectangular) Bar Visibility Representation Extension problem is \(\mathsf {NP}\)hard on seriesparallel planar stgraphs when one demands a grid representation.
Our results use different tools developed for graph representation problems. In particular, we exploit the correspondence between bar visibility representations and storientations of planar graphs, and utilize the SPQRdecomposition for planar graphs.
The rest of the paper is organized as follows. Section 2 contains the necessary definitions and description of the necessary tools. Section 3 contains a characterization of planar digraphs that admit a bar visibility representation. Section 4 contains the study of rectangular representations of planar stgraphs. Section 5 contains hardness results for grid representations and for the bar visibility representation extension problem for undirected graphs. Section 6 contains conclusions and some open problems.
2 Preliminaries
2.1 Notation
A horizontal bar is an open, nondegenerate segment parallel to the xaxis of the coordinate plane. For a horizontal bar a, functions y(a), l(a), r(a) give the ycoordinate of a, the xcoordinate of the left end of a, and the xcoordinate of the right end of a respectively. For any bounded object Q in the plane, we use functions X(Q) and Y(Q) to denote the smallest possible, possibly degenerate, closed interval containing the projection of Q on the x, and on the yaxis respectively. We denote the left end of X(Q) by l(Q) and the right end of X(Q) by r(Q). Let a and b be two horizontal bars with \(y(a) < y(b)\). We say that Q is spanned between a and b if \(X(Q) \subseteq X(a) \cap X(b)\), and \(Y(Q) = [y(a),y(b)]\).
For a graph G, a visibility representation \(\psi \) in any model (see Sect. 1) is a function that assigns distinct, pairwise disjoint horizontal bars to the vertices of G. We often describe the representation \(\psi \) by providing the values of functions \(y_\psi = y(\psi (v))\), \(l_\psi = l(\psi (v))\), \(r_\psi = r(\psi (v))\) for any vertex v of G. We drop the subscripts when the representation \(\psi \) is known from the context.
2.2 Planar stGraphs and Their Properties
Given a graph \(G=(V,E)\), a planar drawing of G is a geometric representation of G in the plane such that: (i) each vertex \(v \in V\) is drawn as a distinct point \(p_v\); (ii) each edge \(e=(u,v) \in E\) is drawn as a simple curve connecting \(p_u\) and \(p_v\); (iii) no two edges intersect except at their common endvertices (if they are adjacent). A graph is planar if it admits a planar drawing.
Let G be a connected planar graph. A planar drawing \(\Theta \) of G divides the plane into topologically connected regions, called faces. Exactly one face of \(\Theta \) is an infinite region, and is called the external face of \(\Theta \); the other faces are called internal. Each internal face is described by the counterclockwise sequence of vertices and edges that form its boundary; the external face is described by the clockwise sequence of vertices and edges of its boundary. The description of the set of (internal and external) faces determined by a planar drawing of G is called a planar embedding of G.
Let G be a planar stgraph. An stembedding of G is any planar embedding with s and t on the boundary of the outer face. A planar stgraph together with an stembedding is called a plane stgraph. Vertices s and t of a planar (plane) stgraph are called the poles of G. We abuse notation and we use the term planar (plane) uvgraph to mean a planar (plane) stgraph with poles u and v. An inner vertex of G is a vertex of G other than the poles of G. A real valued function \(\xi \) from V(G) is an stvaluation of G if for each edge (u, v) we have \(\xi (u) < \xi (v)\).
 (1)
For every inner face f, the boundary of f consists of two directed paths with a common origin and a common destination.
 (2)
The boundary of the outer face consists of two directed paths, with a common origin s and a common destination t.
 (3)
For every inner vertex v, its incoming (outgoing) edges are consecutive around v.
Let G be a plane stgraph. We introduce two special objects associated with the outer face of G: the left outer face \(s^*\) and the right outer face \(t^*\). Let \(e = (u,v)\) be an edge of G. The left face (right face) of e is the face of G that is to the left (right) of e when we traverse e from u to v. If the outer face of G is to the left (right) of e then we say that the left face (right face) of e is \(s^*\) (\(t^*\)).
Using property (1) we can define the left path and the right path for each inner face of G as follows. If f is an inner face of G then the left path (right path) of f consists of edges from the boundary of f for which f is the right face (left face). For example, in Fig. 2, the path (s, 1, 5) is the left path of the face (s, 2, 3, 5, 1) and the path (s, 2, 3, 5) is the right path of this face.
Using property (2) we can define the left path for \(t^*\) and the right path for \(s^*\) as follows. The right path of \(s^*\) consists of edges from the boundary of the outer face that have the outer face on their left side. The left path of \(t^*\) consists of edges from the boundary of the outer face that have the outer face on their right side. The left path for \(s^*\) and the right path for \(t^*\) are not defined. For example, in Fig. 2, the path (s, 1, 5, t) is the right path of \(s^*\) and the path (s, 12, 13, t) is the left path of \(t^*\).
Using property (3) we can define the left face and the right face for each vertex of G as follows. The left face (right face) of an inner vertex v is the unique face f incident to v such that there are two edges \(e_1\) and \(e_2\) on the right path (left path) of f, where \(e_1\) is an incoming edge for v and \(e_2\) is an outgoing edge for v. If the left face (right face) of v is the outer face of G, we say that the left face (right face) of u is \(s^*\) (\(t^*\)). We also say that \(s^*\) (\(t^*\)) is the left face (right face) of s and t. For example, in Fig. 2, the left face of vertex 5 is \(s^*\) and the right face of this vertex is the face (s, 7, 8, 10, 14, 6, 5).
Let G be a plane stgraph. Let F be the set of inner faces of G together with \(s^*\) and \(t^*\). The dual of G is the directed graph \(G^*\) with vertex set F and edge set consisting of all pairs (f, g) such that there exists an edge e of G with f being the left face of e and g being the right face of e. Di Battista and Tamassia [14] showed that \(G^*\) is a planar \(s^*t^*\)graph.
Let G be a plane stgraph and let \(G^*\) be the dual of G. For two faces f and g in \(V(G^*)\) we say that f is to the left of g, and that g is to the right of f, if there is a directed path from f to g in \(G^*\).
2.3 SPQRTrees for Planar stGraphs
An SPQRtree for a planar graph G is usually used to describe all possible planar embeddings of G. In this paper we employ a specific version of SPQRtrees that allows us to describe all stembeddings of a planar stgraph. Di Battista and Tamassia [15] were the first to define such SPQRtrees, and to prove the properties presented in this section.
Let G be a planar stgraph. A cutvertex of G is a vertex whose removal disconnects G. A separation pair of G is a pair of vertices whose removal disconnects G. A split pair of G is either a separation pair or a pair of adjacent vertices. A split component of a split pair \(\{u,v\} \) is either an edge (u, v) or a maximal subgraph C of G such that C is a planar uvgraph and \(\{u,v\}\) is not a split pair of C. A maximal split pair \(\{u,v\}\) of G is a split pair such that there is no other split pair \(\{u',v'\}\) where \(\{u,v\}\) is contained in some split component of \(\{u',v'\}\).

Trivial case If G consists of a single edge (s, t), then T is simply a Qnode \(\mu \). The skeleton \(skel(\mu )\) is G.

Series case If G is a chain of biconnected components \(G_1, \dots , G_k\) for some \(k \geqslant 2\) and \(c_1, \dots , c_{k1}\) are the cutvertices encountered in this order on any path from s to t, then the root of T is an Snode \(\mu \) with children \(\mu _1, \dots , \mu _k\). Let \(c_0 = s\) and \(c_k = t\). The skeleton \(skel(\mu )\) is the directed path \(c_0,\ldots ,c_k\). The pertinent digraph of \(\mu _i\) is \(G_i\), and edge \((c_{i1},c_i)\) of \(skel(\mu )\) is the virtual edge of \(\mu _i\).

Parallel case If \(\{s,t\}\) is a split pair of G with split components \(G_1, \dots , G_k\) for some \(k \geqslant 2\), then the root of T is a Pnode \(\mu \) with children \(\mu _1,\ldots , \mu _k\). The skeleton \(skel(\mu )\) has k parallel edges (s, t): \(e_1,\ldots ,e_k\). The pertinent digraph of \(\mu _i\) is \(G_i\), and edge \(e_i\) of \(skel(\mu )\) is the virtual edge of \(\mu _i\).

Rigid case If none of the above applies, let \(\{s_1,t_1\}, \dots , \{s_k,t_k\}\) for some \(k \geqslant 2\) be the maximal split pairs of G. For \(i=1, \ldots , k\), let \(G_i\) be the union of all split components of \(\{s_i,t_i\}\). The root of T is an Rnode \(\mu \) with children \(\mu _1, \ldots , \mu _k\). The skeleton \(skel(\mu )\) is obtained from G by replacing each subgraph \(G_i\) with an edge \(e_i=(s_i,t_i)\). The pertinent digraph of \(\mu _i\) is \(G_i\), and edge \(e_i\) of \(skel(\mu )\) is the virtual edge of \(\mu _i\).
Note also that there is no additional edge between the poles of the skeleton of a series, parallel or rigid node—this is the only difference in the SPQRtree definition given above and the one given in [15]. In particular, our definition ensures that we have a onetoone correspondence between the edges of \(skel(\mu )\) and the children of \(\mu \). See Fig. 3 for an example of an SPQRdecomposition of the planar stgraph presented in Fig. 2.
Observe that the skeleton of a rigid node has only two stembeddings, one being the flip of the other around the poles of the node. The skeleton of a parallel node with k children has k! stembeddings, one for every permutation of the edges of \(skel(\mu )\). The skeleton of a series node or a edge node has only one stembedding.

one of the two possible flips of the skeleton of every Rnode in T;

a permutation of the edges in the skeleton of every Pnode.
2.4 \(\mathsf {NP}\)Complete Problems
Our hardness proofs use reductions from the following \(\mathsf {NP}\)complete problems:
3Partition:
Input: A set of positive integers \(w, a_1, a_2, \ldots , a_{3m}\) such that for each \(i=1,\ldots ,3m\), we have \(\frac{w}{4} {<} a_i {<} \frac{w}{2}\).
Question: Can \(\{a_1, \ldots , a_{3m}\}\) be partitioned into m triples, such that the total sum of each triple is exactly w?
3Partition is known to be strongly \(\mathsf {NP}\)complete [26], i.e., the problem remains \(\mathsf {NP}\)complete even when the integers given in the input are encoded in unary.
PlanarMonotone3Sat:
Input: A rectilinear planar representation of a \(\textsc {3Sat}\) formula in which each variable is a horizontal segment on the xaxis, each clause is a horizontal segment above or below the xaxis with straightline vertical connections to the variables it includes. All positive clauses are above the xaxis and all negative clauses are below the xaxis. There are no clauses including both positive and negative occurrences of variables, all horizontal segments are pairwise disjoint, and each vertical connection intersects only with the two segments that it connects. See Fig. 4 for an example.
Question: Is the formula satisfiable?
3 Bar Visibility and Rectangular Bar Visibility Representations for Planar Digraphs
A bar visibility representation \(\psi \) of a planar stgraph is rectangular when \({X}(\psi (s)) = X(\psi (t))\) and for any vertex v we have \(X(\psi (v)) \subseteq X(\psi (s))\). Tamassia and Tollis [47] observed the following connection between planar stgraphs and rectangular bar visibility representations. Any collection of pairwise disjoint bars \(\Gamma \) with the bottommost bar s and the topmost bar t that satisfies \(X(s) = X(t)\), and \(X(a) \subseteq X(s)\) for every \(a \in \Gamma \), naturally induces a planar stgraph on the set \(\Gamma \)—a digraph containing all edges (a, b) such that a is strictly below b and there is a visibility gap between a and b in \(\Gamma \). They further showed that every planar stgraph has a rectangular bar visibility representation.
The next lemma characterizes the planar digraphs that admit a bar visibility representation. For a planar digraph G, let st(G) be a graph constructed from G by adding two vertices s and t, the edge (s, t), an edge (s, v) for each source vertex v of G, and an edge (v, t) for each sink vertex v of G.
Lemma 2
A planar directed graph G admits a bar visibility representation if and only if the graph st(G) is a planar stgraph.
Proof
Suppose that st(G) is a planar stgraph. Tamassia and Tollis [47] showed that st(G) has a rectangular bar visibility representation \(\psi \) with the bottommost bar \(\psi (s)\) and the topmost bar \(\psi (t)\). Clearly, \(\psi V(G)\) is a bar visibility representation for G.
Conversely, assume that \(\psi \) is a bar visibility representation of G and \(\Gamma \) is the image of \(\psi \). For every bar \(a \in \Gamma \), let A(a) (B(a)) be the interior of the set of all x such that \(\psi (a)\) is the first encountered bar from \(\Gamma \) if we traverse downward (upward) the vertical line with the xcoordinate x. We say that a bar \(a \in \Gamma \) is visible from above (below) if \(A(a) \ne \emptyset \) (\(B(a) \ne \emptyset \)). Note that each A(a) and B(a) is a union of disjoint open intervals. Observe also that if a represents a sink (a source) of G then \(A(a) = (l(a),r(a))\) (\(B(a) = (l(a),r(a))\)). Otherwise, \(\psi \) would not be a bar visibility representation of G.
We claim that some bars in \(\Gamma \) can be extended so that the new set of bars still represents G and has the property that only the bars representing the sources are visible from below and only the bars representing the sinks are visible from above. Before we give a proof of this claim, suppose that \(\psi \) satisfies this property. We can define two bars \(\psi (s)\) and \(\psi (t)\) such that \(X(s)=X(t)\), \(X(\bigcup \Gamma ) \subsetneq X(s)\), and \(y_{\psi }(s)< y_{\psi }(v) < y_{\psi }(t)\) for every vertex v of G. This extension of \(\psi \) is a rectangular bar representation of st(G). It follows that st(G) is a planar stgraph.
Now we show that \(\psi \) can be modified so that the bars visible from below (above) represent the sources (sinks) of G. Let \(\mathcal {X}\) denote the set of the xcoordinates of all endpoints of all bars in \(\Gamma \). Let \(\varepsilon \) and \(\delta \) be respectively the minimum and the maximum difference between any two values in \(\mathcal {X}\). Suppose that there is a bar \(\psi (v)\) in \(\Gamma \) that is visible from below and v is not a source of G. Suppose (L, R) is an interval of \(B(\psi (v))\) and observe that both L and R are in \(\mathcal {X}\). Since v is not a source of G and \(\psi \) is a visibility representation of G, there is a vertex u in G such that (u, v) is an edge of G, and either \(r_\psi (u) = L\) or \(l_\psi (u) = R\). If \(r_\psi (u) = L\), we extend \(\psi (u)\) to the right so that \(r_\psi (u) = R\), and if \(l_\psi (u)=R\), we extend \(\psi (u)\) to the left so that \(l_\psi (u) = L\). Observe that such a modification only introduces additional visibility gaps between \(\psi (u)\) and \(\psi (v)\), and does not change any visibility gap between any other two bars. Thus, the modified \(\psi \) remains a representation of G. Moreover, all endpoints of all bars are still in \(\mathcal {X}\) and the total length of all bars increases by at least \(\varepsilon \). We repeat the same procedure as long as there is a vertex v that is not a source of G and \(\psi (v)\) is visible from below. The number of repetitions is bounded, as the length of any single bar never exceeds \(\delta \). In the resulting representation, each bar visible from below represents a source of G. Next, we transform \(\psi \) again, using a similar algorithm, so that each bar visible from above represents a sink of G. It is easy to see, that in the second step we do not introduce any new bars that are visible from below. Thus, in the resulting representation, all the bars visible from below are sources of G and all the bars visible from above are sinks of G. \(\square \)
Lemma 2 gives a lineartime algorithm for the recognition of planar digraphs that admit a bar visibility representation. Recall from the discussion in Sect. 1 that the recognition of planar digraphs that admit a weak visibility representation is an \(\mathsf {NP}\)complete problem. It follows that the extension problem for digraphs in the weak visibility model is \(\mathsf {NP}\)complete. We do not know the complexity status for the extension problem for digraphs neither in the strong nor in the bar visibility model. Nevertheless, the results in Sect. 4 give hope for a polynomialtime algorithm for the extension problem for bar visibility representations of digraphs.
4 Rectangular Bar Visibility Representations of Planar stGraphs
In this section we solve the following problem.
Rectangular Bar Visibility Representation Extension for planar stgraphs:
Input: \((G, \psi ')\), where G is a planar stgraph and \(\psi '\) is a mapping assigning bars to some subset \(V'\) of V(G).
Question: Does G admit a rectangular bar visibility representation \(\psi \) with \(\psi V' = \psi '\)?
As our algorithm is rather technical (involving many small details), we now provide a high level description of the main ideas. In the first step, our algorithm calculates ycoordinates \(y_\psi \) for our potential bars. Namely, the algorithm checks whether \(y_{\psi '}:V' \rightarrow \mathbb {R}\) is extendable to an stvaluation \(y_\psi \) of G. When such an extension does not exist, the algorithm rejects; otherwise it turns out (as shown in Lemma 10) that any extension of \(y_{\psi '}\) can be used as \(y_\psi \). To determine whether there is a set of xcoordinates to match this set of ycoordinates, we use a dynamic programming approach which proceeds bottomup through the SPQRtree T of the given planar stgraph G. Recall that, as discussed in Sect. 2.3, T provides a hierarchical decomposition of G according to separation pairs, i.e., each node \(\mu \) of T corresponds to a separation pair (u, v) in G. Additionally, for a separation pair (u, v) corresponding to a node \(\mu \) in T, the subgraph ‘between’ u and v is a planar stgraph, and is precisely the pertinent digraph of \(\mu \). We will see that there is a similar connection between the SPQRtree and each rectangular bar visibility representation \(\psi \) of G. Namely, we describe how \(\psi \) ‘decomposes’ into subrepresentations according to these separation pairs, i.e., for each node \(\mu \) and its corresponding separation pair (u, v), there is a particular rectangular bar visibility representation \(\psi _\mu \) of the pertinent digraph \(G_\mu \) of \(\mu \) in \(\psi \). Moreover, we will see that each \(\psi _\mu \) partitions into rectangular ‘tiles’ where each ‘tile’ is a representation of one of its children. We say that a ‘tile’ of a representation \(\psi _\mu \) of \(G_\mu \) is valid when it extends \(\psi 'V(G_\mu )\). Now, essentially, the key to our dynamic program is to efficiently describe the set of possible valid ‘tiles’ of the representations of \(G_\mu \) in terms of the valid ‘tiles’ of \(\mu \)’s children. It turns out that it is sufficient to consider four types of ‘tiles’ for each node of T in order to accomplish this. To efficiently determine the types of ‘tiles’ admitted by a node \(\mu \), we distinguish different cases depending on whether \(\mu \) is a Pnode, an Snode, a Qnode, or an Rnode. As usual, for dynamic programming involving \(\textit{SQPR}\)trees, the Rnode case is the most complex. So, we describe it first in using a quadratictime subroutine which is more intuitive. We then describe a speedup of this subroutine which runs in nearly linear time (this subroutine remains as the main bottleneck for our running time).
Section 4.1 presents structural properties of bar visibility representations in relation to an SPQRdecomposition. We describe how a rectangular bar visibility representation of the pertinent digraph of a node \(\mu \) in the SPQRdecomposition is composed of rectangular bar visibility representations of the pertinent digraphs of the children of \(\mu \). In Sect. 4.2 we present an algorithm that solves this extension problem in quadratic time. In Sect. 4.3 we refine the algorithm to work in \(O{\left( n\log ^2n\right) }\) time for a planar stgraph with n vertices.
4.1 Structural Properties
 (1)
a is the first bar in \(\Gamma \) on a vertical line downwards from (x, y),
 (2)
b is the first bar in \(\Gamma \) on a vertical line upwards from (x, y).
 (1)
\(B(\psi ) = B_\psi (\mu )\), where \(\mu \) is the root of T,
 (2)
each point in \(B(\psi )\) is in the closure of at least one set of visibility rectangles \(R(\psi (u),\psi (v))\) for some edge (u, v) of G,
 (3)
each point in \(B(\psi )\) is in at most one set of visibility rectangles.
Lemma 4
 (1)
\(B(\mu )\) is a union of pairwise disjoint rectangles spanned between \(\psi (u)\) and \(\psi (v)\).
 (2)
If \(B(\mu )\) is not a single rectangle, then the parent \(\lambda \) of \(\mu \) in T is a Pnode, and u, v are the poles of the pertinent digraph \(G_{\lambda }\).
Proof
The first assertion is obvious. Suppose that \(B(\mu )\) is a union of at least 2 rectangles. Let \(R_1\) and \(R_2\) be the two leftmost rectangles of \(B(\mu )\). Consider the rectangle S spanned between \(\psi (u)\) and \(\psi (v)\) and between the right side of \(R_1\) and left side of \(R_2\). There are some bars in \(\psi (G)\) that are contained in S. The vertices corresponding to these bars together with u and v form a planar uvgraph. Hence, the split pair \(\{u,v\}\) has at least two split components: the edge (u, v) and at least one other component. Thus, \(\lambda \) is a Pnode with poles u and v.
In Fig. 5 observe that the set R(s, 5) is a union of two rectangles. Recall the SPQRdecomposition presented in Fig. 3 and that the Qnode corresponding to the edge (s, 5) is a child of a Pnode.
The Basic Tiling Lemma presented below describes the relation between the bounding box of an inner node \(\mu \) and the bounding boxes of the children of \(\mu \) in any rectangular bar visibility representation of G. In particular, the next lemma justifies the use of the name bounding box for the set \(B(\mu )\).
Lemma 5
 (1)
\(\psi (v) \subseteq B(\mu )\) for every inner vertex v of \(G_\mu \).
 (2)
\(B(\mu )\) is a rectangle that is spanned between \(\psi (s_\mu )\) and \(\psi (t_\mu )\).
 (3)
The sets \(B(\mu _1), \ldots , B(\mu _k)\) tile the rectangle \(B(\mu )\), i.e., \(B(\mu _1), \ldots , B(\mu _k)\) cover \(B(\mu )\) and the interiors of \(B(\mu _1), \ldots , B(\mu _k)\) are pairwise disjoint.
Proof
Observe that for an inner vertex v of \(G_\mu \), any edge of G incident to v is an edge of \(G_\mu \). The closures of the sets of visibility rectangles corresponding to all edges incident to v cover \(\psi (v)\) and property (1) follows.
Property (3) follows immediately from the fact that the edges of \(G_{\mu _1}, \ldots , G_{\mu _k}\) form a partition of the edges of \(G_\mu \). \(\square \)
Lemma 6
 (1)
If \((s_\mu , t_\mu )\) is not an edge of G, then the sets \(B(\mu _1),\ldots ,B(\mu _k)\) are rectangles spanned between \(\psi (s_\mu )\) and \(\psi (t_\mu )\).
 (2)If \((s_\mu , t_\mu )\) is an edge of G, then \(\mu \) has exactly one child that is a Qnode, say \(\mu _1\), and:

For \(i=2,\ldots ,k\), \(B(\mu _i)\) is a rectangle spanned between \(\psi (s_\mu )\) and \(\psi (t_\mu )\).

\(B(\mu _1)\) is a nonempty union of rectangles spanned between \(\psi (s_\mu )\) and \(\psi (t_\mu )\).

Proof
This is an immediate consequence of the Basic Tiling Lemma and Lemma 4. \(\square \)
When \(\mu \) is an Snode or an Rnode, then there is no edge \((s_\mu ,t_\mu )\). By the QTiling Lemma and by the Basic Tiling Lemma, each set \(B(\mu _i)\) is a rectangle that is spanned between the bars representing the poles of \(G_{\mu _i}\).
Lemma 7
(STiling Lemma) Let \(\mu \) be an Snode. Let \(c_1,\ldots ,c_{k1}\) be the cutvertices of \(G_\mu \) encountered in this order on a path from \(s_\mu \) to \(t_\mu \). Let \(c_0 = s_\mu \), and \(c_k = t_\mu \). For any rectangular bar visibility representation \(\psi \) of G, for every \(i=1,\ldots ,k1\), we have \(X(\psi (c_i)) = X(B(\mu ))\). For every \(i=1,\ldots ,k\), \(B(\mu _i)\) is spanned between \(\psi (c_{i1})\) and \(\psi (c_i)\) and \(X(B(\mu _i)) = X(B(\mu ))\).
Proof
Suppose to the contrary, that the bar assigned to cutvertex \(c_i\) is the first one that does not span the whole interval \(X(B(\mu ))\). This creates a gap of visibility between a vertex in the ith biconnected component and a vertex in one of the later components. This contradicts \(c_i\) being a cutvertex.
The RTiling Lemma should describe all possible tilings of the bounding box of an Rnode \(\mu \) that appear in all representations of G. Since there is a onetoone correspondence between the edges of \(skel(\mu )\) and the children of \(\mu \), we abuse notation and write B(u, v) to denote the bounding box of the child of \(\mu \) that corresponds to the edge (u, v) of \(skel(\mu )\). By the Basic Tilling Lemma, B(u, v) is spanned between the bars representing u and v.

\(\mathcal {E}\) is an \(s_{\mu }t_{\mu }\)embedding of \(skel(\mu )\),

\(\xi \) is an stvaluation of \(\mathcal {E}\),

\(\chi \) is an stvaluation of \(\mathcal {E}^*\),
Consider the following planar drawing of the planar stgraph \(skel(\mu )\). Draw every vertex u in the middle of \(\psi (u)\), and every edge \(e=(u,v)\) as a curve that starts in the middle of \(\psi (u)\), goes a little above \(\psi (u)\) towards the rectangle \(B_\psi (u,v)\), goes inside \(B_\psi (u,v)\) towards \(\psi (v)\), and a little below \(\psi (v)\) to the middle of \(\psi (v)\). This way we obtain a plane stgraph \(\mathcal {E}\), which is an stembedding of \(skel(\mu )\). The stvaluation \(\xi \) of \(\mathcal {E}\) is just the restriction of \(y_\psi \) to the vertices from \(skel(\mu )\), i.e., \(\xi = y_{\psi }V(skel(\mu ))\). To define the stvaluation \(\chi \) of \(\mathcal {E}^*\) we use the following lemma.
Lemma 8
 (1)
Let f be a face in \(V(\mathcal {E}^*)\) different than \(t^*\), and \(v_0,v_1,\ldots ,v_n\) be the right path of f. There is a vertical line \(L_r(f)\) that contains the left endpoints of \(\psi (v_1), \ldots , \psi (v_{n1})\) and the left sides of \(B_\psi (v_0,v_1), \ldots , B_\psi (v_{n1},v_n)\).
 (2)
Let f be a face in \(V(\mathcal {E}^*)\) different than \(s^*\), and \(u_0,u_1,\ldots ,u_m\) be the left path of f. There is a vertical line \(L_l(f)\) that contains the right endpoints of \(\psi (u_1), \ldots , \psi (u_{m1})\) and the right sides of \(B_\psi (u_0,u_1), \ldots , B_\psi (u_{m1},u_m)\).
 (3)
If f is an inner face of \(\mathcal {E}\) then \(L_l(f)=L_r(f)\).
Proof
The proof of (2) is analogous. Property (3) is an immediate consequence of the Basic Tiling Lemma. \(\square \)
The above lemma allows us to introduce the notion of a splitting line for every face f in \(V(\mathcal {E}^*)\); namely, the splitting line of f is: the line \(L_l(f)=L_r(f)\) if f is an inner face of \(\mathcal {E}\), \(L_r(f)\) if f is the left outer face of \(\mathcal {E}\), and \(L_l(f)\) if f is the right outer face of \(\mathcal {E}\). Now, let \(\chi (f)\) be the xcoordinate of the splitting line for a face f in \(V(\mathcal {E}^*)\). To show that \(\chi (f)\) is an stvaluation of \(\mathcal {E}^*\), note that for any edge (f, g) of \(\mathcal {E}^*\) there is an edge (u, v) of \(\mathcal {E}\) that has f on the left side and g on the right side. It follows that \(\chi (f) = l(B_\psi (u,v)) < r(B_\psi (u,v)) = \chi (g)\), proving the claim. See Fig. 6 for an illustration.
The representation \(\psi \) of G determines the triple \((\mathcal {E}, \xi , \chi )\). Note that any other representation with the same tiling \(\tau = (B_{\psi }(\mu _1), \ldots ,B_\psi (\mu _k))\) of \(B(\mu )\) gives the same triple. To emphasize that the triple \((\mathcal {E}, \xi , \chi )\) is determined by tiling \(\tau \), we write \((\mathcal {E}_\tau , \xi _\tau , \chi _\tau )\).
Secondly, there is a representation \(\psi \) of G that agrees with \(\tau \) on \(skel(\mu )\), i.e., such that \(\tau = (B_\psi (\mu _1), \ldots , B_\psi (\mu _k))\). To construct such a representation, we take any representation \(\psi \) of G, translate and scale all bars in \(\psi \) to get \(B_\psi (\mu ) = B_\phi (\mu )\), and represent the pertinent digraphs \(G_{\mu _1}, \ldots , G_{\mu _k}\) so that the bounding box of \(\mu _i\) coincides with \(B_\phi (\mu _i)\) for \(i=1,\ldots ,k\).
The considerations given above lead us to the following lemma.
Lemma 9
4.2 Algorithm for Rectangular Bar Visibility Extension of Planar stGraphs
Let G be a planar stgraph with n vertices and \(\psi '\) be a partial representation of G with the set of fixed vertices \(V'\). We present a quadratictime algorithm that tests if there exists a rectangular bar visibility representation \(\psi \) of G that extends \(\psi '\). If such a representation exists, then the algorithm can construct it in the same time.
In the first step, our algorithm calculates \(y_\psi \). Namely, the algorithm checks whether \(y_{\psi '}:V' \rightarrow \mathbb {R}\) is extendable to an stvaluation of G. When such an extension does not exist, the algorithm rejects the instance \((G, \psi ')\); otherwise any extension of \(y_{\psi '}\) can be used as \(y_\psi \). The correctness of this step is verified by the following lemma.
Lemma 10
 (1)
The function \(y_{\psi }\) is an stvaluation of G that extends \(y_{\psi '}\),
 (2)If y is an stvaluation of G that extends \(y_{\psi '}\), then the function \(\phi \) that sends every vertex v of G into a bar so thatis also a rectangular bar visibility representation of G that extends \(\psi '\).$$\begin{aligned} y_\phi (v) = y(v),\quad l_\phi (v) = l_{\psi }(v),\quad r_\phi (v) = r_{\psi }(v) \end{aligned}$$
Proof
The function \(y_{\psi }\) extends \(y_{\psi '}\), because \(\psi \) extends \(\psi '\). It is an stvaluation of G because for an edge (u, v) of G, the bar of u is below the bar of v.
For the proof of (2), observe that for each vertex u of G we have \(X(\phi (u))=X(\psi (u))\). We claim that for any two vertices u, v of G such that the interior of \(X(\psi (u)) \cap X(\psi (v))\) is nonempty we have that \(y_\psi (u) < y_\psi (v)\) if and only if \(y(u) < y(v)\). For the proof of this claim, let u and v be vertices of G such that the interior of \(X(\psi (u)) \cap X(\psi (v))\) is nonempty. From the fact that \(\psi (V(G))\) is a collection of pairwise disjoint bars, it follows that \(y_\psi (u) \ne y_{\psi }(v)\). Without loss of generality assume that \(y_\psi (u) < y_{\psi }(v)\). The nonempty interior of \(X(\psi (u)) \cap X(\psi (v))\) means that there is a path from u to v in G. Hence \(y(u) < y(v)\) as y is an stvaluation of G.
As a consequence we have that \((x_1,x_2) \times (y_\psi (u),y_\psi (v))\) is a visibility gap between bars \(\psi (u)\) and \(\psi (v)\) in representation \(\psi \) if and only if \((x_1,x_2) \times (y(u),y(v))\) is a visibility gap between \(\phi (u)\) and \(\phi (v)\) and \(\phi \) is a rectangular bar visibility representation of G. \(\square \)
Clearly, checking whether \(y_{\psi '}\) is extendable to an stvaluation of G, and constructing such an extension can be done in \(O{\left( n\right) }\)time. In the second step, the algorithm computes the SPQRtree T for G, which also takes linear time.
Assume that \(\mu \) is a node whose core is nonempty. We describe the ‘possible shapes’ the bounding box of \(\mu \) might have in a representation of G that extends \(\psi '\). The bounding box of \(\mu \) is a rectangle that is spanned between the bars corresponding to the poles of \(G_\mu \). By the Basic Tiling Lemma, if \(C(\mu )\) is nonempty then \(B(\mu )\) contains \(C(\mu )\). For our algorithm it is important to distinguish whether the left (right) side of \(B(\mu )\) contains the left (right) side of \(C(\mu )\). This criterion leads to four types of representations of \(\mu \) with respect to the core of \(\mu \).
The main idea of the algorithm is to decide for each inner node \(\mu \) whose core is nonempty, which of the four types of representation of \(\mu \) are possible and which are not. The algorithm traverses the tree bottomup and for each node and each type of representation it tries to construct the appropriate tiling using the information about possible representations of its children. The types chosen for different children need to fit together to obtain a tiling of the parent node. In what follows, we present our approach in more detail.
Let \(\mu \) be an inner node in T. Fix \(\phi ' = \psi 'V'(\mu )\). It is convenient to think of \(\phi '\) as a partial representation of the pertinent digraph \(G_\mu \) obtained by restricting \(\psi '\) to the inner vertices of \(G_\mu \). In particular, \(\phi '\) is empty if the core of \(\mu \) is empty. Let \(x,x'\) be two real values. A rectangular bar visibility representation \(\phi \) of \(G_\mu \) is called an \([x,x']\)representation of \(\mu \) if \(\phi \) extends \(\phi '\) and \(X(\phi (s_\mu )) = X(\phi (t_\mu )) = [x,x']\).
A node \(\mu \) whose core is empty has an \([x,x']\)representation for any \(x < x'\). In particular, a Qnode has an \([x,x']\)representation for any \(x < x'\).

leftloose, rightloose (LLrepresentation), when \(x < l(C(\mu ))\) and \(x' > r(C(\mu ))\),

leftloose, rightfixed (LFrepresentation), when \(x < l(C(\mu ))\) and \(x' = r(C(\mu ))\),

leftfixed, rightloose (FLrepresentation), when \(x = l(C(\mu ))\) and \(x' > r(C(\mu ))\),

leftfixed, rightfixed (FFrepresentation), when \(x = l(C(\mu ))\) and \(x' = r(C(\mu ))\).
Lemma 11

If \(\mu \) has an LLrepresentation, then \(\mu \) has an \([x,x']\)representation for any \(x < l(C(\mu ))\) and any \(x' > r(C(\mu ))\).

If \(\mu \) has an LFrepresentation, then \(\mu \) has an \([x,x']\)representation for any \(x < l(C(\mu ))\) and \(x' = r(C(\mu ))\).

If \(\mu \) has an FLrepresentation, then \(\mu \) has an \([x,x']\)representation for \(x = l(C(\mu ))\) and any \(x' > r(C(\mu ))\).
Proof
Let \(x_l = l(C(\mu ))\). Suppose that \(\phi \) is some leftloose \([x_1,x']\)representation of \(\mu \) with \(x_1 < x_l\). For any \(x_2 < x_l\) we can obtain an \([x_2,x']\)representation of \(\mu \) by appropriately stretching the part of the drawing of \(\phi \) that is to the left of \(x_l\). If the representation is rightloose, then we can arbitrarily stretch the part of the drawing that is to the right of \(r(C(\mu ))\). \(\square \)

\(\mu \) is an inner node whose core is nonempty.

\(\mu _1,\ldots ,\mu _k\) are the children of \(\mu \), \(k \geqslant 2\).

\(\lambda _1,\ldots ,\lambda _{k'}\) are the children of \(\mu \) with \(C(\lambda _i) \ne \emptyset \), \(0 \leqslant k' \leqslant k\).

\(\theta (\lambda _i)\) is the set of feasible types of representations for \(\lambda _i\), \(\theta (\lambda _i) \subseteq \{LL,LF,FL,FF\}\).
Let x and \(x'\) be two real numbers such that \(x \leqslant l(C(\mu ))\) and \(x' \geqslant r(C(\mu ))\). We provide an algorithm that tests whether an \([x,x']\)representation of \(\mu \) exists. We use it to find feasible types for \(\mu \) by calling it four times with appropriate values of x and \(x'\). While searching for an \([x,x']\)representation of \(\mu \) our algorithm tries to tile the rectangle \([x,x'] \times [y(s_\mu ),y(t_\mu )]\) with \(B(\mu _1), \ldots , B(\mu _k)\). The tiling procedure is determined by the Tiling Lemma specific for the type of \(\mu \). Note that as the core of a Qnode is empty, the algorithm splits into three cases: \(\mu \) is an Snode, a Pnode, and an Rnode.
Claim 12
There exists an \([x,x']\)representation of an Snode \(\mu \) if and only if Algorithm 1 returns true.
Proof
Claim follows directly from the Tiling Lemma for Series Nodes and the Stretching Lemma.
In line 1 the children whose cores are nonempty are sorted by the left end of the core. In lines 2 to 5 the variables \(l_i\), \(r_i\), and an empty set closed are initialized.
If there are \(\lambda _i,\lambda _j\) such that the interior of the set \(X(C(\lambda _i)) \cap X(C(\lambda _j))\) is nonempty, then we prove that there is no \([x,x']\)representation of \(G_\mu \). Indeed, by the Tiling Lemma for Parallel Nodes and by \(C(\lambda _i) \subseteq B(\lambda _i)\), the interior of \(B(\lambda _i) \cap B(\lambda _j)\) is nonempty and hence tiling of \(B(\mu )\) with \(B(\mu _1),\ldots ,B(\mu _k)\) is not possible. Additionally, if \(r(C(\lambda _i)) = l(C(\lambda _j))\), then neither a rightloose representation of \(\lambda _{i}\) nor a leftloose representation of \(\lambda _j\) can be used. These checks and restrictions are performed by the algorithm in lines 6 to 14.
Let \(Q_i = [r_{i}, l_{i+1}] \times [y(s_\mu ), y(t_\mu )]\) for \(i \in [0,k']\). We say that \(Q_{i}\) is an open gap (after \(\lambda _{i}\), before \(\lambda _{i+1}\)) if \(Q_i\) has nonempty interior. In particular, if \(x = r_0 < l_1\) (\(r_{k'} < l_{k'+1} = x'\)) then there is an open gap before \(\lambda _1\) (after \(\lambda _{k'}\)). On the one hand, if there is an edge \((s_\mu ,t_\mu )\) or there is at least one \(\mu _i\) whose core is empty, then we need at least one open gap to construct an \([x,x']\)representation. This condition is checked by the algorithm in line 15. On the other hand, if \((s_\mu ,t_\mu )\) is not an edge of G then we need to close all the gaps in the tiling. There are two ways to close the gaps. Firstly, the representation of each child node whose core is empty can be placed so that it closes a gap. The second way is to use loose representations for children nodes \(\lambda _1,\ldots ,\lambda _{k'}\).
If \(\theta (\lambda _i) = \emptyset \) for some \(i=1,\ldots ,k'\), then an \([x,x']\)representation of \(\mu \) does not exist. Assume that \(\theta (\lambda _i)\) is nonempty for every \(i=1,\ldots ,k'\). Suppose that c is a function that assigns to every \(\lambda _i\) a feasible type of representation from the set \(\theta (\lambda _i)\). Whenever \(c(\lambda _{i})\) is rightloose or \(c(\lambda _{i+1})\) is leftloose, we can stretch the representation of \(\lambda _i\) or \(\lambda _{i+1}\), so that it closes the gap \(Q_i\). In lines 17 to 25, the algorithm greedily closes as many gaps as possible. The greedy strategy processes children \(\lambda _i\)’s from left to right and for each child: closes both adjacent gaps if it can; it prefers closing the left gap if it is not yet closed (this is the last bounding box that can close this gap) from the right gap.
If there are some open gaps left and \((s_\mu , t_\mu )\) is not an edge of G, then each open gap needs to be closed by placing in this gap a representation of one or more of the children whose core is empty.
Claim 13
There exists an \([x,x']\)representation of a Pnode \(\mu \) if and only if Algorithm 2 returns true.
Proof
Claim follows by the Tiling Lemma for Parallel Nodes and the Stretching Lemma. The correctness of the greedy strategy follows by a simple greedy exchange argument.

If u is a fixed vertex on the left path of f, then \(\chi (f) = r(u)\).

If u is a fixed vertex on the right path of f, then \(\chi (f) = l(u)\).

If \(\lambda \) is a child of \(\mu \) whose core is nonempty, and the virtual edge of \(\lambda \) is on the left path of f, then \(\chi (f) \geqslant r(C(\lambda ))\).

If \(\lambda \) is a child of \(\mu \) whose core is nonempty, and the virtual edge of \(\lambda \) is on the right path of f, then \(\chi (f) \leqslant l(C(\lambda ))\).
Let \(\mathcal {X}'(f)\) be a set of all \(\chi (f)\) in \([x,x']\) that satisfy all the above conditions. If \(\mathcal {X}'(f) = \emptyset \) for some face f in \(V(\mathcal {E}^*)\) or \(x \notin \mathcal {X}'(s^*)\) or \(x' \notin \mathcal {X}'(t^*)\), then there is no \([x,x']\)representation of \(G_\mu \). Since we are looking for an \([x,x']\)representation of \(G_\mu \), we set \(\mathcal {X}'(s^*) = [x,x]\) and \(\mathcal {X}'(t^*) = [x',x']\) as the splitting line for \(s^*\) (\(t^*\)) must be set to x (\(x'\)).

If g is to the left of f, then \(\chi (f) > l(\mathcal {X}'(g))\).

If g is to the right of f, then \(\chi (f) < r(\mathcal {X}'(g))\).
Claim 14
 (1)
For every face f in \(V(\mathcal {E}^*)\), \(\mathcal {X}(f)\) is an interval in \([x,x']\),
 (2)For every two faces f and g such that f is to the left of g, we have that:

\(l(\mathcal {X}(f)) \leqslant l(\mathcal {X}(g))\) and if \(l(\mathcal {X}(f)) = l(\mathcal {X}(g))\) then \(\mathcal {X}(g)\) is open from the left side.

\(r(\mathcal {X}(f)) \leqslant r(\mathcal {X}(g))\) and if \(r(\mathcal {X}(f)) = r(\mathcal {X}(g))\) then \(\mathcal {X}(f)\) is open from the right side.

A face f in \(V(\mathcal {E}^*)\) is determined if \(\mathcal {X}(f)\) is a singleton (i.e., the location of the splitting line of f is already fixed); otherwise f is undetermined.
In what follows, we construct a 2CNF formula \(\Phi \) that is satisfiable if and only if an \([x,x']\)representation of \(\mu \) exists.

The true (false) value of variable \(l_\lambda \) means that we use leftloose (leftfixed) representation of node \(\lambda \).

The true (false) value of variable \(r_\lambda \) means that we use rightloose (rightfixed) representation of node \(\lambda \).

The variable \(l_f\) is true when the splitting line of f is set strictly to the right of \(l(\mathcal {X}(f))\). It is false when \(\chi (f) = l(\mathcal {X}(f))\).

The variable \(r_f\) is true when the splitting line of f is set strictly to the left of \(r(\mathcal {X}(f))\). It is false when \(\chi (f) = r(\mathcal {X}(f))\).
For the left outer face \(s^*\) and the right outer face \(t^*\) we introduce variables \(r_{s^*}\) and \(l_{t^*}\). Since \(s^*\) and \(t^*\) are determined, the corresponding variables are always set to false.
Clauses of \(\Phi \) We split the clauses of \(\Phi \) into four types.

For every child \(\lambda \) with nonempty core and for every type of representation of \(\lambda \) which is not feasible, we add a clause that forbids using representation of this type. For example, when there is no leftloose, rightfixed representation of \(\lambda \) we add a clause \(\lnot (l_\lambda \wedge \lnot r_\lambda ) = (\lnot l_\lambda \vee r_\lambda )\) to \(\Phi \).

For every determined inner face f, we add the clauses \((\lnot l_f)\) and \((\lnot r_f)\), and for \(s^*\) and \(t^*\) we add the clauses \((\lnot r_{s^*})\) and \((\lnot l_{t^*})\).

For every undetermined inner face f, we add the clause \((l_f)\) if \(\mathcal {X}(f)\) is open from the left side, and \((r_f)\) if \(\mathcal {X}(f)\) is open from the right side. If \(\mathcal {X}(f)\) is closed from the left and closed from the right side, we add the clause \((l_f \vee r_f)\) as the splitting line of f cannot be placed in both endpoints of \(\mathcal {X}(f)\) simultaneously.
 For every face f and for every node \(\lambda \) on the left path of f with a nonempty core:

We add the clause \((l_f \Rightarrow r_\lambda )\).

If \(r(C(\lambda )) < l(\mathcal {X}(f))\), we add the clause \((r_\lambda )\).

If \(r(C(\lambda )) = l(\mathcal {X}(f))\), we add the clause \((\lnot l_f \Rightarrow \lnot r_\lambda )\).

We add analogous clauses for the nodes whose cores are nonempty and that correspond to the edges from the right path of f.

For every pair of faces f and g in \(V(\mathcal {E}^*)\) such that f is to the left of g and such that \(r(\mathcal {X}(f)) \geqslant l(\mathcal {X}(g))\), we add the clause \((\lnot r_f \Rightarrow l_g)\).
Claim 15
Let \(\mu \) be an Rnode, \(\mathcal {E}\) be a planar embedding of the skeleton of \(\mu \). There exists an \([x,x']\)representation of \(\mu \) that corresponds to a planar embedding \(\mathcal {E}\) if and only if \(\Phi \) is satisfiable.
Proof

\(l_f\) is true if and only if \(\chi (f) > l(\mathcal {X}(f))\),

\(r_f\) is true if and only if \(\chi (f) < r(\mathcal {X}(f))\).

\(l_\lambda \) is true if and only if \(\lambda \) is leftloose in \(\phi \),

\(r_\lambda \) is true if and only if \(\lambda \) is rightloose in \(\phi \).
 (1)
The function \(\chi \) is an stvaluation of \(\mathcal {E}^*\).
 (2)For every fixed vertex u we have that$$\begin{aligned} l_{\phi }(u) = \chi (\text {left face of }u) \text { and } r_{\phi }(u) = \chi (\text {right face of } u)\text {.} \end{aligned}$$
 (3)For every child \(\lambda \) of \(\mu \) such that \(C(\lambda ) \ne \emptyset \) we have that$$\begin{aligned} G_\lambda \text { has an } [\chi (\text {left face of } \lambda ), \chi (\text {right face of } \lambda )]\text {representation.} \end{aligned}$$

\(\chi (g) < z\) whenever g is a face to the left of f and the value \(\chi (g)\) is already fixed, and

\(z < \chi (h)\) whenever h is a face to the right of f and the value \(\chi (h)\) is already fixed, and

\(l(\mathcal {X}(f))< z < r(\mathcal {X}(f))\).
Moreover, for any two faces \(f_1,f_2\) such that \(f_1\) is to the left of \(f_2\) and neither \(\chi (f_1)\) nor \(\chi (f_2)\) is fixed, we have that \(l(\mathcal {X}''(f_1)) \leqslant l(\mathcal {X}''(f_2))\) and \(r(\mathcal {X}''(f_1)) \leqslant r(\mathcal {X}''(f_2))\). Thus, for every face f for which both \(l_f,r_f\) are true, we can choose a value \(\chi (f)\) from \(\mathcal {X}''(f)\) so that \(\chi \) is an stvaluation of \(\mathcal {E}^*\). We need to check the remaining conditions (2) and (3). Condition (2) is satisfied since, for a determined face f we have chosen \(\chi (f)\) from the singleton \(\mathcal {X}(f)\). Condition (3) follows from the fact that the clauses of Type I and Type III are satisfied, and by the Stretching Lemma. \(\square \)
4.2.1 Complexity Considerations
To compute the feasible representation for a node \(\mu \) with k children, our algorithm works in \(O{\left( k\right) }\)time if \(\mu \) is an Snode. Algorithm 2 for a Pnode \(\mu \) needs to sort the children of \(\mu \) and thus, it works in \(O{\left( k \log k\right) }\)time. For an Rnode, the number of clauses of Types I, II and III is \(O{\left( k\right) }\). The number of clauses of Type IV is \(O{\left( k^2\right) }\) and for some graphs, it is quadratic. Thus, the algorithm works in \(O{\left( k^2\right) }\) time for an Rnode. Since the number of all edges in all nodes of T is \(O{\left( n\right) }\), the whole algorithm works in \(O{\left( n^2\right) }\) time.
4.3 Faster Algorithm
The bottleneck of the algorithm presented in Sect. 4.2 is the number of clauses of Type IV in the 2CNF formula constructed for Rnodes. In the presented algorithm we add one clause \((\lnot r_f \Rightarrow l_g)\) for any two faces f and g in \(V(\mathcal {E}^*)\) such that f is to the left of g and \(r(\mathcal {X}(f)) \geqslant l(\mathcal {X}(g))\). The number of such pairs of faces can be quadratic. In this section we present a different, less direct, approach that uses a smaller number of clauses to express the same set of constraints.
We can treat the planar stgraph \(\mathcal {E}^*\) as a planar poset with a single minimal and a single maximal element. Using the result by Baker et al. [3] we know that such a poset has dimension at most 2. Thus, there are two numberings p and q of the vertices of \(\mathcal {E}^*\) such that a face f is to the left of a face g if and only if \(p(f) < p(g)\) and \(q(f) < q(g)\). Such numberings correspond to dominance drawings of planar stgraphs and can be computed in linear time [16].
For each face f, we have two Boolean variables \(l_f\) and \(r_f\), two real values \(\lambda _f = l(\mathcal {X}(f))\), \(\varrho _f = r(\mathcal {X}(f))\), and two integer values \(p_f = p(f)\) and \(q_f = q(f)\). We want to introduce a small set of 2CNF clauses that implies \((\lnot l_g \Rightarrow r_f)\) whenever \(p_f < p_g\), \(q_f < q_g\), and \(\varrho _f \geqslant \lambda _g\).
To give an intuition for our approach, consider the simpler problem of determining for every face f the number of faces g such that \(p_f < p_g\), \(q_f < q_g\), and \(\varrho _f \geqslant \lambda _g\). This is a threedimensional range counting query problem and can be solved in \(O{\left( n\log ^3{n}\right) }\) time using range trees, as described in Chapter 5 of [17].
It can also be solved in \(O{\left( n \log ^2{n}\right) }\) time using the following sweep line algorithm. First, we setup a dynamic data structure for twodimensional range counting queries. Then, we process faces, one by one, in order of increasing values of p. After processing each face h, we add the point \((q_h, \varrho _h)\) to the structure. To compute the answer for a face h, we ask the structure for the number of points (x, y) such that \(x < p_h\) and \(y \geqslant \lambda _h\).
Now we give an overview of our approach to the original problem of creating a small set of 2CNF clauses. Our algorithm is a sweep line algorithm that resembles the one described above. In particular, we use a data structure similar to a twodimensional range tree, that is simply a set of persistent balanced binary search trees, each with \(\varrho _f\) as the sorting key. During the course of the sweep, we create additional Boolean variables corresponding to the vertices of the trees and implications corresponding to their edges. The algorithm executes \(O{\left( n\right) }\) queries against the structure, each of the queries takes \(O{\left( \log ^2{n}\right) }\) time. As a result, both the maximal size of the structure and the total running time amount to \(O{\left( n \log ^2{n}\right) }\). The algorithm produces \(O{\left( n \log ^2{n}\right) }\) 2CNF clauses that correspond to the edges of the search trees and the control flow of the queries.
For an overview of persistent data structures, refer to [23]. However, we only need the ideas presented in [42], which are summarized in this paragraph. The tree structure used in our algorithm is a modification of the AVL tree. A node \(\alpha \) of the tree stores a pointer to its left child \(left(\alpha )\), a pointer to its right child \(right(\alpha )\) and the sorting key \(key(\alpha )\). The parent links are purposefully not stored – AVL trees can easily be implemented without them and we must not store them for the persistent approach to work. The difference from regular AVL trees is that no node is ever modified. Let A be the set of all vertices that the insertion procedure would modify, together with all of their ancestors. It is a known property of AVL trees that A is logarithmic in the number of vertices of the tree. In a persistent AVL tree, instead of modifying nodes in A, we perform the modifications on their copies – we create a new node \(C(\alpha )\) for every \(\alpha \in A\) and set \(key(C(\alpha )) = key(\alpha )\).
This way, each addition to the tree introduces a logarithmic number of new nodes. After each addition, we get a new root node, that represents the new tree, the old tree is represented by the previous root and all but a logarithmic number of the nodes are shared by both trees. The graph of old and new nodes together with edges from nodes to their children is an acyclic digraph.
Now, in our algorithm, each tree keeps some set of Boolean variables \(r_f\) sorted by the value of \(\varrho _f\). More specifically, with every vertex \(\alpha \) we associate a Boolean variable \(var(\alpha )\). To add a variable \(r_f\) into the tree we add a new node \(\alpha \) with \(key(\alpha ) = \varrho _f\) and \(var(\alpha ) = r_f\). Additionally, with each node \(\alpha \) of the tree we associate a second Boolean variable \(var'(\alpha )\) and for each child node \(\beta \) we add a clause \((var'(\alpha ) \Rightarrow var'(\beta ))\). Finally, for each node \(\alpha \) we add a clause \((var'(\alpha ) \Rightarrow var(\alpha ))\).
To simplify the presentation, assume that we have \(n=2^k\) faces. Let numberings p and q take values \(0,\ldots ,n1\). We construct the 2CNF formula in the following way. First, for each interval of integers \([j \cdot 2^i, (j+1) \cdot 2^i), 0 \leqslant i \leqslant k, j<\frac{n}{2^i}\) we have one persistent balanced binary search tree. The tree for the interval [a, b) is going to keep variables \(r_f\) for faces f such that \(q_f \in [a,b)\).
We process faces, one by one, in order of increasing values of p. After processing each face f, we add the variable \(r_f\) to all trees [a, b) such that \(q_f \in [a,b)\). There are \(k+1\) such trees and an addition to each tree takes \(O{\left( \log {n}\right) }\) time and introduces \(O{\left( \log {n}\right) }\) new Boolean variables.
This way, when we process face g, then any earlier processed face f satisfies \(p_f < p_g\) and no other face satisfies this condition. Now, for any value \(q_g\) we can select a logarithmic size subset S of the trees such that the union of the intervals of the trees is exactly \([0,q_g)\). The variables \(r_f\) stored in these trees are exactly the variables for faces that satisfy both \(p_f < p_g\) and \(q_f < q_g\). This is exactly the set of faces that are to the left of the face g.
Each tree in S stores variables \(r_f\) sorted by \(\varrho _f\). We can execute a binary search for the leftmost node with the key no smaller than \(\lambda _g\). During the search, when we descend from an inner node \(\alpha \) to the left child or when \(\alpha \) is the final node of the search, we add clauses \((\lnot l_g \Rightarrow var'(right(\alpha ))\) and \((\lnot l_g \Rightarrow var(\alpha ))\). The first implication is forwarded over the tree to all nodes in the right subtree. This way, after completing the search, we have that \(\lnot l_g\) implies \(r_f\) for all faces f such that \(p_f < p_g\), \(q_f < q_g\) and \(\varrho _f \geqslant \lambda _g\) – exactly as intended.
The total running time of this procedure is \(O{\left( n\log ^2{n}\right) }\) and it produces at most that many variables and clauses. This leads to the following.
Theorem 3
The rectangular bar visibility representation extension problem for a planar stgraph with n vertices can be solved in \(O{\left( n\log ^2{n}\right) }\) time.
5 Hardness Results
In this section we show two hardness results. In the first subsection we show that the bar visibility extension problem for planar graphs is \(\mathsf {NP}\)complete. Then, we show that the bar visibility extension problem for directed graphs is \(\mathsf {NP}\)complete when restricted to grid representations.
5.1 Representations of Undirected Graphs
Theorem 1
The Bar Visibility Representation Extension problem is \(\mathsf {NP}\)complete.
Proof
It is clear that the Bar Visibility Representation Extension problem is in \(\mathsf {NP}\). To prove completeness, we present a reduction from \(\textsc {PlanarMonotone3Sat}\). Given a formula \(\phi \) we construct a graph G, a subset \(V'\) of vertices of G, and a representation \(\psi '\) of \(V'\) that is extendable to a representation of the whole G if and only if \(\phi \) is satisfiable. The vertex v is fixed when \(v \in V'\), otherwise v is unrepresented. The reduction constructs a planar Boolean circuit that simulates the formula \(\phi \). The bars assigned to fixed vertices of G create wires and gates of the circuit. Unrepresented vertices of G correspond to Boolean values transmitted over the wires. Our construction uses several Boolean gates: a NOT gate, a XOR gate, a special gate which we call a CXOR gate, and an OR gate.
In the figures illustrating this proof, the red bars denote the fixed vertices of G and the black bars denote the unrepresented vertices. A bar may have its left (right) endpoint marked or not depending on whether the bar extends to the left (right) of the figure or not. The figures also contain some vertical ranges. These ranges are only required for the description of the properties of the gadgets.
XOR Gadget Figure 9 presents a XOR gate. It checks that the inputs \(x_1\) and \(x_2\) have different Boolean values. It also produces outputs \(y_1\) and \(y_2\). The partial representation is extendable if and only if \(x_1 = \lnot x_2 = \lnot y_1 = y_2\).
To see that, observe that the visibility gap between b and \(\top \) needs to be obstructed and b has only two neighbors \(x_1\) and \(y_1\). Assume that \(y_1\) blocks the visibility between b and \(\top \). Now \(x_1\) needs to block the visibility between b and the other bars. Thus, \(x_1\) is placed below b. The only other neighbor of \(x_1\) is \(x_2\) and thus, it needs to go above a. The last unrepresented vertex is \(y_2\) and it needs to obstruct the visibility gap between a and \(\bot \).
The other possibility is that \(x_1\) blocks visibility between b and \(\top \). The analysis of this case is symmetric to the previous one and gives the second possible valuation of the variables.
All we need to finish the construction of our building blocks is a clause gadget that checks that at least one of three wires connected to it transmits a true value.
OR Gadget and Clause Gadget Figure 12 presents an OR gate that has two inputs \(x_1\) and \(x_2\) and one output y.
The output value can be true only if at least one of the inputs is true. In each of these three scenarios y can be represented in the higher of its regions. See Fig. 12 for these three representations. Now, consider a representation of the gadget where both \(x_1\) and \(x_2\) are false. Observe that \(x_1\) and b are neighbors and we have that \(r(x_1) > l(b) = l(a)\). Vertices \(x_1\) and a are not adjacent and \(x_2\) is represented below a. The only other bar that can block the visibility gap between a and \(x_1\) is y. Therefore, y is placed in the lower of its regions, as it needs to be below \(x_1\).
Combining two OR gates and two bars that ensure that the output of the second gate is true, we get a clause gadget presented in Fig. 13.
Given an instance \(\phi \) of \(\textsc {PlanarMonotone3Sat}\) (together with a rectilinear planar representation of \(\phi \)), we show how we construct the graph G with a partial representation \(\psi '\). We rotate the rectilinear representation by 90 degrees. Now, we replace vertical segments representing variables of \(\phi \) with variable gadgets and vertical segments representing clauses of \(\phi \) with clause gadgets. Finally, for each occurrence of variable x in clause C, we replace the horizontal connection between the segment of x and the segment of C by a wire connecting the appropriate gadgets. The properties of our gadgets assert that \(\phi \) is satisfiable if and only if \(\psi '\) is extendable to a bar visibility representation of G. \(\square \)
5.2 Grid Representations
In this section we consider the following problem:
Grid Bar Visibility Representation Extension for directed graphs:
Input:
\((G, \psi ')\), where G is a directed graph and \(\psi '\) is a mapping assigning bars to some subset \(V'\) of V(G).
Question:
Does G admit a grid bar visibility representation \(\psi \) with \(\psi V' = \psi '\)?
In what follows we show that the above problem is \(\mathsf {NP}\)complete.
The proof is generic and can be easily modified to work for other grid representations including undirected, rectangular directed/undirected, and even other models of visibility.
Theorem 3
Grid Bar Visibility Representation Extension problem is \(\mathsf {NP}\)complete.
Proof
The graph G is constructed as follows. We start with \(G'\) which is a \(K_{2,m+1}\) with source s and sink t as the two vertices of degree \(m+1\) and the other vertices are labeled \(u_0, \ldots , u_{m}\). Now, for each \(i=1,\ldots ,3m\), create a planar stgraph \(H_i\) which is a \(K_{2,a_i}\) with source \(s_i\) and sink \(t_i\) as its two vertices of degree \(a_i\). We remark that the width of any visibility representation of \(H_i\) in the integer grid is at least \(a_i\). Finally, the graph G is obtained by attaching each \(H_i\) to \(G'\) by adding the edges \((s,s_i)\) and \((t_i,t)\).
We now claim that there is a solution for input \((G,\psi ')\) if and only if the 3Partition instance \(\{w,a_1, \ldots , a_{3m}\}\) has a solution. First, we consider a collection of triples \(T_1, \ldots , T_m\) which form a solution of the 3Partition problem. We extend \(\psi '\) to a visibility representation of G where, for each triple \(T_j = \{a_{j_1}, a_{j_2}, a_{j_3}\}\), we place visibility representations of \(H_{j_1}\), \(H_{j_2}\), \(H_{j_3}\) in sequence lefttoright and between the fixed bars \(\psi '(u_{j1})\) and \(\psi '(u_j)\). Notice that this is possible since \(a_{j_1} + a_{j_2} + a_{j_3} = w\) and the distance from the rightend of \(\psi '(u_{j1})\) to the leftend of \(\psi '(u_j)\) is w.
To show that any visibility representation \(\psi \) of G which extends \(\psi '\) provides a solution to the 3Partition problem we make the following observations. First, due to the the placement of the bars \(\psi '(s), \psi '(t), \psi '(u_0)\) and \(\psi '(u_m)\), the outer face of the resulting embedding is \(s,u_0,t,u_m\). In particular, the bars of every \(H_i\) occur strictly within the rectangle enclosed by \(\psi '(s)\) and \(\psi '(t)\). Thus, each \(H_i\) must also be drawn between some pair of bars \(\psi '(u_{j1})\), \(\psi '(u_j)\) (for some \(j \in \{1,\ldots , m1\}\)). Second, due to each \(a_i\) being between \(\frac{w}{4}\) and \(\frac{w}{2}\) and the width of a visibility representation of \(H_i\) being at least \(a_i\), at most three \(H_i\)’s ‘fit’ between the fixed bars \(\psi '(u_{j1})\) and \(\psi '(u_{j})\). Thus, since there are 3m \(H_i\)’s, every \(\psi '(u_{j1})\), \(\psi '(u_{j})\) has exactly three \(H_i\)’s between them. Moreover, if \(H_{i_1}, H_{i_2}\) and \(H_{i_3}\) are placed between \(\psi '(u_{j1})\) and \(\psi '(u_j)\), then \(a_{i_1} + a_{i_2} + a_{i_3} \leqslant w\). Thus, in \(\psi \), the gaps between each pair \(\psi '(u_{j1})\), \(\psi '(u_j)\) must contain precisely three \(H_i\)’s whose sum of corresponding \(a_i\)’s is w, i.e., the gaps correspond to the triples of a solution of the 3Partition problem. \(\square \)
6 Open Problems
The main problem left open is to decide whether there exists a polynomialtime algorithm that checks whether a partial representation of a directed planar graph is extendable to a bar visibility representation of the whole graph. Although we showed an efficient algorithm for the case of planar stgraphs, it seems that some additional ideas are needed to resolve this problem in general.
Some further open problems concern extension problems for the weak and strong visibility models.
6.1 Weak Visibility
Tamassia and Tollis [47] showed that every planar graph admits a weak visibility representation. Nevertheless, the problem of extending a partial representation of a planar graph to a weak visibility representation is \(\mathsf {NP}\)complete [8].
Di Battista and Tamassia [14] showed that a directed planar graph G admits a weak visibility representation if and only if G admits an upward planar drawing. The latter problem is \(\mathsf {NP}\)complete [28], so the problem of extending partial weak visibility representations for planar digraphs is also \(\mathsf {NP}\)complete. Nevertheless, we do not know whether there is an efficient algorithm if we assume that an upward planar drawing of a planar digraph is given on the input.
6.2 Strong Visibility
Due to Andreae [1], the recognition of planar graphs that admit a strong visibility representation is \(\mathsf {NP}\)complete. It follows that the problem of testing whether a partial representation of a planar graph is extendable to a strong visibility representation is also \(\mathsf {NP}\)complete. Nevertheless, we do not know if there exists an efficient algorithm that tests whether a partial representation of a planar digraph is extendable to a strong representation of the whole graph. It seems that some of our results on the bar visibility model can be adjusted to the strong visibility model.
References
 1.Andreae, T.: Some results on visibility graphs. Discrete Appl. Math. 40(1), 5–17 (1992)MathSciNetCrossRefMATHGoogle Scholar
 2.Angelini, P., Di Battista, G., Frati, F., Jelínek, V., Kratochvíl, J., Patrignani, M., Rutter, I.: Testing planarity of partially embedded graphs. ACM Trans. Algorithms 11(4), 1–42 (2015)MathSciNetCrossRefMATHGoogle Scholar
 3.Baker, K.A., Fishburn, P.C., Roberts, F.S.: Partial orders of dimension 2. Networks 2(1), 11–28 (1972)MathSciNetCrossRefMATHGoogle Scholar
 4.Biedl, T.C.: Small drawings of outerplanar graphs, seriesparallel graphs, and other planar graphs. Discrete Comput. Geom. 45(1), 141–160 (2011)MathSciNetCrossRefMATHGoogle Scholar
 5.Bläsius, T., Rutter, I.: Simultaneous PQordering with applications to constrained embedding problems. ACM Trans. Algorithms 12(2), 1–46 (2015)MathSciNetCrossRefGoogle Scholar
 6.Cardinal, J., Hoffmann, U.: Recognition and complexity of point visibility graphs. Discrete Comput. Geom. 57(1), 164–178 (2017)MathSciNetCrossRefMATHGoogle Scholar
 7.Chang, Y.W., Hutchinson, J.P., Jacobson, M.S., Lehel, J., West, D.B.: The bar visibility number of a graph. SIAM J. Discrete Math. 18(3), 462–471 (2004)MathSciNetCrossRefMATHGoogle Scholar
 8.Chaplick, S., Dorbec, P., Kratochvíl, J., Montassier, M., Stacho, J.: Contact representations of planar graphs: Extending a partial representation is hard. In: WG 2014: 40th International Workshop on GraphTheoretic Concepts in Computer Science, NouanleFuzelier, France, June 2014. Revised selected papers, pp. 139–151 (2014)Google Scholar
 9.Chaplick, S., Fulek, R., Klavík, P.: Extending partial representations of circle graphs. In: GD 2013: 21st International Symposium on Graph Drawing, Bordeaux, France, September 2013. Revised selected papers, pp. 131–142 (2013)Google Scholar
 10.Chaplick, S., Guśpiel, G., Gutowski, G., Krawczyk, T., Liotta, G.: The partial visibility representation extension problem. In: GD 2016: 24th International Symposium on Graph Drawing and Network Visualization, Athens, Greece, September 2016. Revised selected papers, pp. 266–279 (2016)Google Scholar
 11.Chrobak, M., Payne, T.H.: A lineartime algorithm for drawing a planar graph on a grid. Inf. Process. Lett. 54(4), 241–246 (1995)MathSciNetCrossRefMATHGoogle Scholar
 12.Di Battista, G., Eades, P., Tamassia, R., Tollis, I.G.: Graph Drawing: Algorithms for the Visualization of Graphs. PrenticeHall, Upper Saddle River (1999)MATHGoogle Scholar
 13.Di Battista, G., Frati, F.: A survey on smallarea planar graph drawing (2014). arXiv:1410.1006
 14.Di Battista, G., Tamassia, R.: Algorithms for plane representations of acyclic digraphs. Theor. Comput. Sci. 61(2–3), 175–198 (1988)MathSciNetCrossRefMATHGoogle Scholar
 15.Di Battista, G., Tamassia, R.: Online planarity testing. SIAM J. Comput. 25(5), 956–997 (1996)MathSciNetCrossRefMATHGoogle Scholar
 16.Di Battista, G., Tamassia, R., Tollis, I.G.: Area requirement and symmetry display of planar upward drawings. Discrete Comput. Geom. 7(1), 381–401 (1992)MathSciNetCrossRefMATHGoogle Scholar
 17.de Berg, M., Cheong, O., van Kreveld, M., Overmars, M.: Computational Geometry: Algorithms and Applications, 3rd edn. Springer, Berlin (2008)CrossRefMATHGoogle Scholar
 18.de Berg, M., Khosravi, A.: Optimal binary space partitions for segments in the plane. Int. J. Comput. Geom. Appl. 22(3), 187–205 (2012)MathSciNetCrossRefMATHGoogle Scholar
 19.de Fraysseix, H., de Mendez, P.O., Pach, J.: Representation of planar graphs by segments. In: Intuitive Geometry (Szeged, 1991), Volume 63 of Colloquia Mathematica Societatis János Bolyai, pp. 109–117 (1994)Google Scholar
 20.de Fraysseix, H., de Mendez, P.O., Rosenstiehl, P.: On triangle contact graphs. Comb. Probab. Comput. 3, 233–246 (1994)MathSciNetCrossRefMATHGoogle Scholar
 21.de Fraysseix, H., Pach, J., Pollack, R.: Small sets supporting Fáry embeddings of planar graphs. In: STOC 1988: Proceedings of the 20th Annual ACM Symposium on Theory of Computing, Chicago, IL, USA, pp. 426–433 (1988)Google Scholar
 22.de Fraysseix, H., Pach, J., Pollack, R.: How to draw a planar graph on a grid. Combinatorica 10(1), 41–51 (1990)MathSciNetCrossRefMATHGoogle Scholar
 23.Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. J. Comput. Syst. Sci. 38(1), 86–124 (1989)MathSciNetCrossRefMATHGoogle Scholar
 24.Duchet, P., Hamidoune, Y.O., Las Vergnas, M., Meyniel, H.: Representing a planar graph by vertical lines joining different levels. Discrete Math. 46(3), 319–321 (1983)MathSciNetCrossRefMATHGoogle Scholar
 25.Fáry, I.: On straight line representation of planar graphs. Acta Univ. Szeged. Sect. Sci. Math. 11, 229–233 (1948)MathSciNetMATHGoogle Scholar
 26.Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NPCompleteness. W.H. Freeman, New York (1979)MATHGoogle Scholar
 27.Garg, A., Tamassia, R.: Upward planarity testing. Order 12(2), 109–133 (1995)MathSciNetCrossRefMATHGoogle Scholar
 28.Garg, A., Tamassia, R.: On the computational complexity of upward and rectilinear planarity testing. SIAM J. Comput. 31(2), 601–625 (2001)MathSciNetCrossRefMATHGoogle Scholar
 29.Ghosh, S.K., Goswami, P.P.: Unsolved problems in visibility graphs of points, segments, and polygons. ACM Comput. Surv. 46(2), 1–29 (2013)CrossRefMATHGoogle Scholar
 30.Gutwenger, C., Mutzel, P.: A linear time implementation of SPQRtrees. In: Proceedings of the GD 2000: 8th International Symposium on Graph Drawing, Colonial Williamsburg, VA, USA, September 2000, pp. 77–90 (2001)Google Scholar
 31.Hartman, I.B.A., Newman, I., Ziv, R.: On grid intersection graphs. Discrete Math. 87(1), 41–52 (1991)MathSciNetCrossRefMATHGoogle Scholar
 32.He, X., Wang, J.J., Zhang, H.: Compact visibility representation of 4connected plane graphs. Theor. Comput. Sci. 447, 62–73 (2012)MathSciNetCrossRefMATHGoogle Scholar
 33.Kant, G., He, X.: Regular edge labeling of 4connected plane graphs and its applications in graph drawing problems. Theor. Comput. Sci. 172(1–2), 175–193 (1997)MathSciNetCrossRefMATHGoogle Scholar
 34.Kant, G., Liotta, G., Tamassia, R., Tollis, I.G.: Area requirement of visibility representations of trees. Inf. Process. Lett. 62(2), 81–88 (1997)MathSciNetCrossRefMATHGoogle Scholar
 35.Klavík, P., Kratochvíl, J., Krawczyk, T., Walczak, B.: Extending partial representations of function graphs and permutation graphs. In: Proceedings of the ESA 2012: 20th Annual European Symposium on Algorithms, Ljubljana, Slovenia, September 2012, pp. 671–682 (2012)Google Scholar
 36.Klavík, P., Kratochvíl, J., Otachi, Y., Rutter, I., Saitoh, T., Saumell, M., Vyskočil, T.: Extending partial representations of proper and unit interval graphs. Algorithmica 77(4), 1071–1104 (2017)Google Scholar
 37.Klavík, P., Kratochvíl, J., Otachi, Y., Saitoh, T.: Extending partial representations of subclasses of chordal graphs. Theor. Comput. Sci. 576, 85–101 (2015)MathSciNetCrossRefMATHGoogle Scholar
 38.Klavík, P., Kratochvíl, J., Otachi, Y., Saitoh, T., Vyskočil, T.: Extending partial representations of interval graphs. Algorithmica 1–23 (2016)Google Scholar
 39.Koebe, P.: Kontaktprobleme der konformen Abbildung. Hirzel, Stuttgart (1936)MATHGoogle Scholar
 40.Luccio, F., Mazzone, S., Wong, C.K.: A note on visibility graphs. Discrete Math. 64(2–3), 209–219 (1987)MathSciNetCrossRefMATHGoogle Scholar
 41.Mohar, B.: A polynomial time circle packing algorithm. Discrete Math. 117(1–3), 257–263 (1993)MathSciNetCrossRefMATHGoogle Scholar
 42.Myers, E.W.: Efficient applicative data types. In: Proceedings of the POPL 84: 11th ACM SIGACTSIGPLAN Symposium on Principles of Programming Languages, Salt Lake City, UT, USA, January 1984, pp. 66–75 (1984)Google Scholar
 43.Otten, R.H.J.M., van Wijk, J.G.: Graph representations in interactive layout design. In: Proceedings of the IEEE International Symposium on Circuits and Systems, New York, NY, USA, May 1978, pp. 914–918 (1978)Google Scholar
 44.Patrignani, M.: On extending a partial straightline drawing. Int. J. Found. Comput. Sci. 17(5), 1061–1070 (2006)MathSciNetCrossRefMATHGoogle Scholar
 45.Schlag, M., Luccio, F., Maestrini, P., Lee, D.T., Wong, C.K.: A visibility problem in VLSI layout compaction. Adv. Comput. Res. 2, 259–282 (1985)Google Scholar
 46.Storer, J.A.: On minimalnodecost planar embeddings. Networks 14(2), 181–212 (1984)MathSciNetCrossRefMATHGoogle Scholar
 47.Tamassia, R., Tollis, I.G.: A unified approach to visibility representations of planar graphs. Discrete Comput. Geom. 1(4), 321–341 (1986)MathSciNetCrossRefMATHGoogle Scholar
 48.Wang, J.J., He, X.: Visibility representation of plane graphs with simultaneous bound for both width and height. J. Graph Algorithms Appl. 16(2), 317–334 (2012)MathSciNetCrossRefMATHGoogle Scholar
 49.Wismath, S.K.: Characterizing bar lineofsight graphs. In: Proceedings of the SCG 1985: 1st Annual Symposium on Computational Geometry, Baltimore, MD, USA, June 1985, pp. 147–152 (1985)Google Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.