Download presentation
Presentation is loading. Please wait.
Published byDominic Norton Modified over 9 years ago
1
1 Orthogonal Drawing (continued) Sections 8.3 – 8.5 from the book Bert Spaan
2
2 Orthogonal Drawing (continued) 1.Linear Algorithm Without Bad Cycles With Bad Cycles 2.Orthogonal Grid Drawing 3.Orthogonal Drawings without Bends
3
3 Linear Algorithm for Bend-Optimal Drawing Linear time algorithm for graphs with the following properties: 3-connected Δ ≤ 3 Four or more outer edges
4
4 k-Connectivity A graph G is connected if for any distinct vertices u and v there is a path between u and v in G. A graph is k-connected if the minimum number of vertices whose removal results in a disconnected graph is k.
5
5 Examples 1-connected: 2-connected: 3-connected:
6
6 Bad Cycles A graph has no bad cycles and thus a rectangular drawing if and only if Any 2-legged cycle contains two or more corners Any 3-legged cycle contains one or more corners A bad cycle is a 2-legged cycle which contains at most one corner, or a 3- legged cycle which contains no corners.
7
7 Maximal Bad Cycles A bad cycle C in G is defined to be maximal if C is not contained in any other bad cycle in G
8
8 Linear Algorithm Algorithm Orthogonal-Draw(G) begin Add four dummy vertices of degree two on four distinct outer edges as the corners; Let G’ be the resulting graph; Let C 1, C 2, …, C l, be the maximal bad cycles in G’; for each i, 1 ≤ i ≤ l, construct a genealogical tree T C i and determine green paths and red paths for every cycle in T C i ; for each i, 1 ≤ i ≤ l, find an orthogonal drawing D(G(C i )) of G(C i ) feasible for an arbitrary green path of C i by Feasible-Draw; Let G’’ be a plane graph derived from G’ by contracting each for each G(C i ), 1 ≤ i ≤ l, to a single vertex v i ; Find a rectangular drawing D(G’’) of G’’ by Rectangular-Draw; Patch the drawings D(G(C 1, D(G(C 2 )), …, D(G(C l )) into D(G’’) to get an orthogonal drawing D(G’) of G’. Obtain an orthogonal drawing D(G) of G by replacing the four dummy vertices a, b, c and d in D(G’) with bends end.
9
9 Linear Algorithm Without Bad Cycles Algorithm Orthogonal-Draw(G) begin Add four dummy vertices of degree two on four distinct outer edges as the corners; Let G’ be the resulting graph; Obtain an orthogonal drawing D(G) of G by replacing the four dummy vertices a, b, c and d in D(G’) with bends end.
10
10 Example Start: Step 2: Step 1: Step 3:
11
11 Linear Algorithm With Bad Cycles, same Algorithm Start: Step 2: Step 1: Step 3: Doesn’t lead to orthogonal drawing due to bad cycle
12
12 Bad Cycles in G’ G is 3-connected and thus has no 2- legged cycles G’ has four 2-legged cycles, but none of those are bad cycles Every bad cycle in G’ is a 3-legged cycle containing no corner
13
13 Genealogical Tree Tree of cycles in G, T C In algorithm: tree of 3-legged bad cycles T C can be found in linear time
14
14 Example 3-legged cycles in C and genealogical tree T C C 2, C 3, C 4 and C 5 are the maximal bad cycles in C C 7 is the maximal bad cycle in C 4
15
15 Assignment & Labeling For each 3-legged cycle C in graph G we define the following terms in a recursive manner, based on a genealogical tree. C is divided into three contour paths P 1, P 2, and P 3 by the three leg- vertices x, y and z Each contour path is classified as either a green path or a red path C is assigned an integer bc(C), the bend-count of C
16
16 Three cases 1.C has no child-cycle, that is, l = 0 2.C has child-cycles C 1, C 2, …, C l, l ≥ 1, but none of them has a green path on C 3.Otherwise
17
17 Case 1 C has no child-cycles: T C consists of a single vertex Classify all the three contour paths of C as green paths Set bc(C) = 1
18
18 Case 2 C has one or more child-cycles, none of them with a green path on C: Classify all the three contour paths of C as green paths Set bc(C) = 1 + the sum of the bend-counts of all child- cycles
19
19 Case 3 Otherwise: Classify the contour paths in which a child-cycle has a green path as green paths Classify the other contour paths (if any) as red paths Set bc(C) = the sum of the bend-counts of all child- cycles
20
20 Properties Each cycle has at least one green contour path Assignment & Labeling can be done in linear time
21
21 Feasible-Draw Find an orthogonal drawing G(C) for a 3-legged cycle C Feasible if the drawing has the following properties: Drawing has bc(C) bends At least one bend appears on the green path The drawing is bound by six open halflines, two at each point x, y and z
22
22 Case 1 C has no child-cycles: bc(C) = 1 Insert a dummy vertex t of degree two on an arbitrary edge on the green path in C Now there are four corners: Dummy vertex t Vertices x, y and z No bad cycles, algorithm Rectangular-Draw can be used to find a rectangular drawing After replacing t with a bend, an orthogonal drawing is created
23
23 Case 2 C has one or more child-cycles, none of them with a green path on C: Recursion: first find an orthogonal drawing for each child-cycle Construct a plane graph J from G(C) by contracting each child- cycle to a single vertex Add a dummy vertex t Now, with Rectangular-Draw and removal of t, an orthogonal drawing can be found Replace the contracted vertices with the original child-cycles. This is always possible, there are 12 distinct embeddings, depeding on the three legs x, y and z and the chosen green path
24
24 Case 3 Otherwise Construct a plane graph J from G(C) by contracting each child- cycle to a single vertex Replace one of the contracted cycles with a quadrangle (x 1, t, y 1, z 1 ) where t is a dummy vertext of degree two Recursion: find an orthogonal drawing for each child-cycle Now, with Rectangular-Draw and removal of t, an orthogonal drawing can be found Replace the contracted vertices with the original child-cycles and the quadrangle with its corresponding cycle.
25
25 Linear Algorithm Algorithm Orthogonal-Draw(G) begin Add four dummy vertices of degree two on four distinct outer edges as the corners; Let G’ be the resulting graph; Let C 1, C 2, …, C l, be the maximal bad cycles in G’; for each i, 1 ≤ i ≤ l, construct a genealogical tree T C i and determine green paths and red paths for every cycle in T C i ; for each i, 1 ≤ i ≤ l, find an orthogonal drawing D(G(C i )) of G(C i ) feasible for an arbitrary green path of C i by Feasible-Draw; Let G’’ be a plane graph derived from G’ by contracting each for each G(C i ), 1 ≤ i ≤ l, to a single vertex v i ; Find a rectangular drawing D(G’’) of G’’ by Rectangular-Draw; Patch the drawings D(G(C 1, D(G(C 2 )), …, D(G(C l )) into D(G’’) to get an orthogonal drawing D(G’) of G’. Obtain an orthogonal drawing D(G) of G by replacing the four dummy vertices a, b, c and d in D(G’) with bends end.
26
26 Orthogonal Grid Drawing An orthogonal drawing is called an orthogonal grid drawing if all vertices and bends are located on integer grid points. DgDg D’ g
27
27 Compact D g is compact: There is at least one vertical line segment of x-coordinate i for each integer i, 0 ≤ i ≤ W (W is the width of the grid) There is at least one horizontal line segment of y-coordinate j for each integer j, 0 ≤ j ≤ H (H is the height of the grid)
28
28 Bend-count and grid size relation Let D g be a compact orthogonal grid drawing of a plane graph G with b bends. Then W + H ≤ b + 2 * |E| – |V| – 2
29
29 Orthogonal Drawings without Bends Plane graphs with Δ ≤ 3 may have an orthogonal drawing without bends
30
30 Conditions Assume that G is a plane 2-connected graph with Δ ≤ 3 and four or more outer vertices of degree two. G has an orthogonal drawing without bends if and only if Every 2-legged cycle contains at least two vertices of degree two Every 3-legged cycle contains at least one vertex of degree two
31
31 Example 2-legged cycles: 3-legged cycles:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.