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

Slides:



Advertisements
Similar presentations
Interval Graph Test.
Advertisements

Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Convex drawing chapter 5 Ingeborg Groeneweg. Summery What is convex drawing What is convex drawing Some definitions Some definitions Testing convexity.
1/44 A simple Test For the Consecutive Ones Property.
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Applications of graph traversals
AA Trees another alternative to AVL trees. Balanced Binary Search Trees A Binary Search Tree (BST) of N nodes is balanced if height is in O(log N) A balanced.
A balanced life is a prefect life.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
1 Theory I Algorithm Design and Analysis (3 - Balanced trees, AVL trees) Prof. Th. Ottmann.
Trees and Red-Black Trees Gordon College Prof. Brinton.
Transforming Infix to Postfix
Graph Theory TreesAlgorithms. Graphs: Basic Definitions 4 n Let n be the number of nodes (stations) and e be the number of edges (links). n A graph is.
General Trees and Variants CPSC 335. General Trees and transformation to binary trees B-tree variants: B*, B+, prefix B+ 2-4, Horizontal-vertical, Red-black.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
Binary Trees Chapter 6.
1 PQ Trees, PC Trees, and Planar Graphs Hsu & McConnell Presented by Roi Barkan.
Advanced Data Structures and Algorithms COSC-600 Lecture presentation-6.
Subdivision of Edge In a graph G, subdivision of an edge uv is the operation of replacing uv with a path u,w,v through a new vertex w.
A Test for the Consecutive Ones Property 1/39. Outline Consecutive ones property PQ-trees Template operations Complexity Analysis –The most time consuming.
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
Module #19: Graph Theory: part II Rosen 5 th ed., chs. 8-9.
Discussion #32 1/13 Discussion #32 Properties and Applications of Depth-First Search Trees.
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.
Finding maximal planar subgraphs Wen-Lian Hsu 1/33.
Graphs.
15-853Page :Algorithms in the Real World Planar Separators I & II – Definitions – Separators of Trees – Planar Separator Theorem.
Introduction to Planarity Test W. L. Hsu. 2/21 Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect –Except.
VLSI Layout Algorithms CSE 6404 A 46 B 65 C 11 D 56 E 23 F 8 H 37 G 19 I 12J 14 K 27 X=(AB*CD)+ (A+D)+(A(B+C)) Y = (A(B+C)+AC+ D+A(BC+D)) Dr. Md. Saidur.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
Connectivity1 Connectivity and Biconnectivity connected components cutvertices biconnected components.
Graphs A graphs is an abstract representation of a set of objects, called vertices or nodes, where some pairs of the objects are connected by links, called.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
Chapter 10: Trees A tree is a connected simple undirected graph with no simple circuits. Properties: There is a unique simple path between any 2 of its.
Properties and Applications of Depth-First Search Trees and Forests
Hello Everyone!!! 1. Tree And Graphs 2 Features of Trees  Tree Nodes Each node have 0 or more children A node have must one parent  Binary tree Tree.
Lecture 8CSE Intro to Cognitive Science1 Interpreting Line Drawings II.
PC-Trees vs. PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Interval Graph Test Wen-Lian Hsu.
1/44 A simple Test For the Consecutive Ones Property Without PC-trees!
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
Trees CSIT 402 Data Structures II 1. 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical.
8/3/2007CMSC 341 BTrees1 CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
Red-Black Trees an alternative to AVL trees. Balanced Binary Search Trees A Binary Search Tree (BST) of N nodes is balanced if height is in O(log N) A.
1 Trees. 2 Trees Trees. Binary Trees Tree Traversal.
PC-Trees Based on a paper by Hsu and McConnell. Talk Outline We Define the consecutive ones and circular ones problems We show PQ Trees – the traditional.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Breadth-First Search (BFS)
Leftist Trees Linked binary tree.
Algorithms and Networks
CSCE 210 Data Structures and Algorithms
AA Trees.
Multiway Search Trees Data may not fit into main memory
Conventions Red edges: traversed tree edges White edges: back edges
PC trees and Circular One Arrangements
Binary Trees, Binary Search Trees
Planarity Testing.
B- Trees D. Frey with apologies to Tom Anastasio
B- Trees D. Frey with apologies to Tom Anastasio
Lectures on Graph Algorithms: searching, testing and sorting
Elementary Graph Algorithms
B- Trees D. Frey with apologies to Tom Anastasio
Binary Trees, Binary Search Trees
CS 261 – Data Structures Trees.
Binary Trees, Binary Search Trees
Data Structures Using C++ 2E
Presentation transcript:

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

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/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/40 Our Approach -- Edge addition Start with a Depth-First-Search Tree (with post ordering)

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

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

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/40 Adding the set of back edges connecting to a new vertex at each iteration Work on each branch separately

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/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/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/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

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

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

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/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/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/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/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/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/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/40 At the end of the iteration (1) um u' i Form a 2-connected component

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/40 Connecting to the new C-node PP P P

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

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

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

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

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/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/40 Our Approach -- Edge addition Start with a Depth-First-Search Tree (with post ordering) C1C C2C C3C3 3 4

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/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/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/40 How many times can an edge be traversed? An edge embedded inside A boundary link A tree edge An edge embedded inside

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/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/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