Conventions Red edges: traversed tree edges White edges: back edges

Slides:



Advertisements
Similar presentations
CS 171: Introduction to Computer Science II
Advertisements

Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
CS 206 Introduction to Computer Science II 11 / 09 / 2009 Instructor: Michael Eckmann.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Tirgul 7 Review of graphs Graph algorithms: – BFS (next tirgul) – DFS – Properties of DFS – Topological sort.
2/10/03Tucker, Sec Tucker, Applied Combinatorics, Sec. 3.2, Important Definitions Enumeration: Finding all of the possible paths in a rooted tree.
Binary Trees Chapter 6.
Trees and Tree Traversals Prof. Sin-Min Lee Department of Computer Science San Jose State University.
1 PQ Trees, PC Trees, and Planar Graphs Hsu & McConnell Presented by Roi Barkan.
A Test for the Consecutive Ones Property 1/39. Outline Consecutive ones property PQ-trees Template operations Complexity Analysis –The most time consuming.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
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.
Finding maximal planar subgraphs Wen-Lian Hsu 1/33.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
S&H Planarity Test Based on PC-Trees Wen-Lian Hsu.
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.
Trees CSIT 402 Data Structures II 1. 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
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)
Graphs A New Data Structure
IOI/ACM ICPC Training 4 June 2005.
CSCE 210 Data Structures and Algorithms
AA Trees.
Thinking about Algorithms Abstractly
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
Csc 2720 Instructor: Zhuojun Duan
Applied Combinatorics, 4th Ed. Alan Tucker
12. Graphs and Trees 2 Summary
Binary Trees "A tree may grow a thousand feet tall, but its leaves will return to its roots." -Chinese Proverb.
Data Structures & Algorithm Design
Week 11 - Friday CS221.
i206: Lecture 13: Recursion, continued Trees
Binary Tree and General Tree
Data Structures and Database Applications Binary Trees in C#
Depth-First Search.
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
TREES General trees Binary trees Binary search trees AVL trees
CS120 Graphs.
CSCE 411 Design and Analysis of Algorithms
Spanning Trees Longin Jan Latecki Temple University based on slides by
Lecture 10 Algorithm Analysis
CSCE350 Algorithms and Data Structure
Graphs Chapter 13.
Elementary graph algorithms Chapter 22
B- Trees D. Frey with apologies to Tom Anastasio
Topic 18 Binary Trees "A tree may grow a thousand feet tall, but its leaves will return to its roots." -Chinese Proverb.
Lecture 13 CSE 331 Oct 1, 2012.
Lectures on Graph Algorithms: searching, testing and sorting
Elementary Graph Algorithms
Trees CMSC 202, Version 5/02.
A Robust Data Structure
CMSC 202 Trees.
Applied Combinatorics, 4th Ed. Alan Tucker
Spanning Trees Longin Jan Latecki Temple University based on slides by
Subgraphs, Connected Components, Spanning Trees
Lecture 12 CSE 331 Sep 26, 2011.
Breadth-First Search L0 L1 L2 C B A E D F Breadth-First Search
Chapter 20: Binary Trees.
Spanning Trees Longin Jan Latecki Temple University based on slides by
Elementary graph algorithms Chapter 22
3.2 Graph Traversal.
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Lecture 15 CSE 331 Oct 4, 2010.
Lecture 11 Graph Algorithms
8.2 Tree Traversals Chapter 8 - Trees.
GRAPH TRAVERSAL.
Presentation transcript:

Conventions Red edges: traversed tree edges White edges: back edges Dotted edges: paths C-node: double circle

Preprocessing – the DFS Tree 7 9 8 6 2 5 1 4 3 DFS Scan the Graph. The edges of G are split into tree edges and “back edges”. (Reminder: Those non-tree edges connect vertices with their ancestors.) Label the Vertices According to a Post-Order Traversal of the DFS-Tree Keep a List of Back-Vertices, Sorted in Ascending (Post-)Order 4 4 A back edge (4, 1) is defined by a vertex 1 to one of its ancestors 4, which is referred to as the back-ancestor of 1. 1 is called the back-descendant of 4. O X 3 3 2 2 1 1

Back Edge Traversal (BET) At iteration i, 1≦i≦n, the traversal is from node i via all back edges connecting i to its back-descendants and then through the tree edges of the PC-tree T back to node i. The BET stops if a node marked at the same iteration has already been visited. i i g f g stop f d e d e b b a a stop c stop c t t stop

The i-component For a traversed child r of i, let the traversed subtree rooted at r be Tr*=(vr*,er*) and Tr,i*= Tr*∪(r, i). (Red Edges) The back edges from the nodes of Tr,i* to node i is denoted by βr,i. (green edges) The bi-connected subgraph Br,i=Tr,i*∪βr,i is called an i-component. f i t b c d r e g

Delayed Planarity Test In MPS, one cannot use the information of future back edges at each iteration Cannot determine all essential nodes Cannot determine all terminal nodes Cannot compute complete separating paths Delayed Planarity Test Determine everything partially as much as we can

How do we construct a data structure to “maintain” a partial terminal path? Start with any essential node on the path and grow a tree from this node This tree should contain all traversed edges in Tr*. This tree is called the BFS-Tree of this component.

Revisit Theorem 1 Theorem 1 is satisfied if (1) There is a terminal path for every i-component and (2) full subtrees can be permuted to the inner face and empty subtrees can be permuted to the outer face.

