Journal of Graph Algorithms and Applications Edge-weighted Contact Representations of Planar Graphs

We study contact representations of edge-weighted planar graphs, where vertices are represented as interior-disjoint rectangles or rectilinear polygons and edges are represented as contacts of vertex boundaries whose contact lengths represent the edge weights. For the case of rectangles, we show that, for any given edge-weighted planar graph whose outer face is a quadrangle, that is internally triangulated and that has no separating triangles, we can construct in linear time an edge-proportional rectangular dual (contact lengths are equal to the given edge weights and the union of all rectangles is again a rectangle) or report failure if none exists. In the case of arbitrarily many outer vertices, we show that deciding whether a square layout exists is NP-complete. If the orientation of each contact is specified by a so-called regular edge labeling and edge weights are lower bounds on the contact lengths, a corresponding rectangular dual that minimizes the area and perimeter of the enclosing rectangle can be found in linear time. On the other hand, without a given regular edge labeling, the same problem is NP-complete, as is the question whether a rectangular dual exists given lower and upper bounds on the contact lengths. For the case of rectilinear polygons, we give a complete characterization of the polygon complexity required for representing connected internally triangulated graphs: For outerplanar graphs and graphs with a single inner vertex polygon, complexity 8 is sufficient and necessary, and for graphs with two adjacent or multiple non-adjacent internal vertices the required polygon complexity is unbounded.


Introduction
Representing graphs by intersections or contacts of geometric objects has a long history in graph theory and graph drawing, which is covered in monographs and surveys [13,21].For example, Koebe's circle packing theorem from 1936 establishes that every planar graph has a contact representation by touching disks (and vice versa) [16]; more recently it was shown that every planar graph is the intersection graph of line segments [6].
In this paper we are interested in a special class of contact representations for plane graphs, namely hole-free side-contact representations using rectangles and rectilinear polygons.In a rectilinear representation of a plane graph G = (V, E) every vertex v ∈ V is represented as a simple rectilinear polygon P(v) and there is an edge e = uv ∈ E if and only if P(u) and P(v) have a non-trivial common boundary or contact path s(e) (i.e., length |s(e)| > 0).It is further required that the union v∈V P(v) forms a simple rectilinear polygon itself, i.e., there are no holes in the representation.A standard assumption, which we will make throughout this paper, is that G is an internally triangulated plane graph.This excludes the degenerated case of four polygons that meet in a single point.A rectangular dual [17] of a graph G is a dissection of a rectangle into rectangles, which represents G as a contact graph; rectangular duals are thus an interesting special case of rectilinear representations, where all polygons and their union are rectangles.Rectangular duals and rectilinear representations with low-complexity polygons have practical applications, e.g., in VLSI design, cartography, or floor planning and surveillance in buildings [22].In these applications, the area of vertex polygons and/or the boundary length of adjacent polygons often play an important role, e.g., in building surveillance polygon area is linked to the number of persons in a room and boundary length represents the number of transitions from one room to the next.This and similar examples immediately raise the question of representing a given weighted graph so that the weights control areas and lengths in a contact representation.
Previously, rectilinear representations and rectangular duals have been studied only for unweighted graphs [17,19] and vertex-weighted graphs [2,3,10], where the polygon areas must be proportional to the vertex weights.This paper covers the remaining open aspect of representing edge-weighted graphs as touching rectilinear polygons.A natural way of encoding edge weights in a rectilinear representation is to require that the contact lengths of all adjacent vertex polygons are proportional to the given edge weights.So we define an edge-proportional rectilinear representation (EPRR) of an edge-weighted graph (G, ω : E → R + ) as a rectilinear representation in which additionally the contact length |s(e)| = ω(e) for every edge e ∈ E.
Related work.It is known that unweighted graphs always have a rectilinear representation using rectangles, L-shaped and T-shaped polygons, i.e., at most 8-gons, and that there are some graphs for which complexity 8 is necessary [19,26].The class of unweighted graphs that have a rectangular dual is characterized as all plane triangulations without separating triangles [17,18].Orientation-constrained rectangular duals have also been considered [10].
For vertex-weighted graphs the goal is to find area-proportional rectilinear representations, in which the area of a polygon P(v) is proportional to the weight of vertex v.In JGAA, 17(4) 441-473 (2013) 443 a series of papers the polygon complexity that is sufficient to realize any weighted graph was decreased from 40 corners [7] over 34 corners [14], 12 corners [4], 10 corners [1] down to 8 corners [2], which is best possible due to the earlier lower bound of 8 [26].Weighted rectangular duals have also been studied before, e.g., van Kreveld and Speckmann [25] presented several algorithms to compute rectangular duals with low area error.Eppstein et al. [10] gave a necessary and sufficient condition for rectangular duals to be area-universal, i.e., rectangular duals that can realize arbitrary vertex weights without changing their combinatorial structure.They also showed that, for a given combinatorial structure of the dual and given vertex weights, it can be efficiently tested whether these weights can be represented as the perimeters of the vertex rectangles rather than their areas.Biedl and Genc [3] showed that testing whether a rectangular representation with prescribed areas exists is NP-hard if the complexity of the outer face is unbounded.
Drawing planar graphs with edge weights as standard node-link diagram, where edge lengths are proportional to the edge weights, is an NP-hard problem [9] but can be decided in linear time for planar 3-connected triangulations [5].
Contribution.In Section 2 we consider rectangular duals.We present a linear-time algorithm that decides whether a given graph G has an edge-proportional rectangular dual (EPRD) with four outer rectangles and constructs it in the positive case.However, if G has arbitrarily many outer vertices, it can have exponentially many EPRDs, and it is NP-complete to decide whether there exists one such dual that forms a square.Moreover, if the combinatorial structure, i.e., the orientation of each edge of the dual, is specified, we use existing tools to find a rectangular dual where |s(e)| ≥ ω(e) for all e ∈ E and the size, i.e., the area or perimeter, of the outer rectangle is minimum.On the other hand, without a fixed combinatorial structure, we prove NP-completeness of the problem to find a representation where the lengths of the contact segments are lower and upper bounded.We also show that finding optimal duals for given lower bounds on |s(e)| under various criteria over all combinatorial structures is NP-complete.
In Section 3, we consider edge-proportional rectilinear representations and show that for representing outerplanar graphs polygon complexity 8 is sometimes necessary and always sufficient.The class of outerpillars (outerplanar graphs whose weak dual is a caterpillar, i.e., a tree for which a path remains after removing all leaves) always has edge-proportional rectilinear representations of complexity 6, but already outerlobsters (outerplanar graphs whose weak dual is a lobster, i.e., a tree for which a caterpillar remains after removing all leaves) require complexity 8. If, on the other hand, the graph has two adjacent or multiple non-adjacent internal vertices, polygons of unbounded complexity are sometimes necessary.This completely characterizes the complexity of edge-proportional rectilinear representations for internally triangulated graphs.

Rectangular duals with contact length specifications
In this section we consider rectangular duals of edge-weighted planar graphs.In Section 2.1 we study duals with fixed contact lengths (EPRDs).In Section 2.2 we investigate the problem of finding optimal duals, i.e., duals with minimum width, height and area, for lower-bounded contact lengths and fixed combinatorial structure.In Section 2.3 we show that for specified lower and upper bounds on contact lengths and variable combinatorial structure it is NP-complete to decide the existence of a suitable rectangular dual.Finally, in Section 2.4, we show that finding optimal duals with lowerbounded contact lengths over all possible combinatorial structures is NP-complete.

Rectangular duals with fixed contact lengths
In the first part of this section, we present a linear-time decision and construction algorithm for edge-proportional rectangular duals (EPRDs) with four outer rectangles.In the second part, we show that if arbitrarily many outer rectangles are allowed, the number of EPRDs might be exponential, and finding an EPRD that forms a square is NP-complete.

