Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Planarity Test W. L. Hsu. Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect A plane graph.

Similar presentations


Presentation on theme: "Introduction to Planarity Test W. L. Hsu. Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect A plane graph."— Presentation transcript:

1 Introduction to Planarity Test W. L. Hsu

2 Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect A plane graph is a graph drawn in the plane in such a way that no two edges intersect – Except at a vertex to which they are both incident A planar graph is one which is isomorphic to a plane graph A planar graph is one which is isomorphic to a plane graph – Namely, it has a plane embedding

3 Planar Graphs

4 Planar Graph Embedding Clockwise edge ordering

5 Issues in Planarity Test If you can find a planar embedding, then the graph is planar. If you can find a planar embedding, then the graph is planar. How do you determine if a graph is not planar? How do you determine if a graph is not planar? This is the more difficult part of many recognition algorithm, namely, deciding when a graph “does not” belong to a class This is the more difficult part of many recognition algorithm, namely, deciding when a graph “does not” belong to a class – Get a certificate for non-planar graphs – Or alternatively, you have tried all possible ways but still fail to embed the graph in the plane (proof by exhaustion) – Use counting argument

6 Basic Non-Planar Graphs K5K5 K 3,3

7 Euler’s Theorem (1752) Euler’s theorem Euler’s theorem Let G be a connected plane graph, and let f be the # of faces of G. Then n + f = m + 2 – Prove by induction on the # of edges. Corollary. m  3 n – 6 Corollary. m  3 n – 6 – First show that 3f  2m since every face is bounded by at lest 3 edges

8 K 5 and K 3,3 are non-planar If K 5 is planar, then by previous Corollary, we have 10  9.  If K 5 is planar, then by previous Corollary, we have 10  9.  K 3,3 is bipartite. Assume it is planar, then every face is even (has at least 4 edges). K 3,3 is bipartite. Assume it is planar, then every face is even (has at least 4 edges). – Hence 4 f  2 m. – Namely, 10 = 2 f  m = 9. 

9 Kuratowski’s Theorem Two graphs are homeomorphic if they can be obtained from the same graph by inserting new vertices of degree 2 into its edges Two graphs are homeomorphic if they can be obtained from the same graph by inserting new vertices of degree 2 into its edges A graph is planar if and only if it contains no subgraph homeomorphic to K 5 or K 3,3 A graph is planar if and only if it contains no subgraph homeomorphic to K 5 or K 3,3 The latter are referred to as Kuratowski subgraphs The latter are referred to as Kuratowski subgraphs

10 Planarity Test

11 How do you draw a planar graph without regret ? This means that, besides keeping the current embedding planar, your embedding can also keep future options open. This means that, besides keeping the current embedding planar, your embedding can also keep future options open. You will have to design an embedding “scheme” rather than obtain a “physical” ( 實體的 ) embedding You will have to design an embedding “scheme” rather than obtain a “physical” ( 實體的 ) embedding

12 Prior Results 1st approach 1st approach – Hopcroft and Tarjan [1974],first O(m) time. – PATH ADDITION 2nd approach 2nd approach – Lempel, Even and Cederbaum[1967], O(n 2 ) time – VERTEX ADDITION – st-numbering, consecutive ones testing – Booth and Lueker [1976] used PQ-trees to test the consecutive ones property in O(m+n) time consecutive ones property in O(m+n) time 3rd approach 3rd approach – Shih and Hsu [1999] used PC-trees for recognition and embedding. – EDGE ADDITION

13 A Brief Intro. to the Vertex Addition Approach of LEC

14 Vertex Addition Approach of LEC 1. Keep the current partial planar graph connected 2. Keep those non-added vertices a connected subgraph (i.e. in the same face). 3. Apply a consecutive ones test every time a new vertex is added

15 st-numbering (I) Consider a 2-connected graph G. Pick any two adjacent vertices s and t. Consider a 2-connected graph G. Pick any two adjacent vertices s and t. Order the vertices of G into s, v(1),..., v(k), t such that Order the vertices of G into s, v(1),..., v(k), t such that s s v(i)v(i) v(i)v(i) v(i+1) v(i+1),…, t must be imbedded in the same face t t

