Accepting that the simple base case of a sp graph is that of Figure 3.1.a we can recursively define our term:

Similar documents
Chapter 6. Planar Orientations. 6.1 Numberings of Digraphs

Elementary Planar Geometry

Mathematics Background

Geometry Vocabulary Math Fundamentals Reference Sheet Page 1

Treewidth and graph minors

Measuring Triangles. 1 cm 2. 1 cm. 1 cm

Lecture 3: Art Gallery Problems and Polygon Triangulation

Nesting points in the sphere. Dan Archdeacon. University of Vermont. Feliu Sagols.

GEOMETRY. Background Knowledge/Prior Skills. Knows ab = a b. b =

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system

CS6100: Topics in Design and Analysis of Algorithms

a triangle with all acute angles acute triangle angles that share a common side and vertex adjacent angles alternate exterior angles

0613ge. Geometry Regents Exam 0613

Geometry. Name. Use AngLegs to model each set of shapes. Complete each statement with the phrase "is" or "is not." Triangle 1 congruent to Triangle 2.

Drawing Outer 1-planar Graphs with Few Slopes

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

STRAIGHT LINE ORTHOGONAL DRAWINGS OF COMPLETE TERNERY TREES SPUR FINAL PAPER, SUMMER July 29, 2015

Point A location in geometry. A point has no dimensions without any length, width, or depth. This is represented by a dot and is usually labelled.

Notation Index. Probability notation. (there exists) (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5.

Graph Theory Questions from Past Papers

Geometry. (1) Complete the following:

Figure 4.1: The evolution of a rooted tree.

Geometry - Study Guide for Semester 1 Geometry Exam Key

Course Number: Course Title: Geometry

Vocabulary: Looking For Pythagoras

Notation Index 9 (there exists) Fn-4 8 (for all) Fn-4 3 (such that) Fn-4 B n (Bell numbers) CL-25 s ο t (equivalence relation) GT-4 n k (binomial coef

Algorithms for Graph Visualization

202 The National Strategies Secondary Mathematics exemplification: Y7

Geometry Cheat Sheet

Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points.

Grade 9 Math Terminology

Planar Octilinear Drawings with One Bend Per Edge

Lesson 13: Angle Sum of a Triangle

On Multi-Stack Boundary Labeling Problems

Graphs with no 7-wheel subdivision Rebecca Robinson 1

Приложение 34 к приказу 949 от 29 сентября 2017 г. MOSCOW AVIATION INSTITUTE (NATIONAL RESEARCH UNIVERSITY)

The statement implies that any three intersection points of two distinct planes lie on a line.

Chapter 5. Transforming Shapes

NAME: DATE: PERIOD: 1. Find the coordinates of the midpoint of each side of the parallelogram.

4-1. Classifying Triangles. Lesson 4-1. What You ll Learn. Active Vocabulary

Elements of Graph Theory

Midpoint and Distance Formulas

Grade 7/8 Math Circles Fall Nov.4/5 The Pythagorean Theorem

Geometry End of Course Review

Unit 1, Lesson 1: Moving in the Plane

POTENTIAL REASONS: Definition of Congruence:

Level 4 Students will usually be able to identify models of and/or solve problems involving multiplication and/or division situations; recognize and/o

Big Ideas Chapter 4: Transformations

7. 2 More Things Under. Construction. A Develop Understanding Task

I can position figures in the coordinate plane for use in coordinate proofs. I can prove geometric concepts by using coordinate proof.

GRADES 9/10. EALR 1: The student understands and applies the concepts and procedures of mathematics.

no triangle can have more than one right angle or obtuse angle.

Geometry- Unit 6 Notes. Simplifying Radicals

SOLIDS.

Videos, Constructions, Definitions, Postulates, Theorems, and Properties

MATH 113 Section 8.2: Two-Dimensional Figures

Lines Plane A flat surface that has no thickness and extends forever.

CK-12 Geometry: Similar Polygons

The angle measure at for example the vertex A is denoted by m A, or m BAC.

Basic Triangle Congruence Lesson Plan

Graph Crossing Number and Isomorphism SPUR Final Paper, Summer 2012

Chapter 4 Triangles: Congruency & Similarity

UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI. February 7, 2009 Second Round Three Hours

Introduction to Geometry (Autumn Tertm 2012) Exercises 3. Section A. Figure 1

Unit 10 Study Guide: Plane Figures

Line Arrangement. Chapter 6

SM 2. Date: Section: Objective: The Pythagorean Theorem: In a triangle, or

Good Luck Grasshopper.

Canonical Forms and Algorithms for Steiner Trees in Uniform Orientation Metrics

Delaunay Triangulations. Presented by Glenn Eguchi Computational Geometry October 11, 2001

Junior Cert Ordinary Level Paper 1

Moore Catholic High School Math Department

terms, postulates, and notation segment and angle measurement basic constructions

Integrated Math B. Syllabus. Course Overview. Course Goals. Math Skills

Grade 6 Mathematics Item Specifications Florida Standards Assessments

TEACHER: Nelson/Ryalls/Ragan COURSE _Geometry I & II Curriculum Map

Graph Drawing e tecniche algoritmiche avanzate

2. For the statement above, write either bi-conditional or give a counterexample.

Developmental Math An Open Program Unit 7 Geometry First Edition

CONNECTED SPACES AND HOW TO USE THEM

6th Grade ~ Conceptual Foundations for Unit of Study 8 Geometry DRAFT 6/30/11 Geometry (Spatial Sense & Reasoning) 1. Shapes, Solids and Properties

INTRODUCTION TO THE HOMOLOGY GROUPS OF COMPLEXES

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

Geometry. Cluster: Experiment with transformations in the plane. G.CO.1 G.CO.2. Common Core Institute

Glossary Common Core Curriculum Maps Math/Grade 6 Grade 8

Preparing High School Geometry Teachers to Teach the Common Core

Testing Maximal 1-planarity of Graphs with a Rotation System in Linear Time

Unit 3, Activity 3, Distance in the Plane Process Guide

Shapes & Transformations and Angles & Measurements Spatial Visualization and Reflections a.) b.) c.) d.) a.) b.) c.)

