Presentation is loading. Please wait.

Presentation is loading. Please wait.

S&H Planarity Test Based on PC-Trees Wen-Lian Hsu.

Similar presentations


Presentation on theme: "S&H Planarity Test Based on PC-Trees Wen-Lian Hsu."— Presentation transcript:

1 S&H Planarity Test Based on PC-Trees Wen-Lian Hsu

2 2/40 Prior Results 1st approach –Hopcroft and Tarjan [1974],first O(m) time. –PATH ADDITION 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 3rd approach –Shih and Hsu [1999] used PC-trees for recognition and embedding. –EDGE ADDITION

3 3/40 Advantages of S&H algorithm Start with a DFS-tree, everything else is very elementary Recognition and Embedding are done at the same time Whenever non-planarity is detected, a forbidden Kuratowski’s subgraph can be located. Provides a linear time algorithm for finding maximal planar subgraphs

4 4/40 Our Approach -- Edge addition Start with a Depth-First-Search Tree (with post ordering) 1 3 4 7 56 14 15 16 13 12 11 10 89 1 2 2 4 3

5 5/40 PC-Tree: Keeping relations between components and nodes

6 6/40 Transforming a 2-connected component into a c-node i 1 2 3 i 1 2 3 ikik 2 3 1 i

7 7/40 Efficiency Note We might assume that the graph is originally 2-connected –since otherwise DFS will separate the graph into 2-connected components and we can work on each one individually This will force each leaf in the DFS-tree to have at least one back edge to nodes  i –However, this is not crucial

8 8/40 Adding the set of back edges connecting to a new vertex at each iteration Work on each branch separately

9 9/40 Concentrate on one subtree at a time Resulting in one component i r i At the end of the iteration Subtree T r

10 10/40 What do we need to do at each iteration? For each 2-connected component, determine what should be embedded inside and what should be outside We can do this by finding the boundary path separating them

11 11/40 Boundary paths of the component Non-unique part –Some part of the boundary path leading to node i can have many candidates –Focus on nodes that have to be embedded outside Unique part –However, all boundary paths will share a unique subpath (the terminal path ) whose two ends (terminal nodes) are connected to nodes > i (through back edges)

12 12/40 An Important Observation A leaf with a back edge to i and no other back edges must be inside A leaf whose back edges all point to nodes > i must be outside A leaf with both a back edge to node i and other back edges to nodes > i must be on the boundary

13 Essential nodes Nodes that must be on the boundary The labeling procedure –Label all nodes that have back edges to i. –If a node is labeled, label its parent. The 2-connected component –All labeled nodes –All traversed edges –All back edges to I Essential node –a labeled node with an un-labeled neighbor 13/40

14 Terminal path All essential nodes must lie on a tree path –Otherwise, one can immediately find Kuratowski subgraphs A terminal path is the shortest path in the PC-tree containing all essential nodes –The two ends of the path is called the terminal nodes (which must be essential) 14/40

15 What if there are 3 essential nodes that do not lie on a path? 3 such nodes must have a center in the tree –The center is different from any of these 3 nodes –There are 3 node-disjoint paths from the center to the 3 essential nodes The end essential nodes of these 3 paths are called extreme essential nodes 15/40

16 16/40 The 3 extreme essential nodes (I) t i w i1i1 i2i2 i3i3 Case 1. The 3 essential nodes are on the boundary of a C-node w K5K5 i1i1 i2i2 i3i3 i t

17 17/40 The 3 extreme essential nodes (II) K 3,3 w i t t i w i1i1 i3i3 i2i2 i1i1 i2i2 i3i3 Case 2. Otherwise

18 18/40 Two cases of the terminal paths Case 1 –A terminal node lies on the path between root r and another terminal node Case 2 –Otherwise r r

19 19/40 The terminal path A subtree is full (empty) if all nodes are labeled (unlabeled) If the graph is planar, there is a terminal path s. t. all full subtrees can be flipped to one side and empty subtrees to another. u u' i Full side Empty side

