Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rectangular Drawing (continue) Harald Scheper. Overview algorithm (directions) algorithm in linear time outline of algorithm (placement) Rect. Drawings.

Similar presentations


Presentation on theme: "Rectangular Drawing (continue) Harald Scheper. Overview algorithm (directions) algorithm in linear time outline of algorithm (placement) Rect. Drawings."— Presentation transcript:

1 Rectangular Drawing (continue) Harald Scheper

2 Overview algorithm (directions) algorithm in linear time outline of algorithm (placement) Rect. Drawings without Designated Corners

3 Algorithm To find directions of edges in rectangular drawing of G (vertical, horizontal) Later decide the integer coordinates of vertices

4 Algorithm (outline) Assume plane graph G has no bad cycle. Each C 0 (G) component treated independently. If there exists a boundary NS-, SN-, WE-, or EW-path then choose it as a partition path Otherwise find partition path P C and P CC from westmost NS-path, and recurse over subgraphs

5 Algorithm Main Algorithm Rectangular-Draw(G) 1.Draw the outer cycle C 0 (G) as a rectangle by 2 horizontal line segments P N, P S and 2 vertical line segments P E and P W 2.Find all C 0 (G) components J 1,..,J P 3.For each component J i Gi = C 0 (G) J i Draw(G i,J i )

6 Draw(G,J) if part If G has boundary NS-, SN-, WE-, or EW-path P –assume without loss of generality that P is a boundary NS-path –Draw all edges of P on vertical line (directions are vertical) –If |E(P)| ≥ 2 then F 1,..,F q are C 0 components of G P For each F i, i ≤ 1 ≤ q do –Draw (C 0 (G P ) F i, F i )

7 Draw(G i,J i ) else part No boundary NS-,SN-,EW-, or WE path Find westmost NS-path P Find partition-pair Pc and Pcc from P If P c = P cc then –Draw all edges of P c on a vertical line segment Recursive –Draw(C 0 (G i ) F i,F i )

8 Draw(G i,J i ) else, else part If P c ≠ P cc then –Draw all edges of P c and P cc on alternating sequences of horizontal, vertical line segments –G 1 is graph obtained form G W by contracting all edges of P CC that are on horizontal sides of rectangular embeddings of C 1,C 2,..C k G 2 = of P c G 3 = G(C 1 ), G 4 = G(C 2 )…G(C k ) –Recursive: Draw(C 0 (G j ) F j,F j ), 1 ≤ j ≤ q for each graph G i, 1 ≤ i ≤ k+2 Pcc

9 Linear time Find all C 0 components For each C 0 we find boundary NS-,SN-,EW- and WE-paths if exist, by traversing all boundary faces of G by cc depth-first search. Each boundary path gets a label, NN, NE,…, WW (start/end points). So NS-, SN-, EW-, WE-paths are found in constant time

10 Linear time no boundary NS-, SN-, EW-, WE paths find partition-pair P c and P cc give labels to the newly created paths by traversing them (once) problem if a subpath of the westmost NS-path is chosen as westmost NS- path P’ in a later recursive stage, which is not on P c or P cc.

11 Linear time then again have to traverse the facial cycles attached to P’, so time complexity not linear so store: –list edges e i elemof E(P) contained in boundary NN- and EN-paths –list edges e i elemof E(P) contained in boundary SS- and SE-paths to find P st and P en in later recursive stages

12 Linear time store array of length n = whether the vertex is a head or a tail vertex of a clock wise critical cycle C attached to P and whether n cc (C) = 1 or n cc (C) >1 indicate existence of critical cycles attached to P’ (not to find critical cycles again) every face become boundary face, and not again. so traversed constant time. => linear time.

13 Rectangular Grid Drawing 1 Algorithm finds only directions of all edges in G Now coordinates of vertices in G determined in linear time Assume for simplicity not-corner vertices have degree 3

14 Rectangular Grid Drawing 2 Graph T y spanning tree obtained from G delete not deleted

15 Rectangular Grid Drawing 3 16 maximal vertical lseg 15 maximal horizontal lseg