Deferred Planarity Test

Our Strategy Traverse the graph through back edges (BET). Keep the components traversed at iteration i and leave the determination of the essential nodes at later iterations. For an i-component, use a BFS-tree to manage the partial planar embedding. Theorem 1 should always be satisfied in the traversed subgraph (The terminal path + The correct permutation).

Different stages of a component All back edges of the component are traversed Vertices and edges of the component are determined The first essential node is encountered A C-node and its BFS-tree is constructed Its terminal path is gradually extended Note that its boundary nodes can be shared with other components

Traverse the first component A node label Lt for node t, Lt =<i, true / false >, consists of two parameters. The first parameters is used to indicate the latest iteration when t is traversed. The second is to check if there is already a C-node representing the i-component which contains t. label response <i, false> i <null, false> <i, false> <i, false> stop <i, false> stop <i, false> <i, false> <i, false>

Revisit “essential nodes” j f b c d r e g i j r i g t r e c b g t d f e c b d f A node of an i-component is said to be an essential node if it is touched by a BET at some later iteration j (j>i).

The Terminal Path If there is a path in Tr,i* connecting all essential nodes, the path is called the terminal path. The two end nodes of the terminal path are called the terminal nodes i g f d e b a c t Node f and e are the two terminal nodes. If there is a planer embedding, node i and the essential nodes should be placed on the boundary.

Creating the first C-node when every node is a P-node

Creation of C-Nodes j i j i Bidding

Creating the first C-node j j <j, false> j <i, false> i i i w <j, false> <i, false> <i, true> stop stop <i, false> t t t <j, false> <i, false> <i, true> <j, false> <j, false> <j, false> <i, false> <i, true> <j, false> <j, false> <j, false> <i, false>, i<j label response Create a new C-node

BFS-Tree Reorganizing the component based on node t Suppose we have the first essential node t for an i-component. One can change the root from r to t i r g t i t b c r i g e c b e r d f d c b f t Tr* is called the BFS-tree of Br,i after changing the root to the first essential node t simply because breadth-first search (BFS) is used to change the parent pointers of the nodes of Tr*.

Artificial Edge An edge that acts as a bridge from c to i encapsulating its internal structure to facilitate future BET efficiently j c i The AEεc,i i c i τb τa τc a b c t τc + The back edges to i A boundary path (CP) is the path consisting of concrete and artificial edges in an i-component connecting two essential nodes.

The Use of Artificial Edges j Extend the path. i h d g l f b r e c t

The Terminal Path One cannot find a valid terminal path under the following two cases. Essential nodes i i g g f f d e d e b b r r c c t t (i) Three BFS-subtrees of node t contain the essential nodes. (ii) Two BFS-subtrees of an internal node contain the essential nodes.

The Creation of the C-node in General when there are both P-nodes and C-nodes in the graph

The Creation of the C-node in General The i-component contains P-nodes and C-nodes The BFS-tree may contain C-node The first essential node t can be a C-node

The BFS-tree may contain C-node Shaving the C-nodes immediately after the BFS tree is created. j i t

If the first essential node t is a C-node j j j i i i r g r g f f d e d e g b e c r w1 t b b c d c f t Children of t should be children of the C-node

The general cases II response label <i, true> k j label response i <i, true> “Find” the top-tier C-node w. w is labeled as <j, false>. k>j. Create a new C-node for the j-component. FIND w <j, false> <i, true> t’ t <j, false> <j, false> <j, false>

How Many Different Ways can We Embed the BET paths from j to a component of i j- essential nodes

Three Consecutive Traversals i, j and k to the boundary of a component of i Consider the next iteration k that we revisit the same boundary of a component of i The region to be embedded inside The region to be embedded inside i j- essential nodes The delimiters The critical segment

Deleting an old C-node (of i) and creating a new one (for j) k j k Traverse to an existing C-node for i, delete it and create a new C-node for j The region to be embedded inside

The “Find” procedure

The hierarchy of the C-nodes j j i i b d b d e e x a x a c c t t

The Hierarchy of C-nodes A node wq is said to be directly contained in a C-node wp (denoted as wp>wq), if the node wq is exactly on the traversed subtree of the component shrunk into wp. An example for w1>w2>w3 w1 w2 An essential node for w1 w3 t

The C-Node Hierarchy The boundary cycle of a C-node contains other C-nodes recursively u

The Find C-Node Operation u

Parallel Search In DPT Parallel Search from the entering node Case 1 essential nodes of previous iterations sentinel nodes The artificial edges The AE traversal The boundary traversal

Case 1 in Parallel Search Parallel Search Starts from a node on the boundary. (Same as Parallel Search in S&H) Note that, the boundary traversal crosses the AEs on the boundary directly.

Case 2 in Parallel Search Parallel Search Starts from a AE on the boundary. Those BFS-subtrees that are not allowed for future essential node are eliminated to ensure all the essential nodes of the C-node creating the AE are on its terminal path.

Future Essential nodes are consecutive m k j

Future Essential nodes are consecutive Group the set of essential nodes on each C-node by iteration Pj j A region of essential nodes Pk Pm Pm Pk Pm Pk Pk k consecutive m

How many times can an edge be traversed? An edge embedded inside A tree edge A edge in an AE A boundary link An edge embedded inside An edge embedded inside