Measurement and Geometry (M&G3)

Discrete Mathematics I So Practice Sheet Solutions 1

Curriki Geometry Glossary

4 Fractional Dimension of Posets from Trees

INTRODUCTION TO GRAPH THEORY. 1. Definitions

GEOMETRY REVIEW PACKET

Face Width and Graph Embeddings of face-width 2 and 3

Triangle Congruence Packet #3

Smarter Balanced Vocabulary (from the SBAC test/item specifications)

Transcription:

Chapter 3 Series Parallel Digraphs Introduction In this chapter we examine series-parallel digraphs which are a common type of graph. They have a significant use in several applications that make them interesting to examine. Using sp graphs we can successfully visualize flow diagrams, dependency charts, and PERT networks. In the current document we give some preliminary information about series parallel digraph, how it can be constructed and finally we present two algorithms one for drawing sp digraphs and another for labelling the decomposition tree s nodes. A sp-graph is first of all a planar graph. As we can conclude of its name, it is a graph with serial and parallel components. In the real world a suitable representation is that of digital design circuits where logical AND gates imply series composition and OR gates parallel. 3.1 Definitions Accepting that the simple base case of a sp graph is that of Figure 3.1.a we can recursively define our term: If G 1,., G n are sp digraphs so are the graphs obtained by the following operations: 1. The series composition of digraphs G 1,, G n with sources s 1,., s n and sinks t 1,..,t n by identifying the sink t i with the source s i+1 where 1= i < k (Figure 3.1.d). 2. The parallel composition of digraphs G 1,, G n with sources s 1,., s n and sinks t 1,..,t n by identifying s 1,., s n into a single vertex s and identifying t 1,..,t n into a single vertex t (Figure 3.1.e). The above definition can be understood in detail by studying Figure 3.1. In this figure we construct the parallel composition of the base case by joining the sources at the bottom and sinks at the top (see Figure 3.2.b). Similarly we construct the series composition by joining the source with the sink of the two base case graphs. In a same way we can compose more complex graphs like Figure 3.1.d and Figure 3.1.e cases. G 1 G 2 or G 1 G 2 (a) (b) (c) (d) (e) Figure 3.1: Recursive construction of sp graphs: (a) simple-base case, (b) parallel composition of (a), (c) series composition of (a), (d) general case series composition, (e) general case parallel composition

