• Keine Ergebnisse gefunden

Arbitrary directions

Im Dokument Constrained Graph Drawing (Seite 90-99)

Angles and Distances

5.3 Arbitrary directions

5.3.1 Hardness in 2D

Theorem 19. The strictly monotone trajectory drawing problem is N P-hard in two dimensions, even for paths of length three.

We use a necessary and sufficient condition for two different paths on a set of four vertices to each be strictly monotone increasing in some direction. For a vertex v in a path P strictly monotone in some direction a there is a line l through v (perpendicular to a) such that the vertices of the different parts of

P (separated by v) are on different sides of l. Given four vertices c1, c2, v and v and the anchor paths P1 = (vc1c2v) and P2 = (vc2c1v). A line through ci

perpendicular to a possible direction for a path Pj is denoted by lij. A line l11

must havevandc2 on different sides so the set of possible lines forl11 is bounded by the lines through c1 and v and through c1 and c2. We call this set of lines I11. Other sets Iij are defined analogously.

Lemma 26 (necessity). The vertices v and v must lie on different sides of a line through c1 and c2.

Proof. The three verticesc1, c2 and v (v) can not be collinear since they can not be ordered such that there is both a line l1 through c1 and a line l2 through c2

with l1 having v (v) andc1 and l2 having v (v) and c2 on different sides.

For P1 being strictly monotone in some direction there must be a line from I21 havingv and v on different sides and for P2 being strictly monotone in some direction there must be a line from I12 having v and v on different sides. This does not leave any position forv on the same side of the line through c1 and c2

asv.

Lemma 27 (sufficiency). If the vertices v and v lie on different sides of a line through c1 and c2, each path is strictly monotone increasing in some direction.

Proof. Both I21 and I12 are bounded by the line through c1 and c2. Hence, for any position of v with v and v on different sides of the line through c1 and c2

there is a line from I21 and a line from I12 both having v and v on different sides.

We start with vertices c1, c2, t and f and anchor paths (tc1c2f) and (tc2c1f).

The line through c1 and c2 divides the plane into two sides. The verticest and f must be placed on different sides (Lemma 26) and we call the side on which t is placed true and the other one false. We say a vertex is true if it lies on the same side as t.

Let I = (V, C) be an instance of 3-SAT. For each variable we insert vertices v andv and the anchor paths (vc1c2v) and (vc2c1v). We say the variable istrue if v is true and false otherwise. For each clause we insert vertices l1, l1, l2, l2, l3

andl3 for the literals together with the corresponding anchor paths (lic1c2li) and (lic2c1li) for i= 1,2,3 to makeli and li lie on different sides of the linec1c2. If a literal (with vertices l and l) is a negated variable (with vertices v and v), we add variable paths (lc1c2v) and (lc2c1v) such that l and v lie on different sides, otherwise we add variable paths (lclc2v) and (lc2clv) to make v and l lie on the same side. We insert vertices o1 and o2 representing the ORs. We add clause paths (f c1c2o2) and (f c2c1o2) to make o2 true.

Figure 5.4: l1 andl2arefalse, which makesl3true.

To guarantee that o1 is false if bothl1 and l2 are false, we first add vertices l10 and l20 and clause paths (l2l1c2l20), (l2c2l1l02) and (l1l2c2l01), (l1c2l2l01) such that l2 and l20 lie on different sides of the line through l1 and c2 and that l1 and l01 lie on different sides of the line through l2 and c2. Adding clause paths (o1l1c2l20), (o1c2l1l20) and (o1l2c2l01), (o1c2l2l01) the vertex o1 must lie between the halfline fromc2 throughl1 and the halfline fromc2 through l2. With the same argument we make o2 lie between the halfline from c2 through l3 and the halfline from c2 through o1 by adding the vertices l03 and o01 and the clause paths (l3o1c2l30), (l3c2o1l30) and (o1l3c2o01), (o1c2l3o01) as well as (o2o1c2l30), (o2c2o1l30) and (o2l3c2o01), (o2c2l3o01). See Fig. 5.4 for an illustration.