Four outer rectangles
He [12] proved that a planar graph G has a rectangular dual with four rectangles on the boundary if and only if (1) every interior face of G is a triangle and the outer face is a quadrangle, and (2) G has no separating triangles.We call a graph satisfying these conditions properly triangular planar (PTP).Moreover, we denote the four vertices on the boundary of the outer face by v N , v W , v S and v E in counterclockwise order.
A rectangular dual R of a PTP graph G = (V, E) defines an orientation and a partition of the internal edges of G into two sets T 1 and T 2 .The set T 1 contains the edges e for which s(e) is horizonal, the remaining edges are in T 2 .The orientation is obtained by For a vertex v and one of the partitions T i , i = 1, 2, we denote by T ← i (v) and T → i (v) the incoming and outgoing edges of v that are contained in T i , respectively.Note that for a specified botommost rectangle the orientation can be uniquely derived from the partition [11].The orientation and partition then satisfies the following properties.
1.For each vertex v, a counterclockwise enumeration of its incident edges starting with the rightmost edge in , respectively.We call any partition and orientation of the edges satisfying these properties a regular edge labeling (REL).In his work, He [12] showed that every PTP graph admits a REL, and that a corresponding rectangular dual can be constructed from a REL in linear time.
It is not hard to see that a REL derived from an edge-proportional rectangular dual has additional properties, following from the fact that for each rectangle the total length of the contacts on the left and right side as well as on the top and bottom side are the same, respectively. ω(e).
(1) Prior to the insertion of the next inner rectangle there is always a U-shape for which there exists a vertex whose corresponding rectangle needs to be inserted at the lower left corner of the U-shape in a unique way.
We call any REL satisfying this condition an edge proportional REL (EPREL).In the following we show that a weighted PTP graph G = (V, E) has a unique EPREL, if one exists.Moreover, we show how to test the existence of such an EPREL in linear time and how to construct a corresponding edge-proportional rectangular dual.

Lemma 1 For an inner vertex v, any one of the sets T
of an edge-proportional REL completely fixes the orientation and the partition of the edges incident to v. A corresponding orientation and partition can be found in O(deg(v)) time if it exists.
Due to the requirement of the REL for the ordering of the edges around v, there is at most one way to orient and partition the edges incident to v such that condition (1) holds.It can be found in O(deg(v)) time by a simple counterclockwise traversal of the edges incident to v, starting from the last edge in the known set T ← 1 (v).
Observe that if the partition and orientation of the edges incident to a vertex v is determined, the shape of the rectangle representing v is completely fixed.Moreover, the conditions on the edges incident to v N , v W , v S and v E completely specify a rectangle R I into which the remaining rectangles have to be inserted.We construct an ordering of the internal vertices v 1 , . . ., v n−4 such that we can iteratively apply Lemma 1 to determine uniquely the shape of their rectangle as well as the position where they have to be inserted in R I .Since we are completely guided by necessary conditions, this either results in a correct edge-proportional rectangular dual, or the procedure fails at some point, in which case an edge-proportional rectangular dual does not exist.
We maintain the following invariants in each step i.
2. All contacts between already inserted rectangles or the boundary polygon R I have correct lengths.

The upper boundary of the polygon
Note that initially i = 0 and all properties hold.By the third property there exists a Ushape on the upper boundary whose bottom side is horizontal, i.e., there are two vertical segments adjacent to and above the bottom side.Let u be the lowest rectangle bounding this U-shape from the left and let u 1 , . . ., u k denote the rectangles bounding the U-shape from below; see Fig. 1.The corner at R(u) and R(u 1 ) implies that if G admits an edgeproportional rectangular dual, then there exists a unique vertex v that is not yet inserted, and that is incident to both u and u 1 .We choose this vertex as the next vertex v i .Its adjacencies to the vertices u 1 , . . ., u j for some j ≤ k completely determine its contacts from below, and hence T ← 1 (v).By Lemma 1 its shape is completely determined.Moreover, the position is fixed as well due to the corner between R(u) and R(u 1 ).This implies Invariant 1. Invariant 2 is either satisfied or an edge-proportional rectangular dual does not exist since we only followed necessary conditions.Finally, Invariant 3 holds due to the choice of the U-shape.The whole algorithm can be implemented to run in linear time.
Theorem 1 For an edge-weighted PTP graph G there exists at most one edge-proportional rectangular dual.It can be computed in linear time if it exists.
Proof: The correctness is already shown, it remains to deal with the running time.The main issues are to a) quickly find a suitable U-shape b) find a corresponding vertex v that can be inserted and c) check whether the insertion produces only correct adjacencies.
For b) and c), observe that given the adjacent vertices u and u 1 of a U-shape as in Fig. 1, the vertex v must belong to the unique triangular face of G containing the edge uu 1 and a not-yet inserted vertex.Therefore, given u and u 1 , v can be found in O(1) time.Determining the shape of R(v) with Lemma 1 takes O(deg(v)) time.If the test in Lemma 1 fails, the algorithm terminates and reports that no edge-proportional rectangular dual of G exists.One can test in time proportional to the number of contacts of R(v) to previously inserted rectangles, whether they all correspond to edges of G.This takes O(deg(v)) time if the test is successful and at most O(|V |) time if the test fails, but then the algorithm stops.
For a), we store the rectangles that have been inserted, but are not yet covered, in a doubly linked list, sorted from left to right.Each concave bend ( or ) in the upper contour of the inserted rectangles is a candidate for a left or right boundary of a U-shape as shown in Fig. 1.These candidates are stored as tuples (u, v) or (u, v) for a pair of rectangles R(u), R(v) with a collinear vertical boundary, such that R(u) is to the left of R(v).Each candidate stores the pointers to both of its rectangles.
We store the candidates in a doubly linked list L, sorted by the x-coordinates of the common vertical boundaries of the associated rectangles.Each U-shape appearing during the insertion is characterized by a consecutive -pair of candidates.After the insertion of a new rectangle, at most two new candidates arise, at most two disappear, and L can be updated in O(1) time.The arising -pairs in L that form a U-shape can be found in O(1) time and are pushed onto a stack S, which is used to pick the next U-shape.Since this stack does not become empty before the last step, a Ushape suitable for insertion can be found in O