16 St-numbering(II) s v(i)v(i) t s v(i)v(i) t v(i+1) Depth-First-Search s v(i)v(i) t

17 1=s 6=t 235 6 235 (a) B 1 (a’) (b) B 2 (b’) 1 2 6 3 5 453 6 35453 Bush Form (1)

18 (c) B 2 ’ 1 2 6 354 53 (c’) 6 54533 (d) B 3 1 2 6545 (d’) 6 545 64 46 3 Bush Form (2)

19 (e) B 3 ’ 2 6 54 5 46 3 (e’) 6 54 564 (f’) 6 54564 (f) B 4 2 6 5 5 6 3 1 1 65 4 Bush Form (3)

20 (g) B 4 ’ 2 6 556 3 1 6 5 4 (g’) 655665 (h’) 6666 (h) B 5 2 6 6 3 1 6 5 4 6 Bush Form (4)

21 (i) G=G 6 =B 6 2 6 3 1 5 4 (i’) Bush Form (5)

22 Introducing PQ-Trees

23 23/30 PQ-trees and the consecutive ones property (COP) PQ-trees can record all feasible permutations of the column indices Q P 1 2 3 56 Q 4 1 2 3 4 5 6 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 COP : Can one permute the columns such that the ones in each row are consecutive ?

24 24/30 Linear time algorithm on PQ-trees [1974] Booth and Lueker presented a linear time algorithm for the COP test based on PQ-trees [1974] Booth and Lueker presented a linear time algorithm for the COP test based on PQ-trees – Process the matrix one row at a time PQ-tree can also be used to yield a linear time algorithm for interval graph recognition and planar graph recognition. PQ-tree can also be used to yield a linear time algorithm for interval graph recognition and planar graph recognition.

25 25/30 Operations on PQ-trees (I) Booth and Lueker’s algorithm is a bottom-up approach consisting of two stages: Booth and Lueker’s algorithm is a bottom-up approach consisting of two stages: – 1. Node labeling Node labelingNode labeling The leaves of the incoming row are labeled full, all the other leaves are empty. the remaining nodes are labeled The leaves of the incoming row are labeled full, all the other leaves are empty. the remaining nodes are labeled empty : all of its children are empty empty : all of its children are empty full : all of its children are full full : all of its children are full partial : neither full nor empty partial : neither full nor empty – 2. Tree modification Tree modificationTree modification

26 26/30 Operations on PQ-trees (II): 1. Node labeling The first time a node u becomes partial or full report to its parent. The first time a node u becomes partial or full report to its parent. The first time a node u gets a partial or full child label u partial. The first time a node u gets a partial or full child label u partial. The first time all children of a node u become full label u full. The first time all children of a node u become full label u full.

27 27/30 Operations on PQ-trees (III): 2. Tree modification Need to modify the current tree so that all the incoming columns can be arranged consecutively. Need to modify the current tree so that all the incoming columns can be arranged consecutively. Modify the subtree of every partial node Modify the subtree of every partial node – At each iteration, modify the subtree of a partial node starting from the lowest level of the tree The subtree modification is based on 9 templates of subtree structures. The subtree modification is based on 9 templates of subtree structures.

28 28/30... Template P2 for ROOT (T,S) when it is a P-node

29 29/30... Template P3 for a singly partial P- node which is not ROOT (T,S)

30 30/30... Template P4 for ROOT(T,S) when it is a P-node with one partial child...

31 31/30 Template P5 for a singly partial P-node, other than ROOT(T,S), with one partial child...

32 32/30 Template P6 for ROOT(T,S) when it is a doubly partial P-node...

33 33/30... Template Q2 for a singly partial Q- node

34 34/30 Template Q3 for a double partial Q- node...

35 35/30 Time complexity of the original PQ-tree operations Node labeling takes time proportional to the number of incoming columns. Node labeling takes time proportional to the number of incoming columns. Subtree modification needs to change many parent-children relationships Subtree modification needs to change many parent-children relationships – use amortized analysis to argue that it takes constant time at every iteration. – this analysis is quite involved. Does not render a direct algorithm for testing the circular ones property Does not render a direct algorithm for testing the circular ones property – Complement a row


Download ppt "Introduction to Planarity Test W. L. Hsu. Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect A plane graph."

Similar presentations


Ads by Google