k j The composition operation is a divide and conquer technique. Our problem requires more complexity at the divide part. This is better explained below. Here we adopt the upward drawing without multiple edges. So the source appears at the bottom and the sink at the top of the drawing as we can see at Figure 3.1. Only the graph in Figure 3.1.b doesn t satisfy this condition and we won t use it again. The sink and source of a series-parallel graph are also called poles. 3.2 Decomposition of a Series Parallel Digraphs We are now called to analyse the inverse operation of decomposing a series-parallel digraph. To do this we use a decomposition tree also called parse tree. Suppose we have a series parallel graph G and its decomposition tree T. We assume that graphs are simple: with no self loops and multiple edges. In this tree there are exist three types of nodes: s-nodes to depict series composition, p-nodes for parallel composition and q-nodes for terminal base cases (see Figure 3.4). Its leaves are always q-nodes while the internal nodes are either p-nodes or s- nodes. An example of a graph s decomposition is given in Figure 3.2. f n f n d e m d e m l l b c b c k i j j i a h a h (a) G 1 (b) G2 G 6 n G 5 m l G 7 l G 10 l G 4 k G 12 k k G 8 j G 9 i j i G 11 i h G 3 (c) (d) Figure 3.2: Decomposition of a sp graph (e)

In the previous figure we see a sp digraph and its decomposition. We don t provide the whole decomposition, only a representative part of it, the right graph G 2. Starting from the graph s source we separate it into two components according to its composition type. In the current example we break it in the pieces seen in Figure 3.2.b as it has been generated from a parallel composition. The new right component (G 2 ) derives from a series composition. The components that have not resulted in the base case sp graph are further decomposed in the following figures (Figure 3.2.d, Figure 3.2.e). The decomposition that follows uses also decomposition sub-trees for every component-graph. The operation is terminated when all the sp graphs produced by decomposition, are basic-simple (see Figure 3.1.a). The complexity required for the final result is O(n). 1 2 Figure 3.3: Closed and Open components After constructing the decomposition tree there are two types of components which are defined as follow. If C is a maximal path of nodes of T of the same type, and let µ 1,, µ k are the children of the nodes of C that are not on C, from left to right. A closed component of G is either G or the composition of the series parallel digraphs associated with a subsequence µ i,,µ j, where 1< i = j < k and C consists of s-nodes. An open component of G is either G or the composition of the series-parallel digraphs associated with a subsequence µ i,,µ j, minus its poles where 1= i = j = k. A component is either an open or a closed component. In the previous figure we can see an open and a closed component. Rectangle 1 describes a closed component that consists of a series composition of two sp digraphs. On the other hand rectangle 2 describes an open component consisting of a series of nodes except its poles.