Many outer rectangles
In the previous section, each of the four outer rectangles formed an entire side of the rectangle R I into which all inner rectangles had to be inserted.Due to this fact, the orientation of each segment forming the boundary of R I was fixed.For example, the left boundary of R I was formed by the segments corresponding to the inner edges incident to v W etc. This is no longer the case if we allow more then four outer rectangles.The left boundary of R I can now be formed by segments which belong to several outer rectangles.Since the lengths of the edges on the boundary of the dual are unspecified, neither are the shapes of the outer rectangles.Thus the orientations of the boundary segments of R I are no longer unique, which introduces a degree of freedom that makes the problem hard.In fact, now there can exist an exponential number of possible realizations, and optimizing over all of them is NP-complete, even if we fix the four corners of the dual: Theorem 2 Given an inner-triangulated edge-weighted plane graph G = (V, E, ω) without separating triangles and four or more outer vertices including v ll , v lr , v ur and v ul , it is NP-complete to decide whether there exists an edge-proportional rectangular dual R such that R forms a square whose lower left, lower right, upper left and upper right corner rectangles are R(v ll ), R(v lr ), R(v ul ) and R(v ur ), respectively.
The proof is a reduction from the NP-complete problem PARTITION: given positive integers a 1 , . . ., a m , decide whether there exists a subset P ⊆ {1, . . ., m}, such that ∑ i∈P a i = 1 2 ∑ m i=1 a i =: σ .In our reduction proof, for a given PARTITION instance, we shall define an innertriangulated edge-weighted plane graph G m = (V, E, ω) and prove that it has a square rectangular dual with specified contact lengths if and only if the PARTITION instance has a solution.We first show how to build G m for an arbitrary m.For now, we ignore edge weights.It is easier to describe G m by a corresponding rectangular dual R m ; see Figure 2a.It is formed by 2m + 3 rows of rectangles.Every odd row starts and ends with a 2 × 1 rectangle and has 2m − 1 rectangles of dimension 3 × 1 in between.Rows 2 and 2m + 2 contain 4m + 1 rectangles with dimensions 1 × 1 and 2 × 1 placed in alternating order from left to right starting and ending with a 1 × 1 square.The remaining even rows contain 2m + 1 rectangles with dimensions 1 × 3 and 5 × 3 placed in alternating order from left to right starting and ending with a 1 × 3 rectangle.Obviously, G m is inner triangulated and has no separating triangles.For ease of notation, we shall refer to vertex v ∈ V by integer coordinates (x, y) if the corresponding rectangle R(v) is the xth rectangle in row y in R m .The vertices (1, 1), (2m + 1, 1), (2m + 1, 2m + 3), (1, 2m + 3) are selected as respective corners.
We define some special outer vertices: for j = 1, . . ., m, let s j denote the vertex (2 j, 1), n j the vertex (2(m − j) + 2, 2m + 3), w j the vertex (1, 2 j + 1) and e j the vertex (2m + 1, 2(m − j) + 3); see Figure 2a.We also define a subset F ⊆ V (gray rectangles in Figure 2a): in each even row and also in the first and last row of R m , each rectangle in an odd position corresponds to a vertex in F and each rectangle in an even position to a vertex in V \ F. In all the remaining rows, each rectangle in an even position corresponds to a vertex in F and each rectangle in an odd position to a vertex in V \ F.
We now describe the edge weight assignment ω.For each vertex s j , e j , n j and w j , j = 1, . . ., m, we set the weights of the five incident edges to 1, a j , 1, a j , 1 (in circular order, such that both outer edges have weight 1).From the specified contact lengths it follows that each such outer vertex has exactly two possible realizations in an EPRD: rectangles R(s j ) and R(n j ) are either 1 × (1 + a j ) or (2a j + 1) × 1 and rectangles R(w j ) and R(e j ) are either 1 × (2a j + 1) or (1 + a j ) × 1.We call the second and fourth edge of such a vertex flippable, and the corresponding contacts can be either both horizontal or vertical.We shall use these choices to encode to which partition the element a j is assigned to. Figure 3 shows layouts of G 3 corresponding to each possible partition of {2, 5, 7}.
For each j = 1, . . ., m, we define a set of edges E j ∈ E that forms a cycle in G m .To define E j , we start at w j and follow its lower flippable edge.Then, at each inner vertex we follow the edge opposite to the previous one taken (note that all inner vertices of G m have even degree).As we proceed, the first coordinate of visited vertices increases by 1 and the second decreases by 1 until we reach the third row at the vertex (2 j − 1, 3).We proceed to the vertex (4 j − 2, 2) and then reach s j via its left flippable edge.We continue the cycle E j in a similar manner: we leave s j via its right flippable edge and follow opposite edges (after we pass the third row, both coordinates increase by 1) until we reach e j via its lower flippable edge.We proceed analogously via n j and finally return to w j via its upper flippable edge.Figure 2b shows all such cycles for m = 4.Using some simple calculations on the coordinates of the vertices lying on the cycles E j , we can prove the following facts: (1) each E j is a simple cycle; (2) each edge uv with u, v ∈ V \ F belongs to exactly one E j , and each E j contains only such edges between vertices in V \ F; (3) each vertex of degree 8 in G m lies on exactly two cycles E i and E j ; all remaining vertices in V \ F lie on exactly one cycle.
We can now present the complete edge weight assignment ω.For an edge e = uv ∈ E with u or v in F we set its weight ω(e) to either 1 or 3 according to the length of the corresponding contact in the dual R m shown in Figure 2a.Each remaining edge e ∈ E lies on exactly one cycle E j .We set ω(e) = a j .This assignment has the following effect on possible realizations of inner rectangles.
Let v ∈ V be an inner vertex of G m .By construction, v has even degree, and each pair of opposing edges incident to v has the same weight.Then, every two contacts corresponding to such a pair of opposing edges must lie on opposite sides of the rectangle R(v).Each inner vertex v ∈ V \ F on a cycle E j has one pair of opposing incident edges both lying on E j .Thus, the corresponding contacts of length a j must lie on opposite sides of the rectangle R(v).This also holds for flippable edges incident to s j , e j , n j and w j .It follows that all contacts corresponding to edges on E j must have the same orientation.
Proof of Theorem 2: Let a 1 , . . ., a m be an instance of PARTITION.The graph G m has O(m 2 ) vertices and can be constructed in time polynomial in m as described above.Assume there exists an edge-proportional rectangular dual R of G m that forms a square.We define The width of R is 4 + 3(m − 1) + m + 2 ∑ j∈P a j and the height is 4 + 3(m − 1) + m + 2 ∑ j∈{1,...,m}\P a j .Since R is a square, P solves the PARTITION instance.Now let P be a solution of the PARTITION instance.We extend G m to an edgeweighted PTP graph G m by adding four outer vertices v W , v S , v E and v N .We connect all vertices whose rectangle in R m lies on the left boundary to v W , those on the lower boundary to v S etc.For such a new edge e incident to a vertex v ∈ F we set ω(e) to 1, 2 or 3 according to the length of the corresponding boundary segment of the gray rectangle R(v) in Figure 2.For a new edge e incident to a vertex v / ∈ F we set ω(e) as follows: if v has been on the lower or upper boundary, i.e., v ∈ {n j , s j } for some j = 1, . . ., m, we set ω(e) = 2a j + 1 if j ∈ P and ω(e) = 1 if j / ∈ P. If v has been on the left or right boundary, i.e. v ∈ {w j , e j } for some j = 1, . . ., m, we set ω(e) = 2a j + 1 if j / ∈ P, and ω(e) = 1 if j ∈ P. We now color the edges of the PTP graph G m : if an edge e is incident to a vertex v ∈ F, we color e red if the corresponding segment s(e) lies on the upper or lower boundary of the gray rectangle R(v) and blue otherwise.For an edge e ∈ E j , we color e red if j ∈ P and blue otherwise.All edges incident to v S and v N are colored red, and all edges incident to v W and v E blue.By considering all types of vertices in G m , it can be easily verified that this coloring partitions incident edges of each inner vertex into four non-empty contiguous subsets of alternating colors.This induces an undirected REL of G m .Fusy [11] showed that there is a bijection between directed and undirected RELs that preserves the coloring.Also, for each vertex, the two red subsets of edges have the same total weight, and so do the two blue subsets.Thus, there exists an edge-proportional REL of G m .As will be shown in the next subsection (see Corollary 2), it follows that G m has an edge-proportional rectangular dual R, such that red edges of G m correspond to horizontal contacts in R and blue to vertical.Since P solves the PARTITION instance, the inner rectangles in R must form a square.
This decision problem is contained in N P: we can guess an orientation for each contact corresponding to an edge e ∈ E of the given graph G = (V, E).Then we can check whether it induces an edge-proportional rectangular dual of G that forms a square with given corners in linear time, e.g. using an insertion algorithm similar to the one in the previous subsection.
Theorem 2 implies that minimizing the aspect ratio and maximizing the area of an edge-proportional rectangular dual are difficult.
Corollary 1 Maximizing the area and minimizing the aspect ratio of a rectangular dual with given contact lengths and unspecified contact orientations is NP-hard.

Rectangular duals with minimum contact lengths
Next we consider a slightly relaxed version of the problem, where we assume that the input consists of a REL, which combinatorially describes the rectangular dual, and a weight function specifying minimum contact lengths for all edges.The task is then to find a rectangular dual according to the given REL that minimizes the total size of the layout.Note that in this setting any instance is feasible since any given rectangular dual can be scaled to become a feasible solution.
Using the method of He [12] we can construct in linear time a rectangular dual R of the PTP graph G that realizes the given REL, but does not yet satisfy the edgelength constraints.We can either modify He's algorithm to directly compute a suitable rectangular dual in linear time, or take a slightly different perspective on the problem.The rectangular dual R of G can also be seen as an orthogonal representation with rectangular faces of the dual graph G of G, where every degree-3 vertex corresponds to a face of G and every orthogonally drawn edge corresponds to two adjacent faces.This allows us to use a modified version of a linear-time compaction algorithm for orthogonal drawings [8,Chapter 5.4] that respects the minimum contact length ω(e) for each e ∈ E as the minimum length of the corresponding dual edge e .The main idea of the approach is to define two independent planar edge-weighted st-graphs N hor and N ver , the first one using the edges in T 1 , the other one the edges in T 2 .Tamassia [24] described an algorithm to compute two weighted topological numberings on N hor and N ver from which the coordinates of all vertices of R (or G ) can be obtained.These numberings immediately minimize the total height, total width and area of R subject to the length constraints.
Theorem 3 For a weighted PTP graph (G, ω) with a given REL, a corresponding rectangular dual with minimum width, height, and area of the inner rectangles can be computed in linear time such that each edge e is represented by a contact of length at least ω(e).
In particular, if the given REL is edge-proportional, the algorithm computes an edgeproportional rectangular dual.Conversely, an edge-proportional rectangular dual directly induces an edge-proportional REL.
Corollary 2 A weighted PTP graph admits an edge-proportional REL if and only if it admits an edge-proportional rectangular dual.