Lemma 28. For each clause at least one literal vertex is true.

Proof. Ifl1 andl2arefalse,o1 is alsofalse. Witho2beingtrueand lying between the halflines fromc2 through l3 and fromc2 through o1, l3 must also betrue.

Corollary 6. I is satisfiable if the set of paths is drawable with each path strictly monotone in some direction.

Lemma 29. If I is satisfiable there is a valid drawing for the set of paths.

Proof. For a given assignment that satisfies I, we can draw the set of paths as follows: We place c1 and c2 with x1(c1), x1(c2) = 0, x2(c1) = 0 and x2(c2) 6= 0.

All other vertices we place on thex1-axis:

• If all literals are true,

x1(f) < x1(c1), x1(c2) < x1(o01) < x1(l3) < x1(o2) < x1(l01) < x1(l2) <

x1(o1)< x1(l03)< x1(l1)< x1(l20)< x1(t).

• If the first two literals are true and the third false,

x1(f) < x1(o01) < x1(l3) < x1(c1), x1(c2) < x1(o2) < x1(l01) < x1(l2) <

x1(o1)< x1(l03)< x1(l1)< x1(l20)< x1(t).

• If the first literal istrue and the others false,

x1(f) < x1(o01) < x1(l3) < x1(l01) < x1(l2) < x1(c1), x1(c2) < x1(o2) <

x1(o1)< x1(l03)< x1(l1)< x1(l20)< x1(t).

• If the first two literals are false, which makes the third be true, x1(f)< x1(l02)< x1(l1)< x1(l30)< x1(o1)< x1(l2)< x1(l10)<

x1(c1), x1(c2)< x1(o2)< x1(l3)< x1(o01)< x1(t).

• If the first literal isfalse and the others true,

x1(f) < x1(l20) < x1(l1) < x1(l03) < x1(o1) < x1(c1), x1(c2) < x1(l2) <

x1(l01)< x1(o2)< x1(l3)< x1(o01)< x1(t).

• The remaining cases are analogous.

Then we place each vertex v of a true variable such that x1(t) < x1(v) and for a false variable such that x1(v)< x1(f) to make all paths strictly monotone inx1- direction.

5.3.2 Hardness in 3D

Theorem 20. The strictly monotone trajectory drawing problem is N P-hard in three dimensions, even for paths of length four.

Similar to the proof in two dimensions we use a necessary and sufficient condition for three different paths on a set of five vertices, each being strictly monotone increasing in some direction. For a vertex v in a path P strictly monotone in directiona there is a plane E through v (perpendicular toa) such that the vertices of the different parts ofP (separated by v) are on different sides of E. Given three verticesc1, c2 and c3 and paths (c1c2c3), (c2c3c1) and (c3c1c2), the vertices c1, c2 and c3 cannot be collinear because there only exists a plane through the vertex lying in the middle with the other two vertices on different sides. For each vertex v we add another vertex v and paths P1 = (vc1c2c3v), P2 = (vc2c3c1v) and P3 = (vc3c1c2v).

We assume w.l.o.g. that x3(c1) = x3(c2) = x3(c3) = 0 and call the plane in which c1, c2 and c3 are lying E. The projection of a vertex v perpendicular to E into a plane E0 is denoted by vE0. We say a vertex v lies under (above) a plane E0 if it is x3(v) < x3(vE0) (x3(v) > x3(vE0)). A plane through ci perpendicular to a possible direction for the path Pj is denoted by Eij. The intersection line of two planes E0 and E is denoted by l(E0/E). The line l(E21/E) must have c1

and c3 on different sides so there is a set of possible intersection lines bounded by the lines through c2 and c1 and through c2 and c3. We call this area I21. A parallel of the line c1c3 through c2 separates I22 and I23 (see Fig. 5.5(a)).