P S S a P f h P m n S S S S b d c e i k j l Figure 3.4: The decomposition tree of the sp graph displayed in Figure 3.2.a To construct the decomposition tree we start from graph s source. By examining the composition that has used this node we conclude to root s type. This means that we think backwards at the composition stage where we had conjunction of two nodes in one (series) or creation of a new node and joining of two nodes in the one new (parallel). So depending on the origin of the node we give him its type. In the figure s example the source of the graph comes from a parallel composition by joining the two sources of sp graphs into a new one. Therefore the root of our tree is a p-node. As for its children, they are sub trees that are examined in the same way. So we conclude that the right sub-tree represents a series composition of the graph. Following the same algorithm we analyse the graph as far as we find q-nodes, always according to the definition of the sp graph. 3.3 An algorithm for Drawing Series Parallel Digraphs The previous operations of decomposition in sp graphs provide us with the decomposition tree T which has all the necessary information of sub sp graphs and the compositions between them. This fact gives us the ability to draw the graph from scratch having as sole input its decomposition tree T. In practice, it happens some series-parallel graphs to require exponential area for their straight line upward drawing. In this case there is a need to change its embedding. Having the components of the whole graph we can choose another embedding that serves our purposes. We will use the algorithm? -SP Draw to provide us with a drawing of O(n 2 ) area. To do this we consider the decomposition s tree components. The algorithm uses as basic characteristic a right-angled isosceles triangle (Figure 3.5), inside which there is the drawing of our series parallel graph. So every series parallel graph can be illustrated inside this triangle.

Figure 3.5: a right-angled isosceles triangle This operation is better understood by starting from the simplest case and continuing using a recursive approach. The way the graphs are put into the bounds of triangle is shown in Figure 3.6. parallel (a) (b) (c) (d) Figure 3.6: applications of algorithm? -SP Draw We place the transitive edge along the hypotenuse as we want a right pulsed embedding. While drawing a simple-base sp digraph we just put the edge onto the hypotenuse with the source at the bottom and the sink at the top. In order to have a parallel composition of two graphs (Figure 3.6.b) we have the placement of Figure 3.6.c. Note that the transitive edge is always on the right. The result appears at Figure 3.6.d. A more general case of parallel composition is illustrated in Figure 3.7.

t t 1 G 1 v t 2 parallel G 1 G 2 legal area u G 2 s 1 s 2 s Figure 3.7: A more general parallel composition of sp digraphs In the general case of the parallel composition the result is also in a special triangle. As it happens in every parallel composition the s (source node) of this triangle is the joint of s 1 and s 2 and t (sink) is the joint of t 1 and t 2. An additional constraint that we should notice, is to place the G 2 somewhere in the legal area so that we won t have any cross edges. In series composition the two triangles are put next to each other as in Figure 3.8. They share a node which is the source of the top graph and the sink of the bottom. The result of this composition is a new triangle with sink the sink of the top and source the source of the bottom. To complete the rest of the shape we extend the two sides of the triangles. G 1 G 1 series G 2 G 2 (a) (b) Figure 3.8: Series composition

All the operations that we have mentioned are applied in the below algorithm that gives us the drawing of any sp graph in a right-angled isosceles triangle.? SP Draw Input: a series parallel digraph G Output: a strictly upward planar straight line grid triangle G of G 1. Compute a decomposition tree T of G. 2. Modify the embedding of G into a right-pushed embedding and perform the corresponding modifications on T. 3. If G consists of a single edge (base case sp graph), it is drawn as a vertical segment of length 2, with bounding triangle having width 1 (see Figure 3.6.a) 4. If G is the series composition of G 1 and G 2, the two drawings G 1 and G 2 of G 1 and G 2 are first recursively produced (divide). Then (conquer), G is drawn by translating G 2 so that the sink of G 1 is identified with the source of G 2 (see Figure 3.8). The bounding triangle?(g) is obtained by extending the bottom side of?(g 1 ) and the top site of?(g 2 ). 5. If G is the parallel composition of G 1 and G 2. The two drawings G 1 and G 2 of G 1 and G 2 are first recursively produced (divide). Then (conquer), we consider the rightmost edges (s 1, u) and (v, t 1 ) incident on the source and sink of G 1, respectively (see Figure 3.7). The G 2 drawing should be put between the line of the legal area, the line through u that is parallel to the bottom side of the bounding triangle G 1, the line through v that is parallel to the top side of the triangle of G 1 and the hypotenuse of G 1. Then, we identify the sources and sinks of G 1 and G 2 by moving them to the intersections s and t of the base of?(g 2 ) with the lines extending the top and bottom sides of?(g 1 ), respectively. In the third step the length of the hypotenuse is 2 so that the area of the triangle will be 1 ((hypotenuse * height) / 2). After we have computed the decomposition tree of the sp graph G, which is algorithm s input we work on the root of T. If this node is a q-node (G consists of a single edge) the algorithm returns. In any other case there is a recursive call of the algorithm with argument first the right child and then the left; this is an arbitrary order. Practically we apply the algorithm on the two or more sub-trees of the root. Following the same procedure for each sub-tree we draw first simple sp graphs and then more complex. The final output when every procedure returns is the required G drawing. For better understanding an example is provided next. Suppose that we have as input the digraph of Figure 3.2.a. The execution of the algorithm until a depth will be as follows: 1. First we construct the decomposition tree shown in Figure 3.4 2. At the current example our graph has no transitive edge so this step is never executed. 3. It s not this case so we pass at step 5 Recursive call of the algorithm for graph G 2 and G 1 1. decomposition tree of G 2 2.. 3. not this case 4. it is a series call algorithm for G 3, G 4, G 5, G 6