Rectangular duals with minimum and maximum contact lengths and variable REL
Unlike in the case of precisely specified contact lengths (and no REL specification) or lower-bounded contact lengths with fixed REL covered in the previous sections, it becomes NP-hard to decide the existence of a rectangular dual if no REL is specified and we are given lower and upper bounds for the contact lengths that must be respected.Note that if the REL is fixed, the same problem can be solved in polynomial time, e.g. by linear programming or by adding upper edge capacities to the MinCost Flow approach in [8,Chapter 5.4].
The proof is a gadget proof reducing from the NP-complete problem PLANAR 3SAT [20].PLANAR 3SAT is the satisfiability problem for Boolean formulae φ in conjunctive normal form with at most three variables per clause, which are planar in the sense that the induced bipartite variable-clause graph H φ consisting of a vertex for every variable, a vertex for every clause, and an edge for every occurrence of a variable in a clause, is planar.Such a graph H φ can be drawn on a grid of polynomial size with all variable vertices placed on a horizontal line and the clause vertices connected in a comb-shaped manner from above or below that line [15].In our reduction, we create an edge-weighted PTP graph G φ for a PLANAR 3SAT formula φ , which has a rectangular dual (mimicking the above mentioned drawing of H φ ) if and only if φ is satisfiable.In the next three subsections we describe how to construct G φ in detail: for each component type of the variable-clause graph H φ like variables, pipes and clauses we present corresponding edge-weighted subgraphs of G φ and their realizations as rectangular layouts with suitable contact lengths.We show that all realizations are unique up to truth values of the associated variables of φ .Finally, we use this fact to show that rectangular layouts of G φ with suitable contact lengths correspond to satisfying assignments of φ , and vice versa.

Variables and pipes
The basic building block for the variable gadgets and their links to the clause gadgets is a 5-vertex graph (type-2 gadget) flanked by three auxiliary isomorphic 7-vertex graphs (type-1 gadgets), see Figure 4.The important property of this subgraph is that it has only two valid realizations as a rectangle contact graph, one of which encodes the value true, the other one the value false, and both of which have the same outer shape.We shall show that any other attempt to realize this subgraph violates either the edge length constraints or requires non-rectangular vertex regions.We now describe both gadgets in detail.We say that an edge e has weight x if α(e) = β (e) = x and weight x : y if α(e) = x and β (e) = y.
A type-1 gadget is a 6-cycle with one inner vertex, see Figure 5.Let a, b, c, d, e and f be the outer vertices ordered counterclockwise around the inner vertex g.Each outer vertex has degree 5 in G φ .Let the edge weights α and β be set as in Figure 5.This edge weight assignment has the following effect on the dimensions of the rectangles: each of the rectangles R(a), R(b), R(c), R(d), R(e) and R( f ) must have dimensions 1 × 2 or 2 × 1, and R(g) must be a 1 × 3, 2 × 2 or 3 × 1 rectangle.This leads us to the only three possible realizations of a type-1 subgraph shown in Figure 5b, 5c and 5d (disregarding rotations).The same holds if we merge the two dashed edges with both weights 1 adjacent to the vertex b or e, respectively, to single edges with weight 2.
A type-2 gadget is a 4-cycle with one inner vertex, see Figure 6.Let h, i, j and k be the outer vertices ordered counterclockwise around the inner vertex .The rectangle R( ) must be a 1 × 1 square.According to the edge weight assignment, the rectangles R(h), R(i), R( j) and R(k) must have perimeters between 13 and 15.If the contacts corresponding to the four edges hi, i j, jk and kh have alternating orientations  To form a standard building block for our reduction proof, we shall connect a type-2 gadget to at least three type-1 gadgets, see Figure 4. Using additional vertices (like the purple vertex x in the figure) we can force the type-1 gadgets to be centered at the type-2 gadget they are connected to.In other words, only the middle case in Figure 4b should be possible.Due to the edge weights, the rectangle R(x) must have dimensions 3 × 1.The vertices a, c, d, f in Figure 4a have degree 5 in G φ .Therefore, the upper and lower boundaries of the corresponding green rectangles R(a), R(c), R(d), R( f ) must be completely covered by the purple 3 × 1 rectangles, so the layouts in Figure 4c are not possible.Thus, the left type-1 gadget forms a 3 × 5 rectangle centered vertically at the type-2 gadget.
We shall use two options for the dashed edges on the right of the subgraph in Figure 4b.In the first option, there are six dashed edges adjacent to k and j with weights 1, 1:2, 1, 1, 1:2, 1 (from top to bottom), see Figure 4b, left.In the second option, the dashed edges adjacent to k and j respectively are merged to a single edge with weight 3 : 4, see Figure 4b, right.In both cases, the total length of the contacts corresponding to the dashed edges is between 6 and 8.We shall make sure that this length is always at most 7.For example, this is the case when the dashed edges belong to another type-1 gadget to the right of the subgraph in Figure 4b.As we shall see later, this assumption also holds if we have other gadgets (an inverter or a replicator) on the right.Also, it always holds for the second option, because a single rectangle can only have contacts with total length at most 7 to a type-2 gadget.Since the dash-dotted edges in Figure 4b correspond to contacts of length 1, both the lower and the upper type-1 gadget must be 5 × 3 rectangles centered horizontally at the type-2 gadget.The only two possible layouts are shown in 4d.Let the left one encode the value true and the right one false.
Several copies of the building block can be attached to each other both vertically and horizontally so that the green 7-vertex subgraphs (type-1 gadgets) link two adjacent blue 5-vertex subgraphs (type-2 gadgets).This synchronizes the states of all blocks: either all linked blocks are in the true state or all are in the false state.This allows us to create horizontal variable gadgets with vertical branches leading towards the clause gadgets.We create 90 • pipe bends in the same way.Two different variable gadgets are separated by three buffer vertices (or rectangles) that do not link the gadget states while fixing relative positions of the gadgets, see Figure 7.

Inverters and replicators
For the reduction, we shall need the ability to invert the state of the incoming truth value.We shall achieve this by defining an inverter gadget, see Figure 8 The case in which R(c) is horizontal is symmetric.Due to an argument similar to the one for the building block in Figure 4, the purple rectangles force the inverter to be centered vertically at the type-2 gadget.Thus, we have exactly one realization of the inverter for each truth value of the connected variable, see Figure 8c.To unify our construction, we define replicator gadgets.These gadgets do not invert the truth value of a variable, but they have the same dimensions (6 × 7) as the inverters.The corresponding edge-weighted contact subgraph is depicted in Figure 9. Due to the specified edge weights, R(a), R(b), R(c), R(e), R( f ) and R(g) must be 1 × 2 or 2 × 1 rectangles, R(i) and R( j) must be 2 × 3 and R(d) and R(h) must be 3 × 1.Thus, we have exactly one realization for each truth value, see Figure 9b.