Lemma 30 (necessity). The vertices v and v have to lie on different sides of the plane through c1, c2 and c3.

Proof. Assume w.l.o.g. it is both x3(v)>0 andx3(v)>0.

• Assume the vertexvE is lying within the convex hull of c1, c2 and c3. The planeE11 must pass under v because v must lie on a different side thanc2

andc3 to make the pathP1 strictly monotone. The planeE31 is parallel to E11and must havev on a different side thanc1, c2 andv sov is lying under this plane andvE must lie in an area bounded by a line throughc3 parallel to the line c2c1 and the line c2c3. With the same argument vE must lie in an area bounded by a line through c1 parallel to the line c3c2 and the line c3c1 to make the path P2 strictly monotone and an area bounded by a line through c2 parallel to the line c1c3 and the line c2c1 to make the path P3

strictly monotone. This is a contradiction, sox3(v)≤0. (See Fig. 5.5(b).)

• Assume vE and c3 are lying on different sides of the line through c1 and c2. The vertex v must lie above the plane E33 and v under the plane E23. We take a closer look at the intersection lines of the two planes E11

and E22 with the planes E and E23. The lines l(E11/E) and l(E22/E) intersect ini under the planeE23because of the ranges of the areas I11, I22 and I23. The vertices v and c2 lie on different sides of the plane E11 and the vertices v and c1 on different sides of the plane E22. Because v must also lie above E23, the lines ofl(E11/E23) and l(E22/E23) must intersect in i0 ∈E23 withx3(i)>0. The line l(E11/E22) must go throughi and i0. For the planes E31 and E12 parallel to E11 and E22, the line l(E31/E12) must be parallel tol(E11/E22) and because the intersection pointj ofl(E31/E) andl(E12/E) is not lying underE23, there is no placement forv underE23

such thatx3(v)>0 having v and c1 on different sides ofE31 and v and c2

on different sides of E12 (see Figs. 5.5(c) and 5.5(d)).

The cases whereve and c1 are lying on different sides of the line throughc2 and c3 and where ve and c2 are lying on different sides of the line through c1 and c3

are analogous.

Lemma 31(sufficiency). If the verticesv andv lie on different sides of the plane through c1, c2 and c3, for each of the paths (vc1c2c3v), (vc2c3c1v) and (vc3c1c2v) there a direction in which the path is strictly monotone increasing.

Proof. Let v and v have any position on different sides of E. For i ∈ {1,2,3}, letSi be the set of planes perpendicular to the possible directions in whichPi is strictly monotone increasing with each plane Ei ∈Si having parallel planes Eji

through the vertices cj for j ∈ {1,2,3} separating the vertices of the path Pi.

Each Si is bounded by E such that from each set we can find one plane having v and v on different sides.

(a) (b)

(c) (d)

Figure 5.5: v andv lie on different sides of a plane throughc1, c2 andc3

With this, hardness can be proven analogous to Sect. 5.3.1.

Chapter 6 Shape

Wherever a data set is divided into subsets that do not necessarily have size two, hypergraphs can be used to represent the data. In contrast to the defini-tion of a graph, the concept of a hyperedge, being an arbitrary sized subset of the vertex set, replaces that of an edge, which is a 2-element subset. While this generalization opens a wider range of possibilities, it results in the difficulty to visualize the hyperedges. There are several approaches to drawing hypergraphs.

We will concentrate on graphs associated with hypergraphs - the supports. Sup-ports can be used for hypergraph drawing (Johnson and Pollak, 1987; Kaufmann, van Kreveld, and Speckmann, 2009; Buchin, van Kreveld, Meijer, Speckmann, and Verbeek, 2010; Simonetto, Auber, and Archambault, 2009), e.g. for de-signing Euler diagrams . There are various well-formedness conditions for Euler diagrams, see e.g. Flower, Fish, and Howse (2008); Simonetto, Auber, and Ar-chambault (2009). Further applications for supports of hypergraphs are, e.g., in hypergraph coloring (Kr´al’, Kratochv´ıl, and Voss, 2004; Bujt´as and Tuza, 2009) and databases (Beeri, Fagin, Maier, and Yannakakis, 1983). Fig. 6.1 shows three representations of the hypergraph H = (V, A) with hyperedges h1 = {v1, v2}, h2 = {v2, v3}, h3 = {v3, v4}, h4 = {v4, v5}, h5 = {v5, v6}, h = {v2, v3, v4, v5}, h0 ={v2, v3, v4, v5, v7}, and V ={v1, . . . , v7}.