1. decomposition tree of G 3 2.. 3. draw the triangle, return (Figure 3.9.a) 1. decomposition tree of G 4 2... 3. not this case 5. it is a parallel composition call algorithm for G 7, G 8. 1. decomposition tree of G 7 2... 3. not this case 4. it is a series call algorithm for G 9, G 10 1. decomposition tree of G 9 2. 3. draw the triangle, return (Figure 3.9.b) 1. decomposition tree of G 10 2.. 3. draw the triangle, return (Figure 3.9.c) conquer step series draw of triangle (Figure 3.9.d) 1. decomposition tree of G 8 2... 3. not this case 4. it is a series call algorithm for G 11, G 12 1. decomposition tree of G 11 2. 3. draw the triangle, return (Figure 3.9.e) 1. decomposition tree of G 12 2.. 3. draw the triangle, return (Figure 3.9.f)... G 3 G9 G 10 G 10 G 11 G 11 G 12 G 9 G 12 (a) (b) (c) (d) (e) (f) (g) Figure 3.9: Steps of the algorithm

G 10 G 11 G 9 G 12 Figure 3.10: Parallel composition of two sp digraphs... G 3 Figure 3.11: Final? -SP Draw of our graph G The above figures describe the algorithm steps to the final output in Figure 3.11.

The correct operation of the algorithm guarantees the following invariants of every right angled triangle? (G). Invariants a. The graph s drawing is contained into the triangle without filling its critical vertex (right-angled). Moreover the embedding is constructed in a way such that has the transitive edges on the right just like the hypotenuse of the triangle. b. The source is depicted by the bottom vertex of the triangle whereas the sink by the top. c. For any adjacent vertex to the source there should be satisfied a condition: the wedge with vertex in this node and rays with slopes p/2 and p/4 does not contain any vertex of G except s. (see Figure 3.12.a) d. A similar condition should be satisfied for the sink t of G too. In this case the wedge will have rays with slopes p/2 and p/4. (see Figure 3.12.a) t t u 1 u 2 s s l u2 (a) (b) l u1 Figure 3.12: Properties of nodes adjacent to poles Lemma 3.1 Let u 1 and u 2 be neighbours of the source vertex s, such that edge (s, u 1 ) is to the left of edge (s, u 2 ), and let l u1 and l u2 be the rays of slope p/4 originating at u 1 and u 2, respectively. If Invariant (c) holds, then l u1 is below l u2. Proof. Invariant (c) says that the wedge seen at Figure3.12.a contains only vertex s. This means that the rays with slopes -p/4 of both u 1 and u 2 are parallel. So one of them will be above the other. The one that will be above is that of the most right vertex(u 2 ) since otherwise u 2 would be contained into the wedge of u 1 and invariant (c) would hold. It is interesting to see how the sp graph s invariants are preserved during the compositions. It is obvious why the two first invariants always hold in both kinds of composition.

