Скачать презентацию Straight line drawings of planar graphs part Скачать презентацию Straight line drawings of planar graphs part

54a29a5226e41c6ead41e6fca06b032d.ppt

  • Количество слайдов: 21

Straight line drawings of planar graphs – part II Roeland Luitwieler Straight line drawings of planar graphs – part II Roeland Luitwieler

Outline • Reminder • The realizer method – Barycentric representations – Schnyder labelings and Outline • Reminder • The realizer method – Barycentric representations – Schnyder labelings and realizers – The realizer algorithm

Reminder • This presentation is about: – Straight line grid drawings of planar graphs Reminder • This presentation is about: – Straight line grid drawings of planar graphs – Minimized area • De Fraysseix, Pach & Pollack, 1988: – The shift method: 2 n– 4 x n– 2 grid • Schnyder, 1990: – The realizer method: n– 2 x n– 2 grid • Both are quite different, but can be implemented as linear time algorithms

Reminder • Assumptions (can be taken care of in linear time) – n ≥ Reminder • Assumptions (can be taken care of in linear time) – n ≥ 3 (trivial otherwise) – Graph is maximal planar (=triangulated) – Graph has a topological embedding • Previously: – We proved every triangulated plane graph has a canonical ordering, which can be obtained in linear time – We showed how the linear-time shift algorithm works • Adds vertices in a canonical ordering • Shifts parts of the drawing to enable straight lines • Always uses a 2 n– 4 x n– 2 grid

Barycentric representations • A barycentric representation of a graph G is an injective function Barycentric representations • A barycentric representation of a graph G is an injective function f : v ∈ V(G) → (v 1, v 2, v 3) ∈ ℝ 3 such that – v 1 + v 2 + v 3 = 1 for all v ∈ V(G) – For each edge (x, y) and vertex z ≠ x, y there exists an index k ∈ {1, 2, 3} such that xk < zk and yk < zk • (v 1, v 2, v 3) are barycentric coordinates of v

Barycentric representations • So, a barycentric representation of a graph is a planar straight Barycentric representations • So, a barycentric representation of a graph is a planar straight line drawing in the plane spanned by the three points (1, 0, 0), (0, 1, 0) and (0, 0, 1) • Only a planar graph can have a barycentric representation

Barycentric representations • A weak barycentric representation of a graph G is an injective Barycentric representations • A weak barycentric representation of a graph G is an injective function f : v ∈ V(G) → (v 1, v 2, v 3) ∈ ℝ 3 such that – v 1 + v 2 + v 3 = 1 for all v ∈ V(G) – For each edge (x, y) and vertex z ≠ x, y there exists an index k ∈ {1, 2, 3} such that (xk, xk+1)

Schnyder labelings and realizers • A Schnyder labeling is a labeling of all angles Schnyder labelings and realizers • A Schnyder labeling is a labeling of all angles of all inner facial triangles of a triangulated plane graph with labels 1, 2, 3 such that: – The angles of each inner facial triangle are labeled 1, 2 and 3 in counterclockwise order – The labels of the angles at each inner vertex form nonempty intervals of 1’s, 2’s and 3’s in counterclockwise order

Schnyder labelings and realizers • Lemma: Every triangulated plane graph has a Schnyder labeling Schnyder labelings and realizers • Lemma: Every triangulated plane graph has a Schnyder labeling • Proof: use canonical ordering – Contract inner edges (vn, vn-1), (vn, vn-2), … • Edge contractible if graph remains triangulated (proof follows) – Label all angles at vn 1 – Now expand again in reverse order, like this (where a=vn):

Schnyder labelings and realizers – Subproof: edges (vn, vn-1), (vn, vn-2), … are contractible Schnyder labelings and realizers – Subproof: edges (vn, vn-1), (vn, vn-2), … are contractible • The vertices of a contractible edge have exactly two common neighbours • This holds in a canonical ordering – vn remains the neighbour of all vertices on the outer cycle of the rest of the graph (Gk), including vk – So, vn and vk have the most left and the most right neighbour of vk on the outer cycle of Gk-1 in common

Schnyder labelings and realizers • A realizer is a partition of the inner edges Schnyder labelings and realizers • A realizer is a partition of the inner edges into sets T 1, T 2 and T 3 such that for each inner vertex v: – v has outdegree one in each of the sets – The counterclockwise order of the incident edges is: • Schnyder labelings and realizers are equivalent notions