Recently the problem of deciding which classes of hypergraphs admit what kind of supports became of interest again. It can be tested in linear time whether a hypergraph has a support that is a tree (Tarjan and Yannakakis, 1984), a path or a cycle (Buchin, van Kreveld, Meijer, Speckmann, and Verbeek, 2010). It can be decided in polynomial time whether a hypergraph has a tree support with bounded degrees (Buchin, van Kreveld, Meijer, Speckmann, and Verbeek, 2010) or a cactus support (Brandes, Cornelsen, Pampel, and Sallaberry, 2010a). A minimum weighted tree support can be computed in polynomial time (Korach and Stern, 2003). It isN P-complete to decide whether a hypergraph has a planar support (Johnson and Pollak, 1987), a compact support (Johnson and Pollak,

{v1} {v2} {v3} {v4} {v5} {v6} {v7} V

h0

h

h1 h2 h3 h4 h5

(a) Hasse diagram

v1 v2 v3 v4 v5 v6

v7 (b) tree support

v1 v2 v3 v4 v5 v6

v7 (c) metro map like drawing

v1 v2 v3 v4 v5 v6

v7

(d) Euler diagram Figure 6.1: Three representations of a hypergraph

1987; Kaufmann, van Kreveld, and Speckmann, 2009) or a 2-outerplanar sup-port (Buchin, van Kreveld, Meijer, Speckmann, and Verbeek, 2010). A supsup-port with the minimum number of edges can be computed in polynomial time if the hypergraph is closed under intersections (Buchin, van Kreveld, Meijer, Speck-mann, and Verbeek, 2010). If the set of hyperedges is closed under intersections and differences, it can be decided in polynomial time whether the hypergraph has an outerplanar support (Brandes, Cornelsen, Pampel, and Sallaberry, 2010a).

In this chapter we consider a restriction on the subgraphs of a support that are induced by the hyperedges. A support G of a hypergraph H = (V, A) is called path-based if the subgraph G[h] contains a Hamiltonian path for each hyperedge h ∈ A, i.e., G[h] contains a path that contains each vertex of h.

This approach was on one hand motivated by hypergraph drawing and on the other hand by the aesthetics of metro map layouts. I.e., the hyperedges could be visualized as lines along the Hamiltonian path in the induced subgraph of the support like the metro lines in a metro map. See Fig. 6.2 for examples of metro maps: In 6.2(a) the local train map of Zurich (www.zvv.ch) and in 6.2(b) the metro map of Amsterdam (www.amsterdam.info) where the union of all lines forms a tree. See Fig. 6.3 for an example of natural sciences drawn in the metro map anthology, and Fig. 6.1(c)+ 6.6(f) for a representation of some hyperedges in such a metro map like drawing. For metro map layout algorithms

(a) local trains of Zurich (b) metro of Amsterdam Figure 6.2: Metro map drawings

see, e.g., N¨ollenburg (2010); Wolff (1970).

We briefly consider monotone, planar, and minimum path-based supports.

Our main result is a characterization of those hypergraphs that have a path-based tree support and a polynomial time algorithm for constructing path-path-based tree supports if they exist. E.g., Fig. 6.1 shows an example of a hypergraph H = (V, A) that has a tree support but no path-based tree support. However, the tree support in Fig. 6.1(b) is a path-based tree support for (V, A\ {V}).

Im Dokument Constrained Graph Drawing (Seite 90-99)