• Keine Ergebnisse gefunden

Rectilinear Drawings

Im Dokument Constrained Graph Drawing (Seite 66-73)

Angles and Distances

4.1 Rectilinear Drawings

The first problem we address is the following:

Orthogonal-order preserving rectilinear drawing problem:

Given a plane graph, we want to decide whether we can draw each edge either horizontally or vertically, without changing the horizontal or the vertical order of vertices while keeping all edge lengths positive.

The possible direction of an edge might depend on the direction of other edges. Figure 4.1 shows how an edge ei can determine the direction of an edge ej. More formal: We say an edge ei pulls another edge ej horizontally, if ej

lies completely within the x2-range of ei’s. Hence, to keep the vertical order of vertices,ej must be horizontal ifei is horizontal. This of course also means that ei cannot be drawn horizontally if ej is vertical, in which case we sayej pushes ei vertically. Analogously we say an edge ei pulls another edge ej vertically if ej lies within ei’s x1-range, and therefore also ej pushes ei horizontally. We use this to construct the main gadgets for theN P-hardness proof.

Consider a path P = (e1, e2, e3) of three edges as shown in Fig. 4.2, if there is a horizontal edge with one vertex in the x1-range of e1 and one vertex in the x1-range of e3, at least one of P’s edges must be drawn horizontally (see

(a) horizontal decision unit (b) vertical decision unit Figure 4.2: Decision units

(a) positive link (b) negative link

Figure 4.3: Possible linkslforei andej

Fig. 4.2(a)). We call the edges in P literal edges, the horizontal edge framing edge and the whole set a horizontal decision unit. A vertical decision unit is defined analogously and shown in Fig. 4.2(b). We use these decision units to represent 3-SAT clauses.

In Fig. 4.3 two edges ei 6=ej are linked by a third edge l 6=ei, ej. We call l thepositive link forei andej ifej pullslhorizontally andl pusheseihorizontally such that ei, ej and l are all horizontal if ej is horizontal (see Fig. 4.3(a)). Of course this also means that if ei is vertical, l and ej also must be vertical. A negative link is defined analogously and shown in Fig. 4.3(b). We will use these links to tie together edges corresponding to the same variable.

4.1.1 Unions of Paths

We now use the described edge-dependency elements to create a union of paths for a given instance of MONOTONE 3-SAT in order to prove the following theorem:

Theorem 10. The orthogonal-order preserving rectilinear drawing problem is N P-hard for unions of paths.

Figure 4.4: Union of paths for a MONOTONE 3-SAT-instanceI

For an instance I = (B, C) of MONOTONE 3-SAT, we create a union of paths as follows. Each variable in B has several corresponding edges that will have to be drawn horizontally (vertically) if and only if the corresponding vari-able is assignedtrue(false). For each positive clauseCi ∈Cwe place a horizontal decision unitU(Ci) and for each negative clause Cj ∈C a vertical decision unit U(Cj) with the literal edges on a diagonal line as shown in Fig. 4.4 such that initially the ordering constraints of each gadget are independent from those in other gadgets. The framing edges of the decision units can be placed on a hor-izontal and a vertical line near the borders of the drawing. The literal edges in the decision units correspond to the literals in the decision unit’s clause. We then place a variable path (e(b1), . . . , e(bn)) on the diagonal of the drawing with n edges corresponding to then variables inB. We add a positive and a negative link between each literal edge and the edge in the variable path corresponding to the same variable. Figure 4.4 shows a union of paths for the instance I with C1 = (x1∨x2∨xn), C2 = (x2∨xn−1∨xn), C3 = (x1∨x2∨xn), C4 = (x1∨x2∨xn−1).

Lemma 14. If the union of paths has a valid drawing, I is satisfiable.

Proof. Because of the links all edges corresponding to the same variable are drawn alike. We set a variable true if the corresponding edges are drawn hori-zontally and false if they are drawn vertically such that for a valid drawing all clauses are satisfied.

Lemma 15. If I is satisfiable, the union of paths has a valid drawing.

Proof. We draw all edges corresponding to a true variable horizontally and all edges corresponding to afalse variable vertically. Since there is atrue literal in any clause, a valid drawing for each decision units is induced.

4.1.2 Single Path

Theorem 11. The orthogonal-order preserving rectilinear drawing problem is N P-hard for paths.

To show N P-hardness also for paths we must connect the union of paths constructed in Sect. 4.1.1. We must add edges that do not have any effect on the drawability. We start with horizontal and vertical edges connecting the decision units and the links for different decision units (see Fig. 4.6). They have no effect on the drawability because edges which are already horizontal or vertical cannot pull other edges. Additionally, the horizontal and vertical edges we add do not lie in the range of any edge not yet horizontal or vertical and therefore cannot push other edges.

Links belonging to the same decision unit are also connected, but as con-nections might lie within the range of edges in the variable path, we can not use edges already horizontal or vertical. For two incident edges e0i and e0j in one decision unit and edgesei andej in the variable path corresponding to the same variables, let li and lj be the positive links. For ei and ej not incident, letlc be connecting the positive links. Figure 4.5 shows that even if e0i and e0j are drawn alike, edges lying between ei and ej in the variable path can be drawn in either direction.

Lemma 16. The connected path is drawable if and only if the union of paths was drawable.

Proof. The edges we used have a valid drawing, if the union of paths was draw-able. On the other hand, the edges in the union of paths are also kept in the connected path. Hence, if the union of paths had not been drawable, the path is not drawable.

(a) before (b) lc horizontal (c) ei. . . ej vertical Figure 4.5: lc is connectingli andlj

Figure 4.6: Single path for the instanceI

4.1.3 Totally Ordered Vertices

Different vertices having the same x1- or x2- coordinates are very restrictive if the task is to preserve the orthogonal order of vertices. If we further request that planarity is to be preserved, we can prove hardness also for unions of paths and paths with totally ordered vertices, i. e., no two vertices have the same x1 -orx2-coordinates.

A framing edge of a horizontal decision unit is horizontal, but we can replace it with a pair eh and ef of incident edges as shown in Fig. 4.7(a). ef lies in the x1-range of eh and eh in the x2-range of ef such that the only possibility for avoiding intersections is to draweh horizontally and ef vertically. Sinceeh must be drawn horizontally, at least one of the literal edges in the decision unit also must be drawn horizontally. In order to prevent ef from pulling any other edge vertically, we place ef’s vertex that is not incident to eh such that no vertex lies in thex1-range of ef. Because the framing edges of the decision units are placed near the borders of the drawing, we can easily guarantee that ef does not lie in thex2-range of any other edge, and thus cannot push other edges vertically. The strategy for the vertical decision units is the same and shown in Fig. 4.7(b). We also make sure that no two vertices of different positive links for the same edge in the variable path lie on the same vertical line, for example by making each positive link shorter than the one above it (likewise for negative links). Finally we have a union of paths with totally ordered vertices that is drawable if and only if I is satisfiable. (See Fig. 4.8(a)). For connecting the edges of the union of paths with totally ordered vertices we might also use edges that are not yet but can be drawn horizontally (or vertically) in the resulting path since there are no vertices within their x1- (or x2-ranges).

(a) eh andef (b) ev andef

Figure 4.7: Decision units without horizontal or vertical edges

(a) union of paths

(b) single path

Figure 4.8: Avoiding horizontal or vertical edges

e' e

Figure 4.9: Dependency of edges

Im Dokument Constrained Graph Drawing (Seite 66-73)