Download presentation
Presentation is loading. Please wait.
Published byAlexina Tyler Modified over 9 years ago
1
Straight line drawings of planar graphs – part II Roeland Luitwieler
2
Outline Reminder The realizer method –Barycentric representations –Schnyder labelings and realizers –The realizer algorithm
3
Reminder This presentation is about: –Straight line grid drawings of planar graphs –Minimized area De Fraysseix, Pach & Pollack, 1988: –The shift method: 2n–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
4
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 2n–4 x n–2 grid
5
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 x k < z k and y k < z k (v 1, v 2, v 3 ) are barycentric coordinates of v
6
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
7
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 (x k, x k+1 ) < lex (z k, z k+1 ) and (y k, y k+1 ) < lex (z k, z k+1 ), where indices are computed modulo 3 Note: (a, b) < lex (c, d) ≡ a < c or (a == c and b < d)
8
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
9
Schnyder labelings and realizers Lemma: Every triangulated plane graph has a Schnyder labeling Proof: use canonical ordering –Contract inner edges (v n, v n-1 ), (v n, v n-2 ), … Edge contractible if graph remains triangulated (proof follows) –Label all angles at v n 1 –Now expand again in reverse order, like this (where a=v n ):
10
Schnyder labelings and realizers –Subproof: edges (v n, v n-1 ), (v n, v n-2 ), … are contractible The vertices of a contractible edge have exactly two common neighbours This holds in a canonical ordering –v n remains the neighbour of all vertices on the outer cycle of the rest of the graph (G k ), including v k –So, v n and v k have the most left and the most right neighbour of v k on the outer cycle of G k-1 in common
11
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
12
Schnyder labelings and realizers Here’s a triangulated plane graph with a corresponding Schnyder labeling and realizer:
13
Schnyder labelings and realizers We define P i (v) the i-path of an inner vertex v to be the path in T i from v to the root of T i 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
14
Schnyder labelings and realizers By P i (v) we also denote the set of vertices on that path By R i (v) we also denote the set of all vertices in that region –The vertices on P i+1 (v) and P i-1 (v) are included For all distinct inner vertices u and v of a triangulated plane graph, we have: –if u ∈ R i (v) then R i (u) ⊂ R i (v)
15
The realizer algorithm For an inner vertex v let n i (v) = |R i (v) – P i–1 (v)| For an outer vertex (root) r i let n i (r i ) = n – 2, n i+1 (r i ) = 1 and n i+2 (r i ) = 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 ∈ (R i (v) – P i-1 (v)) then n i (u) < n i (v) – Case u is outer vertex r i+1 : n i (u) = 0 – Case u is an inner vertex: R i (u) ⊂ R i (v) if u ∈ R i (v) then n i (u) ≤ n i (v) – Cases above apply – Case u is outer vertex r i–1 : n i (u) = 1
16
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 (x k, x k+1 ) < lex (z k, z k+1 ) and (y k, y k+1 ) < lex (z k, z k+1 )
17
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 (x k, x k+1 ) < lex (z k, z k+1 ) and (y k, y k+1 ) < lex (z k, z k+1 ): Case z is an outer vertex r i : k=i implies n k (x), n k (y) < n k (z) = n – 2 Case z is an inner vertex: some k exists such that x, y ∈ R k (z) Now for u ∈ {x, y} and v = z: – Case u ∈ (R k (v) – P k-1 (v)): we showed for that case n k (u) < n k (v) – Case u ∈ P k-1 (v): we showed maybe n k (u) = n k (v); but then u ∈ (R k+1 (v) – P k (v)), so n k+1 (u) < n k+1 (v)
18
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 2D Complexity: –Calculate in linear time: for all v the depth and the size of the subtree rooted at v –All |P i-1 (v))| and |R i (v)| can be calculated from this in constant time per vertex, so all n i (v) too
19
The realizer algorithm Here’s a drawing obtained by the algorithm:
20
Conclusions The realizer method uses –A Schnyder labeling and realizer –A n–2 x n–2 grid –Linear time Questions?
21
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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.