Clauses
It remains to describe the clause gadget, whose rectangular layout is shown in Figure 10.It takes three inputs, two from the left side and one from below or above depending on whether the clause gadget is placed above or below the variable row.Note that the input from below or above is duplicated.Each input port consists either of an inverter or a replicator gadget.The type of the port gadget depends not only on whether the literal in the clause is positive or negative, but also on the position of the port in the clause gadget: The top left and the bottom right ports use an inverter for a positive literal and a replicator for a negative one; the bottom left and top right ports use a replicator for a positive literal and an inverter for a negative one.This configuration has the following effect on the two core rectangles R(l) and R(r) of the clause gadget, whose contact length is bounded by α(lr) = 19 and β (lr) = 20.Every false literal stretches its adjacent rectangle R(l) or R(r) vertically by a length of 1 (in fact by a length of 2 for R(r) since the last literal is duplicated).If all literals are true then both R(l) and R(r) have height 19 and also |s(lr)| = 19.By inspecting all cases one can see that as long as one literal is true we have 19 ≤ |s(lr)| ≤ 20, but as soon as all three literals are false the contact length becomes |s(lr)| = 21 violating the specified upper bound.This is exactly the behavior needed for the clause gadget.

Putting all blocks together
All presented building blocks can be laid out on an orthogonal grid subdivided into 10 × 10 tiles (most of these tiles have a 7 × 7 block in one corner, see Figure 11, which shows the rectangular dual of the entire graph G φ for an example formula φ ).In order to create an actual PTP graph, the remaining gaps between the described gadgets must be filled by dummy rectangles, i.e., dummy vertices in G φ .This is always possible and can be done systematically.All building blocks, except for the clause gadget, have the same top-level structure: they are all formed by 7 × 7 blocks, with 3 × 5 blocks connected to their left and right and 5 × 3 blocks connected to their top and bottom.As can be verified in Figure 11, the clause gadgets are compatible with this pattern.
The remaining holes are filled with dummy rectangles with dimensions 7 × 7, 5 × 3, 3 × 5, 3 × 1 and 1 × 7 in a manner demonstrated in Figure 11.In the resulting layouts, no four rectangles meet in a single point.Thus, the contact graph G φ is inner triangulated.We add four outer vertices to make it PTP.The lower and upper bounds on the lengths of the contacts between dummy and non-dummy rectangles can be extracted from the presented gadget subgraphs (the corresponding edges are indicated as stubs in the drawings).For a contact s(e) between two dummy rectangles, we set the weights α(e) = β (e) to the desired length of the contact according to Figure 11.Note that for our proof we do not have to show that the dummy rectangles have unique realizations: it suffices to show that they can be used to fill the holes in the fixed "skeleton" of the rectangular dual formed by the gadgets (colored rectangles in Figure 11).
We use the presented gadgets to prove Theorem 4.
Proof of Theorem 4: Let φ be a PLANAR 3SAT formula.As mentioned above, the variable-clause graph H φ can be drawn on an orthogonal grid of size polynomial in the size of φ .Furthermore, the number of vertices in each gadget subgraph is O(1) or polynomial for the variable gadgets.Thus, the graph G φ can be constructed in JGAA, 17(4) 441-473 (2013) 459 polynomial time.As we have shown above, the positions of type-1 and type-2 gadgets in a layout whose contact lengths respect α and β are fixed, and the respective choice of realization depends only on the truth value of the corresponding variable.If φ is satisfiable, we choose realizations of the gadgets according to the truth value of the corresponding variable in a satisfying variable assignment.By the properties of the clause gadgets, all rectangles can be realized in a way that respects the prescribed bounds on the contact lengths.Thus, a suitable rectangular dual of G φ exists.Now let R be a rectangular dual of G φ that respects the bounds on the contact lengths specified by α and β .Then, in each clause gadget, the contact between the two yellow rectangles R(l) and R(r) must have length at most 20, so at least one of the connected type-2 gadgets must have the realization corresponding to the truth value true.Since all type-1 and type-2 gadgets connected to the same variable gadget are synchronized among each other, we can extract a satisfying truth value assignment for φ directly from R. This shows NP-hardness.
The decision problem is contained in N P. If we guess a REL of G which fixes the orientation of each contact, we can test the existence of a rectangular dual which respects α and β in polynomial time, e.g., using linear programming.
A variant of the problem with lower bounded contact lengths and upper bounded rectangle areas turns out to be NP-hard as well as the next theorem shows.
Theorem 5 Given a PTP graph G = (V, E) with an edge-weight function ω : E → R + and a vertex-weight function γ :

Sketch of the proof:
The proof is very similar to the proof of Theorem 4. See the diploma thesis of Roman Prutkin [23] for more details.Except for the clause gadget, we use the same gadgets.However, the uniqueness of the realization up to the truth value must now be forced by a suitable assignment of minimal contact lengths specified by ω and maximal rectangle areas specified by γ.These assignments can be defined according to the layouts in Figures 5 to 9. We omit detailed specifications of the weighted subgraphs at this point and present only the new clause gadget.
The clause gadget is shown in Figure 12.Note that the positions of type-1 and type-2 gadgets are fixed.The gadget takes three inputs: two from the left and one from below (if the clause lies above the variable row) or from above (if the clause lies below the variable row).At each input port we again place either an inverter or a replicator gadget.The upper left and the upper input port (if the clause lies below the variable row) use an inverter for a positive literal and a replicator for a negative one.The lower left and the lower input port (if the clause lies above the variable row) use a replicator for a positive literal and an inverter for a negative one.
This definition has the following effect on the area of the yellow rectangle R(x), which is upper-bounded by γ(x) = 220: The position of the left boundary of R(x) is fixed, and the coordinates of the upper, lower and right boundaries are determined by the truth value of the incoming variable, such that each false literal increases either the width or height of R(x) by 1.Thus, the area of R(x) is 231 > γ(x) only in the case when all three literals are false, and in all other seven cases it is at most 220 = γ(x).Now it is straightforward to adapt the proof of Theorem 4.
It is not obvious whether the problem is contained in N P. Unlike for the case in Theorem 4, it is unclear whether the decision problem in Theorem 5 can be solved in polynomial time for a fixed REL: a similar linear programming approach doesn't seem to work here, since the area constraints are non-linear and also not necessarily positive semidefinite.