In series composition invariants (c) and (d) are satisfied since the poles of the composed drawing remain intact. This is because the source of the new drawing is the source of one of the olds and the sink is the sink of the other old. Therefore the properties of the poles are inherited from the components drawings, since the adjacent vertices in both poles are the same as before. In parallel composition these invariant are guaranteed by the correct placement of the right graph inside the bounds. This allowable area is better described by Figure 3.7, where u and v are the rightmost vertices which are adjacent to the source and the sink respectively. So invariants (c) and (d) are satisfied. However this bounded area where we can put the right graph in a parallel composition should be better defined. This purpose serves the? -SP-Label algorithm. A simple idea is put the G 2 so that the right angled vertex of it to be somewhere across the hypotenuse of G 1.This doesn t produce any problem since that vertex is never occupied by any node. Using this technique we result in a drawing with O(n 2 ) area, as it derives from the triangle s properties. Considering now the recursive operation of the? SP Draw algorithm in a graph G we reach the following theorem. Theorem 3.1 Let G be a series parallel digraph with n vertices. Algorithm?-SP Draw produces a strictly upward planar straight-line grid drawing of G with O(n 2 ) area such that isomorphic components of G have drawings congruent up to a translation. The algorithm that follows computes some parameters of the nodes of a decomposition tree that will allow us to specify the appropriate and exact placement of the components represented by these nodes, during a composition. For more details see the algorithm that follows.? -SP-Label Input: decomposition tree of T of a series-parallel digraph G Output: labeling of each sub-trees of T with values b, b, and b 1 if the root of T is a Q-node 2 then 3 b(t) = b (T) = b (T) = 2 (see Figure 3.13.a) 4 else 5 let T 1 and T 2 be the left and right sub-trees of T, respectively 6 for each i=1, 2 do 7?-Sp-Label(T i ) 8 if the root of T is an S-node (see Figure 3.13.c) 9 then 10 b(t) = b(t 1 )+ b(t 2 ) 11 b (T) = b (T 1 ) 12 b (T) = b (T 2 ) 13 else (the root of T is a P-node) 14 b(t) = b(t 1 )+ b(t 2 ) + 2D x (see Figure 3.13.b) 15 if T 2 is a Q-node (transitive edge) 16 then 17 b (T) = b (T) = b(t) 18 else 19 b (T) = b(t 1 ) + 2D x D y + b (T 2 ) 20 b (T) = b (T 2 ) + D y

The algorithm works recursively starting from the root of the decomposition tree T that takes as input. Its role is to label every node of this tree according to its type. Therefore if the node of the root of the tree that examines each time is a q-node it labels this node giving him value 2 in all of it s parameters. These parameters are defined through the Figure 3.13. t b, b '', b ' t 1 t 2 b '' (a) v b(t 1 ) b(t) T T 2 b(t 2 ) 1 D x T 1 b(t 1 ) u Dy s 1 s 2 b ' b(t) T 2 b(t 2 ) s (c) (b) Figure 3.13: (a) Labels in q-nodes, (b) labels in p-nodes and (c) labels in s-nodes In the other cases of q-nodes or p-nodes we have different values that valuated by the geometry of our drawing. In parallel case (line 13) the equation b(t) = b(t 1 )+ b(t 2 ) + 2D x is produced by the triangle s properties: b(t) = 2*(height of T)= 2*(height of T 1 + height of T 2 + D x ). Equations in lines 19, 20 are also proofed by the geometry of our shape. By examining the way this algorithm works we can conclude the following theorem. Theorem 3.2 Algorithm?-SP Draw can be implemented to run in O(n) time and space on a series parallel digraph with n vertices.