20 20/40 Correct Flipping of full subtrees and empty subtrees w.r.t. the terminal path The argument is very similar to that of the 3 extreme essential nodes’ case. u u' i

21 21/40 A Necessary and Sufficient Condition for a Graph to be Planar A graph is planar iff at every iteration i, there exists a terminal path –nodes on this path can be flipped so that all full subtrees lie on one side, and all empty subtrees lie on the other side without violating the cyclic order of any C- node

22 22/40 At the end of the iteration (1) um u' i Form a 2-connected component

23 23/40 Essential nodes on the boundary of a 2-connected component i essential nodes i w Note that the edge between i and a terminal node could be “virtual”

24 24/40 Connecting to the new C-node PP 154278 6 3 P P 154278 6 3

25 25/40 At the end of the iteration (2) um u' i w

26 26/40 The Boundary for each C-node u u' u u

27 27/40 The Outer Boundary for each C-node (recognition) u u' u

28 28/40 The Inner Boundary for each C-node (embedding) u u' u

29 29/40 At the end of the Iteration (3) Get a 2-connected component involving i Create a C-node for i representing this component Determine all essential nodes on the boundary of this C-node (the boundary cycle) –Such a boundary cycle is important for actual implementation

30 30/40 Our edge addition approach compared to the vertex addition of LEC (Bush form) In the Bush form, the nodes of the graph are at the leaves of the PQ-tree. –Internal nodes are used for permutation But, in our PC-tree, every P-node is an original node (C-nodes are components) –PC-tree more faithfully represent the partial embedding In order to use the Bush form, an s-t numbering has to be calculated and the graph must be 2-connected.

31 31/40 Our Approach -- Edge addition Start with a Depth-First-Search Tree (with post ordering) 16 14 15 7 6 12 5 10 8 11 13 9 1 3 4 2 1 2 4 3 C1C1 3 1 4 5 6 7 8 9 10 11 12 13 14 15 16 8 C2C2 10 13 12 C3C3 3 4

32 32/40 How do we traverse through a C-node (around the cycle) Conceptually easy, if every node has a parent, but this could take O(n 2 ) time due to frequent parent change In reality, for linear time implementation, we only keep two parent pointers i i

33 33/40 A virtual PC-Tree The original PC-tree implementation in which every essential node has a parent would require O(n 2 ) time –Their parents change very often In a linear time implementation, we shall traverse the boundary cycle to find the parent –only keep parent pointers for the two neighbors of i in the boundary cycle. –Charge the traversal to 1.Tree edge traversal 2.Boundary link traversal (FIND operation)

34 34/40 1. C-node Traversing (parent-finding) charged to edges embedded inside i One of the neighbors of i must be embedded inside. After the traversal, # of nodes to be embedded inside is  the smaller half of the boundary cycle Parallel Search from the entering node Note that, the root node r is never embedded outside

35 35/40 How many times can an edge be traversed? An edge embedded inside A boundary link A tree edge An edge embedded inside

36 36/40 2. C-node Labeling How do we know if a C-node is full? –i.e. all of its children are full When a child is full, how does it report to the corresponding C-node? –If it does not have a parent pointer, FIND parent using parallel search. After the search, give parent pointer for every node along the search path. Concatenate the search path if additional FIND is necessary –This works because full children should be consecutive in the boundary cycle and include a neighbor of i –Erase the parent pointers at the end of the iteration

37 37/40 Complexity Tree edge traversal for labeling O(n) –Each original edge traversed either is embedded inside or becomes a boundary link Boundary Link traversal O(n) –For every 2q links traversed, there exist at least q links embedded inside (through parallel search) Total running time = Tree edge traversal + Link traversal = O(n)

38 38/40 A Necessary and Sufficient Condition for a Graph to be Planar A graph is planar iff at every iteration i, there exists a terminal path s.t. –nodes on this path can be flipped so that all full subtrees lie on one side, and all empty subtrees lie on the other side without violating the cyclic order of any C- node


Download ppt "S&H Planarity Test Based on PC-Trees Wen-Lian Hsu."

Similar presentations


Ads by Google