Minimizing layout size for specified minimum contact lengths
In Section 2.2 we have demonstrated that for a given PTP graph G = (V, E), a fixed REL and lower bounds on the contact lengths specified by ω, a rectangular layout of minimum size can be found in linear time.In this section, we consider the problem of finding the smallest layout of G with respect to the lower bounds ω over all RELs of G. First, we shall consider area minimization and show the following theorem: Theorem 6 Given an edge-weighted PTP graph G = (V, E, ω) and a bound A ∈ Q + , it is NP-complete to decide whether a rectangular dual R = {R(v) | v ∈ V } exists such that the total area of R is at most A and for each edge e ∈ E the corresponding contact segment s(e) in R has length at least ω(e).
The proof is a reduction from the NP-hard problem PARTITION.Let a 1 , . . ., a m be an instance of PARTITION and σ := 1 2 ∑ m i=1 a i .We set ε = 1 4(2m+5) and a m+1 = ε.For our reduction proof, we define graphs G j , j = 1, . . ., m recursively; see Figure 13.The Graph G 1 is a 4-cycle s 1 , e 1 , n 1 , w 1 with the inner node s 0 .The edges w 1 s 1 and e 1 n 1 have weight a 1 ; see Figure 13a.Figure 13d shows how to construct G j+1 from G j .We insert G j into a 4-cycle s j+1 , e j+1 , n j+1 , w j+1 and connect s j+1 to s j and e j , then e j+1 to e j and n j , then n j+1 to n j and w j and, finally, w j+1 to w j and s j .For i = 1, . . ., j, edges w i s i and e i n i have weight a i , and all other edges in G j have weight ε.
From now on we shall consider only duals of G j in which R(s j ) is the lower left, R(w j ) the upper left, R(n j ) the upper right and R(e j ) the lower right rectangle.The graph G 1 has exactly two such duals; see Figure 13b and 13c.There are exactly two possible realizations of the four outer rectangles R(s j ), R(w j ), R(n j ) and R(e j ) of G j ; see Figure 13e and 13f.The gray rectangle in the figures is replaced by a suitable dual of G j−1 .Note that in Figure 13f this dual is rotated by 90 • clockwise compared to the layout in Figure 13e.Each dual of G j−1 can be extended to a dual of G j in exactly two ways.
Let R j be a rectangular dual of G j .We define Note that the contacts corresponding to edges w i s i , s i e i , e i n i , n i w i must have alternating orientations.The main idea of our reduction proof is to encode a partition by orientations of the contacts with minimum lengths a i , i = 1, . . ., m.The following lemma shows that each partition can be encoded by a dual of G m .We say that a rectangular dual R of G j with the lower left rectangle R(s j ), upper left rectangle R(w j ), upper right rectangle R(n j ) and lower right rectangle R(e j ) respects a partition P = (P H , P V ) of {1, . . ., j}, j Lemma 2 Consider a graph G j , 1 ≤ j ≤ m, and a partition P = (P H , P V ) of {1, . . ., j}, j ∈ P H .The following statement holds.(1) There exists a rectangular dual R that respects P. (2) Each dual R of G j that respects P has width and height at least respectively.(3) There exists a dual R j of G j with width w P and height h P that respects P.
Figure 14: The PTP graph G used for the proof of Theorem 6 and its rectangular dual.
Edges are labeled by their weights, unlabeled edges have weight ε.
Proof: We prove (1) first.The claim obviously holds for j = 1.Now let j ≥ 2, and assume the claim holds for j − 1.We consider two different cases.
Case 1: j − 1 ∈ P H .Then, we define P H = P H \ { j}, P V = P V and apply the claim inductively to P = (P H , P V ) and G j−1 .Thus, there exists a rectangular dual R of G j−1 that respects P .Therefore, H(R ) = P H = P H \ { j} and V (R ) = P V .Then, we obtain R with H(R) = P H and V (R) = P V by inserting R into the gray rectangle in Figure 13e.
Case 2: j − 1 ∈ P V .We define P H = P V , P V = P H \ { j} and apply the claim inductively to P = (P H , P V ) and G j−1 .Thus, there exists a rectangular dual R of G j−1 that respects P .Therefore, H(R ) = P H = P V and V (R ) = P H \ { j}.We obtain R with H(R) = P H and V (R) = P V by rotating R by 90 • clockwise and then inserting it into the gray rectangle in Figure 13f.
(2) The lower bounds on width and height can be easily verified.For each i ∈ H(R), the contacts corresponding to edges s i w i and n i e i are horizontal, as well as the contacts corresponding to s i e i and n i w i for i ∈ V (R).Their projections onto the x-axis do not overlap in the interior, hence the lower bound on the total width holds.A similar argument holds for the height.
(3) With the tools from Section 2.2 we can construct a dual R j that respects P with width w P and height h P .
The PTP graph G = (V, E) used for the reduction is depicted in Figure 14.We define The figure shows how the four outer vertices v S , v E , v N , v W are connected to the vertices s m+1 , e m+1 , n m+1 and w m+1 .The weights of the corresponding edges are chosen in a way such that in each rectangular dual R of G both the total width and height of the inner rectangles are at least M + 2ε.If they are both exactly M + 2ε, then R induces a rectangular dual R m of G m with height and width at most M; see the gray rectangle in Figure 14.We can now prove Theorem 6.

Proof of Theorem 6:
We set A = (M + 4ε) 2 = (2σ + (2m + 5)ε) 2 = (2σ + 1 4 ) 2 .First, assume there exists a solution P of the PARTITION instance a 1 , . . ., a m and P = (P, {1, . . ., m} \ P).Without loss of generality, let m ∈ P.Then, according to Lemma 2, there exists a rectangular dual R m of G m with H(R m ) = P with width w P ≤ 2σ + (2m + 1)ε = M and height h P ≤ 2σ + (2m + 1)ε = M.The dual R m can then be extended to a rectangular dual R of G with height and with at most M + 4ε and total area A.
Now assume the PARTITION instance has no solution.Since each rectangular dual R m induces a partition of {1, . . ., m} by H(R m ), it has height or width at least 2σ + 1.Therefore, each rectangular dual R of G either has width at least 2σ + 1 and height at least M, or vice versa.Thus, its area is at least M(2σ + 1) ≥ 2σ (2σ + 1) > (2σ + 1 4 ) 2 = A. The graph G can be constructed in time polynomial in m.This proves NP-hardness in Theorem 6.
The decision problem is contained in N P. If we guess an orientation for each contact in a rectangular dual of G, we can construct a dual R that respects ω and has minimum width and height in linear time using tools from Section 2.2.
With similar gadgets we can show that minimizing the perimeter, max(width, height) or the total edge length of a rectangular dual of a PTP graph G with respect to specified lower bounds on the contact lengths ω over all RELs of G is NP-complete: Theorem 7 Given an edge-weighted PTP graph G = (V, E, ω) and a bound A ∈ Q + , it is NP-complete to decide whether a rectangular dual R = {R(v) | v ∈ V } exists such that the perimeter (or max(width, height), or the total edge length) of R is at most A and for each edge e ∈ E the corresponding contact segment s(e) in R has length at least ω(e).

Length-universal rectilinear layouts
In this section we consider the number of bends required for constructing edge-proportional rectilinear representations (or EPRRs for short) of internally triangulated planar graphs G = (V, E, ω).In our proofs we assume that the graphs are biconnected because every internally triangulated graph can be made biconnected by adding vertices in the outer face.Since our representations preserve the outerplanar embedding, the removal of the corresponding polygons does not create holes.
The complexity of a rectilinear polygon p is its number of bends, and is denoted by k(p).The complexity of an EPRR P is k(P) := max u∈V k(P(u)).The complexity of a graph G with weight function ω is k(G, ω) = min P∈P k(P), where P denotes all EPRRs of (G, ω).For a graph class G, the complexity is the maximum complexity for any graph from G with any weight function ω, i.e., k(G) = max G∈G max ω : E→R + k(G, ω).We are interested in determining k(G) for different classes of graphs.
Theorem 8 For any biconnected internally triangulated graph G with two adjacent internal vertices and any positive integer k 0 , there exists a weight function ω such that k(G, ω) ≥ k 0 .
Let I denote the class of biconnected internally triangulated graphs containing no adjacent internal vertices; we have k(I) ≥ k 0 for any positive integer k 0 .
Proof: For the first part of the theorem let G be a biconnected internally triangulated graph with two adjacent internal vertices u and v.We define ω such that ω(e) = 1 For the second part, consider the graph K 4 with internal vertex x, outer vertices a, b, c and all edge weights set to 1 except for ω(ax) = 2. Since ω(ax) ≥ ω(bx) + ω(cx) the path s(ax) must have a bend.Now consider a fan-graph on k 0 + 2 vertices with center vertex a, and insert into each fan triangle T a new internal vertex x T connected with edges of weight 2 to a and weight 1 to the other two vertices of T .By the above observation the polygon P(a) needs one bend per path s(ax T ) for all k 0 fan triangles T .This shows that to achieve positive results, we may allow only few isolated interior vertices.Thus we consider outerplanar graphs and graphs with one internal vertex.