16 Rectangular Grid Drawing 4 to each maximal horizontal line segment L, we assign y(L) as y- coordinate of every vertex on L –P S is lowermost, P N is topmost –y(P S )=0 –compute y(L) bottom to top –For each vertex v assign temp(v) as temporary y-coordinate of v –For every vertex v on L two cases: v has neighbor u below v (temp(v) = y(L’)+1) v has no neighbor u below v (temp(v) = 0) –y(L) = max{temp(v)} v

17 Rectangular Grid Drawing 5 All maximal horizontal line segments with depth-first search = linear time Upperbounds on area of grid, W+H ≤ n/2 and W · H ≤ n 2 /16 –coordinate of south-west corner = (0,0), northeast = (W,H), at least one hor., vert. line segment –l v = #vertical linesegments, l h = #horizontal linesegments, l = l v + l h –each vertex (- 4) = one of the l-4 max. line seg (P N …) so n-4 = 2(l-4) => l-2 = n/2 because compact: H ≤ l h -1, W ≤ l v -1 = W+H ≤ l h + l v – 2 = l – 2 = n/2 => W · H ≤ n 2 /4

18 RD no designated corners 1 until now considered rect. plane graph G with Δ ≤ 3 with 4 outer vertices of degree 2 as corners now corners not designated efficiently find whether G has 4 outer vertices (degree 2) such that there is a rect. drawing

19 RD no designated corners 2 independent: no common vertex S 1 = {C 1,C 2 }, S 2 = {C 2,C 3,C 4 }

20 RD no designated corners 3 Theorem 6.4.1: G is 2 connected graph, Δ ≤ 3, has min. 4 outer vertices of degree 2, then rect. draw with 4 corners desig. corners if G satisfies: –every 2-legged cycle in G contains at least 2 outer vertices of degree 2 –every 3-legged cycle in G contains at least 1 outer vertex of degree 2 –if an independent set S of cycles in G consists of c 2 2 legged cycles and c 3 3- legged cycles then 2c 2 + c 3 ≤ 4

21 RD no designated corners 2 independent: no common vertex S1 = {C 1, C 2 }, c 2 = 2, c 3 = 0, 2*2+0 = 4 S2 = {C 2, C 3, C 4 }, c 2 = 1, c 3 = 2, 2*1+2 = 4

22 RD no designated corners 3 Necessity of Th. 6.4.1 : –assume G has rectangular drawing D with 4 corners. by fact 6.3.1: an indep. set S has c 2 2-legged C contains at least 2 corners, c 3 3-legged C contains at least 1 corner. All cycles independent, so at least 2c 2 + c 3 corners in D. Since there are 4 corners in D, 2c 2 +c 3 ≤ 4 In any rectangular drawing D of G, every 2- legged cycle of G contains 2 or more corners, every 3-legged cycle of G contains 1 or more corner, more than 3-legged has no corner

23 RD no designated corners 4 prove of 6.4.1: –show if the 3 conditions hold, then can choose 4 outer vertices of degree 2 as corners a,b,c,d, such that (theorem): any 2-legged cycle contains 2 or more corners any 3-legged cycle contains 1 or more corners

24 RD no designated corners 5 outline = (complete in article) let J 1,..,J p p ≥ 1 be C 0 (G) components of G in series C 1 and C 2 in J 1 and J p if 4 corners not been chosen, we choose a corner from each of innermost 3-legged cycles.

25 RD no designated corners 6 example

26 RD of Planar Graphs until now considered rectangular drawings of plane graphs (with fixed embedding), now of planar graphs with Δ ≤ 3 (without fixed embedding) say planar graph G has rect. drawing if at least one of the plane embeddings has rect. drawing

27 RD of Planar Graphs b, c, d are embeddings of planar graph b = rd, c and d not (3-legged cycle with no outer vertex of degree 2)

28 RD of Planar Graphs finding not trivial because exponential number of plane embeddings by algorithm as before. now linear algorithm to examine if there is a plane embedding with rect. drawing

29 Questions?


Download ppt "Rectangular Drawing (continue) Harald Scheper. Overview algorithm (directions) algorithm in linear time outline of algorithm (placement) Rect. Drawings."

Similar presentations


Ads by Google