Schnyder labelings and realizers • Here’s a triangulated plane graph with a corresponding Schnyder Schnyder labelings and realizers • Here’s a triangulated plane graph with a corresponding Schnyder labeling and realizer:

Schnyder labelings and realizers • We define Pi(v) the i-path of an inner vertex Schnyder labelings and realizers • We define Pi(v) the i-path of an inner vertex v to be the path in Ti from v to the root of Ti • P 1(v), P 2(v) and P 3(v) share only the vertex v • They divide the graph into three regions R 1(v), R 2(v) and R 3(v), each opposite to the resp. root

Schnyder labelings and realizers • By Pi(v) we also denote the set of vertices Schnyder labelings and realizers • By Pi(v) we also denote the set of vertices on that path • By Ri(v) we also denote the set of all vertices in that region – The vertices on Pi+1(v) and Pi-1(v) are included • For all distinct inner vertices u and v of a triangulated plane graph, we have: – if u ∈ Ri(v) then Ri(u) ⊂ Ri(v)

The realizer algorithm • For an inner vertex v let ni(v) = |Ri(v) – The realizer algorithm • For an inner vertex v let ni(v) = |Ri(v) – Pi– 1(v)| • For an outer vertex (root) ri let ni(ri) = n – 2, ni+1(ri) = 1 and ni+2(ri) = 0 • Note that for all vertices v: n 1(v) + n 2(v) + n 3(v) = n – 1 • Also note that: 0 ≤ n 1(v), n 2(v), n 3(v) ≤ n – 2 • Furthermore: if u ∈ (Ri(v) – Pi-1(v)) then ni(u) < ni(v) – Case u is outer vertex ri+1: ni(u) = 0 – Case u is an inner vertex: Ri(u) ⊂ Ri(v) if u ∈ Ri(v) then ni(u) ≤ ni(v) – Cases above apply – Case u is outer vertex ri– 1: ni(u) = 1

The realizer algorithm • Lemma: We now have that the function f : v The realizer algorithm • Lemma: We now have that the function f : v ∈ V(G) → 1/(n – 1) · (n 1(v), n 2(v), n 3(v)) ∈ ℝ 3 is a weak barycentric representation of the triangulated plane graph G • Proof: – v 1 + v 2 + v 3 = 1 for all v ∈ V(G), since n 1(v) + n 2(v) + n 3(v) = n – 1 – We now only have to show that for each edge (x, y) and vertex z ≠ x, y there exists an index k ∈ {1, 2, 3} such that (xk, xk+1)

The realizer algorithm – Proof that for each edge (x, y) and vertex z The realizer algorithm – Proof that for each edge (x, y) and vertex z ≠ x, y there exists an index k ∈ {1, 2, 3} such that (xk, xk+1)

The realizer algorithm • The algorithm is as follows: – Construct Schnyder labeling and The realizer algorithm • The algorithm is as follows: – Construct Schnyder labeling and realizer – For all vertices v do • Calculate n 1(v) and n 2(v) • Draw v at coordinates (n 1(v), n 2(v)) • Correctness: – The plane spanned by (n – 1, 0, 0), (0, n – 1, 0) and (0, 0, 0) is 2 D • Complexity: – Calculate in linear time: for all v the depth and the size of the subtree rooted at v – All |Pi-1(v))| and |Ri(v)| can be calculated from this in constant time per vertex, so all ni(v) too

The realizer algorithm • Here’s a drawing obtained by the algorithm: The realizer algorithm • Here’s a drawing obtained by the algorithm:

Conclusions • The realizer method uses – A Schnyder labeling and realizer – A Conclusions • The realizer method uses – A Schnyder labeling and realizer – A n– 2 x n– 2 grid – Linear time • Questions?

References • H. de Fraysseix, J. Pach and R. Pollack, How to draw a References • H. de Fraysseix, J. Pach and R. Pollack, How to draw a planar graph on a grid, Combinatorica 10 (1), 1990, pp. 41– 51. • T. Nishizeki and Md. S. Rahman, Planar Graph Drawing, World Scientific, Singapore, 2004, pp. 45– 88. • W. Schnyder, Embedding planar graphs on the grid, in: Proceedings of the First ACM-SIAM Symposium on Discrete Algorithms, 1990, pp. 138– 148.