Outerplanar graphs
In this subsection we study the complexity of edge-proportional rectilinear representations for internally triangulated outerplanar graphs.Proof: Consider the family of graphs depicted in Figure 15a.We show that if all thin edges have weight 1 and the thick edges have weight 4, then for d = 55, the corresponding weighted graph (G, ω) does not admit a representation with complexity less than 8. Assume for contradiction that P is a representation with complexity at most 6. (Note that the complexity of a rectilinear polygon is always even.) Claim: There exists a chain Q = {v i , . . ., v i+8 } such that the contacts between P(x) and P(v) with v ∈ Q all lie on a common line.
This follows easily from the fact that there are 55 vertices on the path v 1 , . . ., v d , and to avoid all such chains Q, P(x) would need to bend at least once every 9th contact.But then we get at least 55/9 = 7 bends on P(x).Claim: Let i and Q be chosen as in the previous claim, and without loss of generality assume that their contacts lie on a common horizontal line.Then for j = i + 3, . . ., i + 5, we have that P(v j ) has height more than 3. Assume for a contradiction that the height of P(v j ) is at most 3.Then, as P(v j ) has perimeter at least 2 • 4 + 5 = 13, it must be realized as an L-shape with an overhang of width at least 2, say to the left.It follows that P(v j−1 ) has height at most 1; see Fig. 15b.But then P(v j−2 ) has perimeter at most 4 as it is enclosed in a 1 × 1-box, a contradiction.The case that the overhang is to the right is symmetric.This proves the second claim.Now consider P(v i+4 ).Either its left or right side does not have a bend, and hence is a vertical segment of length at least 3. Without loss of generality assume that it is the right side.We then consider v i+4 and v i+5 , and their common neighbor r i+4 .The situation is depicted in Fig. 15c.The path s(r i+4 v i+5 ) has length 1, and thus bends at the reflex point of P(v i+5 ).Since both P(v i+4 ) and P(v i+5 ) have height at least 3 and P(r i+4 ) has perimeter 10, P(r i+4 ) needs two bends in order to achieve the correct contact lengths with both of them; a contradiction to the assumption that P has complexity 6.
On the other hand, we describe an algorithm that produces for any outerplanar graph G with weight function ω a representation with complexity 8. Proof: First, we make a given G ∈ O biconnected while keeping it outerplanar by adding dummy vertices, see Figure 17.Then, we show that for any biconnected outerplanar graph G = (V, E) with weight function ω and a reference edge e ∈ E on the outer face, there exists an edge-proportional rectilinear representation P such that for each edge uv on the outer face with uv = e, there exists a U-shape whose left and right boundary are formed by the polygons P(u) and P(v), whose open side points to the top, and whose width is at most ε/2, where ε is the smallest weight of all edges.
For a triangle uvw with reference edge uv this is obviously possible; see Fig. 16a.We construct the drawing inductively.Let G be an arbitrary graph with reference edge e.Since G is outerplanar and has more than three vertices, it has a degree-2 vertex w that is not adjacent to e.By induction G − w has a desired representation P with respect to the reference edge e.Let u and v denote the two neighbors of w, which are connected by an edge on the outer face of G − w.Note that the presence of edge uv implies that G − w remains biconnected.By the properties of P, there is a U-shape for the edge uv.We then insert a new polygon P(w) into this U-shape as illustrated in Fig. 16b.Obviously, this preserves all invariants.
Propositions 1 and 2 imply that for the class O of outerplanar graphs, we have k(O) = 8.We remark that our technique for representing outerplanar graphs with 8-gons extends to graphs with a single internal vertex, by wrapping the drawing around this central vertex while creating the U-shapes for the outer edges.Moreover, in the outerplanar case, it is simultaneously possible to achieve given areas for all vertices by suitably stretching the polygons to satisfy the area demands.Next, we consider special cases and show that outerpaths (outerplanar graphs whose weak dual is a path) require six bends, and that six bends suffice for outerpillars.Proposition 3 For the class P of internally triangulated outerpaths k(P) ≥ 6.
Proof: We show that rectangles are not sufficient, even for outerpaths.Consider the fan-graph G on 17 vertices consisting of a path v 1 , . . ., v 16 , whose edge weights are 2, 1, 2, 2, 1, 2, . . ., 2, 1, 2, and a center vertex u that is connected to all vertices of the path by edges of weight 1. Assume for a contradiction that G admits an edge-proportional rectilinear representation by rectangles.Consider four vertices v i , v i+1 , v i+2 , v i+3 with contact lengths 2-1-2.We claim that P(u) has a bend for any such sequence.
Assume this is not the case, then all contact paths of v i , v i+1 , v i+2 and v i+3 with P(u) form adjacent, without loss of generality, horizontal segments.Each of these segments has length 1, and hence the widths of P(v i ), P(v i+1 ), P(v i+2 ) and P(v i+3 ) are fixed to 1.The remaining degree of freedom is to choose their heights.However, ω(v i v i+1 ) = 2 requires that P(v i ) and P(v i+1 ) have height at least 2, and the same argument applies for P(v i+2 ) and P(v i+3 ).However, ω(v i+1 v i+2 ) = 1 requires that the height of P(v i+1 ) or P(v i+2 ) is 1, a contradiction, and P(u) must have a bend during this sequence.Since there are five such sequences for i = 1, 4, 7, 10, 13, it follows that P(u) has at least six bends.
Proposition 4 For the class P of internally triangulated outerpillars k(P ) ≤ 6.
Proof: Let G be an outerpillar.As a first step, we pick the outerpath G ⊆ G that is obtained by removing all but the two outermost degree-2 vertices of G ; see Fig. 18.Let P be the path that is dual to G. The path P splits the boundary of the outer face of G into two paths π 1 = u 1 , . . ., u k and π 2 = v 1 , . . ., v that are internally disjoint, and that share exactly their endpoints, i.e., u 1 = v 1 and u k = v , both of which have degree 2 in G. Let H be larger than the maximum weight, and let W denote the total weight of all internal edges.Construct a 2H ×W box, split it horizontally into two boxes of size H ×W .We then split the upper box into k − 2 rectangles P(u 2 ), . . ., P(u k−1 ) such that the width of P(u i ) is the sum of the weights of all internal edges of G incident to u i .We split the lower box into boxes for v 2 , . . ., v −1 analogously; see Fig. 18.Observe that this ensures correct contact lengths for all internal edges of G. Next, we place rectangles for u 1 and u k as boxes to the left and right of the drawing such that they have the correct contact lengths.This ensures correct contact lengths except for internal vertices of π 1 and π 2 , respectively, that are adjacent.They touch in a segment of length H, which is too long.To remedy this, we remove for any such pair v i v i+1 occurring in this order on π 1 or π 2 a corner of the rectangle of v i+1 .This corner is chosen such that its width is at most half the smallest contact length, and such that afterwards |s(v i v i+1 )| = ω(v i v i+1 ).This finishes the construction for outerpaths.For the more general case of outerpillars observe that there is a small U-shaped gap between any adjacent pair of vertices on the outer face, and we can hence use the same approach as in the proof of Proposition 2 to attach further leaves to the central outerpath determined by the spine P. Note that the polygons can be stretched such that one contact has the correct length, so that only six bends are necessary.This completely characterizes the complexity of length-universal layouts for internally triangulated graphs.As we have seen outerplanar graphs whose dual is a caterpillar require complexity 6.The dual of the example graph showing that the 8 bends are necessary is a lobster.Hence our results are best possible.
One disadvantage is that our drawings have an outer face of high complexity.However, we can show that one cannot do better.If one limits the complexity of the outer face to some fixed number K, then there exist outerplanar graphs that require complexity k 0 for any positive integer k 0 > K.
Proposition 5 For every given k 0 , K ∈ N, k 0 , K ≥ 4, there exists an edge-weighted JGAA, 17(4) 441-473 (2013) 469 Proof: Consider the family of outerpaths G d in Figure 19a, which are triangle fans around the vertex u containing d − 1 triangles.We set M = 4k 0 and select the value of d to be 5 • (k 0 + K + 1) + 1. Assume there exists an edge-proportional rectilinear representation P with polygon complexity k(P) ≤ k 0 and at most K bends on the outer face.Then there must exist five consecutive neighbors v i , . . ., v i+4 of u, i ∈ {0, . . ., d −4}, such that: (1) the contacts between the polygons P(u) and P(v i ), . . ., P(u) and P(v i+4 ) lie on a single line 1 , and (2) the outer boundaries of the polygons P(v i ), . . ., P(v i+4 ) lie on a single line 2 ; see Figure 19b.Otherwise, any five consecutive neighbors v j , . . ., v j+4 would be responsible for at least one bend of the polygon P(u) or the outer contour P out .But then, the total number of bends of P(u) and P out would be at least d 5 − 1.Thus, it would hold k 0 + K ≥ d 5 − 1 and 5 • (k 0 + K + 1) ≥ d, a contradiction.Without loss of generality, let ω(v i v i+1 ) = 1 (otherwise, use i + 1 instead of i).Then it is also ω(v i+2 v i+3 ) = 1.Thus, the line 1 must be parallel to the line 2 , and the two lines have distance at most 1 to each other.Therefore, the contact s(v i+1 v i+2 ) between the polygons P(v i+1 ) and P(v i+2 ) must completely fit into a rectangle R of width 4 and height 1 (dotted blue rectangle in Figure 19b).Thus, P(v i+1 ) must have at least k 0 + 1 bends, a contradiction.

Graphs with one internal vertex
Next, we show that polygon complexity 8 also suffices to represent every inner triangulated graph with one inner vertex as an edge-proportional rectilinear representation.
Proposition 6 For the class I 1 of plane inner triangulated graphs with exactly one inner vertex k(I 1 ) ≤ 8.
Proof: Consider a graph G = (V, E, ω) ∈ I 1 .We make G biconnected by adding new vertices as described earlier.Let u be the only inner vertex in G, let d denote its degree, and let v 1 , . . ., v d be its neighbours in counterclockwise order.We set σ = 1 2 ∑ d i=1 ω(uv i ), Section 2.1.1.If arbitrarily many outer rectangles are allowed, it is NP-complete to decide whether an EPRD that forms a square exists; see Section 2.1.2.We have studied the problem of finding small rectangular duals for lower-bounded contact lengths.If the combinatorial structure (REL) of the dual is fixed, optimal duals can be constructed efficiently with existing tools; see Section 2.2.In Section 2.4, we have proved NPcompleteness for the case of variable RELs.Also, deciding the existence of a dual under specified lower and upper bounds on the contact lengths is NP-complete, and a similar decision problem is NP-hard for lower-bounded contact lengths and upper-bounded rectangle areas; see Section 2.3.Furthermore, in Section 3 we have considered edgeproportional rectilinear representations (EPRRs) of internally triangulated plane graphs and have given tight bounds on the necessary and sufficient polygon complexity.
Open problems.We have shown that edge-proportional rectilinear representations that have bounded polygon complexity for an arbitrary edge-weight function exist only for a rather restricted class of graphs.To extend the proposed approach to a wider class of graphs, we have to allow contact lengths that deviate from the specified edge weights.One option is to interpret the weights as lower bounds on the edge lengths (thus one could highlight a subsegment of optimal length for each edge) and construct a dual that minimizes the error.As we have shown, this problem is NP-complete for rectangular duals.It can be solved exactly using integer linear programming, but so far no efficient approximation algorithms are known.One could also study this problem for rectilinear polygons of complexity 6 and above.Other possible trade-offs between the error and representability of wider classes of graphs are of interest, too.
We have shown that the number of edge-proportional rectangular duals of a graph is sometimes exponential, and deciding whether there exists an EPRD that forms a square is NP-complete.Is it also hard to decide whether an EPRD exists at all?Another open question is whether, for a PTP graph with a fixed REL, we can efficiently decide the existence of a rectangular dual with lower-bounded contact lengths and upper-bounded rectangle areas.This would answer the question whether the same decision problem for variable RELs is contained in N P.
A very interesting challenge is to investigate the complexity of finding layouts with minimum size for the case that all contact lengths have lower bounds 1.We have shown NP-completeness for arbitrary edge weights only.In fact, the restriction to unit weights is equivalent to a long-standing open question posed by He [12]: Given a PTP graph G, find a rectangular dual of G that can be drawn with minimum area (or minimum perimeter, or minimum width) such that each contact has length at least 1.

Figure 1 :
Figure1: Prior to the insertion of the next inner rectangle there is always a U-shape for which there exists a vertex whose corresponding rectangle needs to be inserted at the lower left corner of the U-shape in a unique way.

( 1 )
time in each step.It follows that inserting a new rectangle R(v) takes time O(deg(v)), and hence the total running time is O(|E|) = O(|V |).

Theorem 4
Given a PTP graph G = (V, E) with two edge-weight functions α, β : E → R + with α(e) ≤ β (e) for all e ∈ E, it is NP-complete to decide if G has a rectangular dual R = {R(v) | v ∈ V } so that for every edge e ∈ E the contact segment s(e) has length α(e) ≤ |s(e)| ≤ β (e).

Figure 4 :Figure 5 :
Figure 4: The standard building block formed by a type-2 gadget and three type-1 gadgets.(a) Edge-weighted contact graph.Thick edges have weights α(e) = 1, β (e) = 2. (b) We make sure only the middle case is possible.Due to the purple dashed rectangles and the degrees of a and c, the layouts in (c) are not possible.The only two possible layouts are shown in (d).If the total length of the contacts corresponding to the dashed edges is at most 7, the contacts of length 1 corresponding to the dash-dotted edges force the lower and upper type-1 gadget to form 5 × 3 rectangles horizontally centered at the type-2 gadget.The left one encodes the value true and the right one false.

Figure 7 :
Figure 7: Two variable gadgets connected by buffer rectangles R(r), R(s), R(t).The relative positions of the gadgets are fixed and form a single horizontal row.

Figure 8 :
Figure 8: (a) The inverter gadget subgraph.Thick edges have weight 1 : 2. (b) R(a) and R(c) must have different orientations.(c) The only two possible realizations.
. The rectangles R(a), R(b), R(c), R(i), R( j), R(k) must have dimensions 1 × 2 or 2 × 1, R( ) and R(m) must be 6 × 1 rectangles and R( f ) a 2 × 2 square.Both R(d) and R(h) are either 1 × 3 or 2 × 2. Furthermore, R(b) must be oriented vertically.Due to the shape of R(d), the rectangles R(a) and R(c) can not be vertical at the same time, so the total length of the contacts corresponding to dashed edges in Figure8bis at most 7.If R(d) is 2 × 2, both R(a) and R(c) must be oriented horizontally, see Figure8b.This is not possible, since each non-covered boundary piece of the blue rectangles in Figure8bmust have length 1.Thus, either R(a) or R(c), but not both, are oriented horizontally, and R(d) is a 1 × 3 rectangle.Due to the specified edge weights, the rectangles R(e) and R(g) are either 2 × 2, 3 × 1 or 4

Figure 10 :
Figure 10: (a) Clause gadget subgraph for the clause x ∨ y ∨ z and (b) the layout for the state x = 0, y = 1, z = 1.The contact length |s(lr)| of the two yellow rectangles R(l) and R(r) is 20.

Figure 12 :
Figure 12: Clause gadget for the proof of Theorem 5 for the clause x ∨ y ∨ z.Each false literal stretches either width or height of the yellow rectangle R(x) by 1.Thus, only in the case (c) for x = y = z = 0 its area exceeds γ(x) = 220.
for every edge e ∈ E the contact segment s(e) has length |s(e)| ≥ ω(e) and (ii) for every vertex v ∈ V the rectangle R(v) has area |R(v)| ≤ γ(v).

Figure 13 :
Figure 13: The recursively defined graphs G j , j = 1, . . ., m. Gray dashed edges do not belong to G j .Black unlabeled edges have weight ε. (a), (b), (c): Graph G 1 (black edges) and both its realizations.(d) Recursive construction of G j+1 from G j .(e), (f): Each dual of G j−1 can be extended to a dual of G j in exactly two ways.

Figure 15 :
Figure 15: A graph that does not admit an edge-proportional rectilinear representation with 6-gons for d = 55; thin edges have weight 1 and thick edges have weight 4.

Proposition 1
For the class O of biconnected internally triangulated outerplanar graphs k(O) ≥ 8.

Figure 16 :
Figure 16: Construction of a rectilinear representation by 8-gons for an outerplanar graph.(a) A triangle with reference edge e, forming the base case.(b) Inserting P(w) into the U-shape of uv (red), creating new U-shapes for uw and vw (green).

Proposition 2
For the class O of internally triangulated outerplanar graphs k(O) ≤ 8.

Figure 17 :
Figure 17: Edge-proportional rectilinear representation with 8-gons for outerplanar inner triangulated graphs with separating vertices.(a), (b): after inserting x and edges xw, xv, xu, vertex v is no longer separating.(c) We construct an EPRR with octagons; (d) then we delete P(x).

Figure 18 :
Figure 18: Construction of an edge-proportional rectilinear representation with 6-gons for outerpillars.Input graph with an outerpath subgraph, drawn with a thick boundary (left).An EPRR of the outerpath with U-shapes for the remaining vertices shown as tiled rectangles (right).

Figure 19 :
Figure 19: (a) Fan graph G d used in the proof of Proposition 5. Thick edges have weight M, thin non-dashed edges have weight 1.(b)