Outlines: Graphs Part-4. Applications of Depth-First Search. Directed Acyclic Graph (DAG) Generic scheduling problem.

Similar documents
Strongly Connected Components

a g f 8 e 11 Also: Minimum degree, maximum degree, vertex of degree d 1 adjacent to vertex of degree d 2,...

CPS 616 W2017 MIDTERM SOLUTIONS 1

Minimum Spanning Trees

Analysis of Algorithms - Elementary graphs algorithms -

Analysis of Algorithms - Elementary graphs algorithms -

dy 1. If fx ( ) is continuous at x = 3, then 13. If y x ) for x 0, then f (g(x)) = g (f (x)) when x = a. ½ b. ½ c. 1 b. 4x a. 3 b. 3 c.

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Week 3: Connected Subgraphs

CS 103 BFS Alorithm. Mark Redekopp

The Equitable Dominating Graph

University of Washington Department of Chemistry Chemistry 453 Winter Quarter 2014 Lecture 20: Transition State Theory. ERD: 25.14

Addition of angular momentum

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Exponential Functions

Chapter Taylor Theorem Revisited

Minimum Spanning Trees

Abstract Interpretation: concrete and abstract semantics

Examples and applications on SSSP and MST

Lenses & Prism Consider light entering a prism At the plane surface perpendicular light is unrefracted Moving from the glass to the slope side light

AP Calculus BC AP Exam Problems Chapters 1 3

3-2-1 ANN Architecture

From Elimination to Belief Propagation

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

d e c b a d c b a d e c b a a c a d c c e b

AP Calculus Multiple-Choice Question Collection

NEW APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA

Linear Non-Gaussian Structural Equation Models

SOME PARAMETERS ON EQUITABLE COLORING OF PRISM AND CIRCULANT GRAPH.

1 Minimum Cut Problem

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1

Addition of angular momentum

PHY 410. Final Examination, Spring May 4, 2009 (5:45-7:45 p.m.)

Computing and Communications -- Network Coding

10. EXTENDING TRACTABILITY

Basic Polyhedral theory

First derivative analysis

Trigonometric functions

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

Slide 1. Slide 2. Slide 3 DIGITAL SIGNAL PROCESSING CLASSIFICATION OF SIGNALS

Case Study 1 PHA 5127 Fall 2006 Revised 9/19/06

Physics 43 HW #9 Chapter 40 Key

Network Congestion Games

Chapter 13 GMM for Linear Factor Models in Discount Factor form. GMM on the pricing errors gives a crosssectional

Supplementary Materials

CLONES IN 3-CONNECTED FRAME MATROIDS

cycle that does not cross any edges (including its own), then it has at least

CMPS 2200 Fall Graphs. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk

The Quantum Efficiency and Thermal Emittance of Metal Cathodes

ME 321 Kinematics and Dynamics of Machines S. Lambert Winter 2002

Pipe flow friction, small vs. big pipes

MAT 270 Test 3 Review (Spring 2012) Test on April 11 in PSA 21 Section 3.7 Implicit Derivative

Chapter Finding Small Vertex Covers. Extending the Limits of Tractability. Coping With NP-Completeness. Vertex Cover

Jonathan Turner Exam 2-12/4/03

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

Maximum Matching Width: new characterizations and a fast algorithm for dominating set

MCE503: Modeling and Simulation of Mechatronic Systems Discussion on Bond Graph Sign Conventions for Electrical Systems

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

Final Exam Solutions

ENGR 7181 LECTURE NOTES WEEK 5 Dr. Amir G. Aghdam Concordia University

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017

INC 693, 481 Dynamics System and Modelling: The Language of Bound Graphs Dr.-Ing. Sudchai Boonto Assistant Professor

Designing Low-Capacity Backup Networks for Fast Restoration

4.5 Minimum Spanning Tree. Chapter 4. Greedy Algorithms. Minimum Spanning Tree. Motivating application

is an appropriate single phase forced convection heat transfer coefficient (e.g. Weisman), and h

On the Use of Graph Theory for Railway Power Supply Systems Characterization

EEO 401 Digital Signal Processing Prof. Mark Fowler

Section 11.6: Directional Derivatives and the Gradient Vector

Direct Approach for Discrete Systems One-Dimensional Elements

Embeddings of Graphs of Fixed Treewidth and Bounded Degree

Where k is either given or determined from the data and c is an arbitrary constant.

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

2008 AP Calculus BC Multiple Choice Exam

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

Lagrangian Analysis of a Class of Quadratic Liénard-Type Oscillator Equations with Exponential-Type Restoring Force function

PHYSICS 489/1489 LECTURE 7: QUANTUM ELECTRODYNAMICS

Data Structures and and Algorithm Xiaoqing Zheng

Higher order derivatives

Section 2.7 Derivatives and Rates of Change Part II Section 2.8 The Derivative as a Function. at the point a, to be. = at time t = a is

Approximation and Inapproximation for The Influence Maximization Problem in Social Networks under Deterministic Linear Threshold Model

Least Favorable Distributions to Facilitate the Design of Detection Systems with Sensors at Deterministic Locations

Finite Element Models for Steady Flows of Viscous Incompressible Fluids

Depth First Search. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong

Graph Search (6A) Young Won Lim 5/18/18

Image Filtering: Noise Removal, Sharpening, Deblurring. Yao Wang Polytechnic University, Brooklyn, NY11201

State-space behaviours 2 using eigenvalues

CHAPTER 10. Consider the transmission lines for voltage and current as developed in Chapter 9 from the distributed equivalent circuit shown below.

AC64/AT64/ AC115/AT115 DESIGN & ANALYSIS OF ALGORITHMS

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis

11/13/17. directed graphs. CS 220: Discrete Structures and their Applications. relations and directed graphs; transitive closure zybooks

The Standard Model Lagrangian

Applied Statistics II - Categorical Data Analysis Data analysis using Genstat - Exercise 2 Logistic regression

Discrete Fourier Transform. Discrete Fourier Transform. Discrete Fourier Transform. Discrete Fourier Transform. Discrete Fourier Transform

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero.

International Journal of Scientific & Engineering Research, Volume 6, Issue 7, July ISSN

ENGR 323 BHW 15 Van Bonn 1/7

2.2 Derivative. 1. Definition of Derivative at a Point: The derivative of the function f x at x a is defined as

Cataloging Data : Bastrt, Olivr: Nw Idas for Canonically Computing Graph Algbras; Tchn. Univ. Munchn, Fak. f. Math, Rport TUM M9803 (98) Mathmatics Su

Combinatorial Networks Week 1, March 11-12

ENGR 7181 LECTURE NOTES WEEK 3 Dr. Amir G. Aghdam Concordia University

Transcription:

Outlins: Graps Part-4 Applications o DFS Elmntary Grap Aloritms Topoloical Sort o Dirctd Acyclic Grap Stronly Connctd Componnts PART-4 1 2 Applications o Dpt-First Sarc Topoloical Sort: Usin dpt-irst sarc to prorm topoloical sort o a dirctd acyclic rap. Stronly Connctd Componnts: Dcomposin a dirctd rap into a stronly connctd componnts usin two dpt-irst sarcs. Dirctd Acyclic Grap (DAG) Ariss in many applications wr tr ar prcdnc or ordrin constraints (.. scdulin problms) I tr ar a sris o tasks to b prormd, and crtain tasks must prcd otr tasks In nral, a prcdnc constraint rap is a DAG, in wic vrtics ar tasks and d (u, v) mans tat task u must b compltd bor task v bins. 3 4 Input: Gnric scdulin problm St o tasks T 1, T 2, T 3,, T n Exampl: ttin drssd in t mornin: put on sos, socks, sirt, pants, blt, St o dpndncis T 1 T 2, T 3 T 4, T 5 T 1, Exampl: must put on socks bor sos, pants bor blt, Want: ordrin o tasks wic is consistnt wit dpndncis Problm rprsntation: Dirctd Acyclic Grap Vrtics = tasks; Dirctd Eds = dpndncis Acyclic: i cycl o dpndncis, no solution possibl Topoloical sort o a DAG: Topoloical Sort Linar ordrin o all vrtics in rap G suc tat i d (u, v) G tn vrtx u coms bor vrtx v I t rap is not acyclic, tn no linar ordrin is possibl Topoloical sort is usul in scdulin jobs wit prcdnc In nral, tr may b many lal topoloical ordrs or a ivn DAG. Ral-world xampl: ttin drssd 5 6 1

Gttin Drssd Topoloical Sort Aloritm Undrwar Socks Pants Sos Sirt Blt Ti Jackt A possibl scdul or drssin can b: Watc Topoloical-Sort(G) 1. call DFS(G) to comput inisin tim [v] or ac vrtx v. 2. as a vrtx is inisd, insrt it onto t ront o a linkd list. 3. rturn t linkd list o vrtics. socks sirts pants blt ti jackt sos watc 7 8 DFS Aloritm Gttin Drssd DFS(G) or ac vrtx u V[G] tim = 0; or ac vrtx u V[G] i (color[u] == WHITE) ; d[u] = tim; or ac v Adj[u] i (color[v] == WHITE) [u] = tim; Undrwar Pants Blt Sirt Ti Jackt Socks Sos Watc T iur blow sows ow topoloically sortd vrtics appar in rvrs ordr o tir inisin tims Socks Undrwar Pants Sos Watc Sirt Blt Ti Jackt 17/18 11/16 12/15 13/14 9/10 1/8 6/7 2/5 3/4 9 10 Runnin Tim Stronly Connctd Componnts (SCC) Tim: O(V+E) DFS aloritm is calld onc wit a cost O(V+E) plus O(1) tim to insrt ac o V vrtics onto t ront o t linkd list 11 Diraps ar otn usd to modl communication and transportation ntworks Popl want to know tat t ntworks ar complt in t sns tat rom any location it is possibl to rac anotr location in t dirap A dirctd rap is stronly connctd i, or vry pair o vrtics u and v tr is a pat rom u to v. Not tat in a dirctd rap, t xistnc o a pat rom u to v dos not imply tr is a pat rom v to u. 12 2

Stronly Connctd Componnts (SCC) For indin stronly connctd componnts o a rap G uss t transpos o G. Givn G = (V, E), t transpos o G is G T = (V, E T ) wr E T = (u, v) : (v, u) E G and G T av xactly t sam SCCs: u and v ar racabl rom ac otr in G i ty ar racabl rom ac otr in G T Stronly Connctd Componnts (SCC) Stronly-Connctd-Componnts(G) 1. call DFS(G) to comput inis tims [u] or ac vrtx u 2. comput G T 3. call DFS(G T ) and considr vrtics in ordr o dcrasin [u], computd in stp 1 4. output vrtics o ac tr in DFS(G T ) as sparat stronly connctd componnt Atr dcomposition, t aloritm is run sparatly on ac stronly connctd componnt. T solutions ar tn combind accordin to t structur o connctions btwn componnts. Total runnin tim Θ(V + E) Sinc t tim to build G T is O(V + E) plus O(V + E) to call DFS twic 13 14 Stronly Connctd Componnts (SCC) Stp-1 o SCC STRONGLY-CONNECTED-COMPONENTS (G) 1. initializ stack S to mpty, and call DFS(G) wit t ollowin modiication: pus vrtics onto stack S in t ordr ty inis tir DFS-VISIT calls. Tat is, at t nd o t procdur DFS-VISIT(u) add t statmnt PUSH(u, S) (tr is no nd to comput d[u] and [u] valus xplicitly). 2. construct t adjacncy-list structur o G T rom tat o G. 3. call DFS(G T ) wit t ollowin modiication: initiat DFS-roots in stack-s-ordr, i.., in t main DFS aloritm prorm t ollowin: wil S φ do u = POP(S) i color[u] = wit tn DFS-VISIT(u) nd wil 4. ac DFS-tr o stp 3 (plus all ds btwn its vrtics) orms an SCC. DFS(G) or ac vrtx u V[G] tim = 0; or ac vrtx u V[G] i (color[u] == WHITE) ; d[u] = tim; or ac v Adj[u] i (color[v] == WHITE) [u] = tim; PUSH(u, S); 15 16 Stp-3 o SCC Exampl: Grap G DFS(G T ) or ac vrtx u V[G] tim = 0; wil S φ do u = POP(S) i color[u] = wit tn DFS-VISIT(u) d[u] = tim; or ac v Adj[u] i (color[v] == WHITE) [u] = tim; 17 18 3

Stp 1 : DFS(G) Stp 2 : G T 19 20 Stp 3 : DFS(G T ) Stp 4 : SCC o G 21 22 Stronly Connctd Componnts Book Exampl: G a 1 18 d 14 17 15 16 b 2 13 5 12 6 11 i 7 10 8 9 c 3 4 b a c d a b c d 13/14 11/16 1/10 8/9 12/15 3/4 2/7 5/6 23 24 4

Book Exampl: G T Book Exampl: SCCs o G b a b c d a c d 13/14 11/16 12/15 3/4 1/10 8/9 2/7 5/6 ab cd 25 26 Componnt DAG T main ida coms rom t componnt rap G SCC = (V SCC, E SCC ) Suppos tat G as k SCC C 1, C 2,, C k V SCC = v 1, v 2,, v k : vrtx v i or ac C i (v i, v j ) E SCC i G contains a dirctd d (x, y) or som x C i and y C j Componnt DAG I w mr t vrtics in ac SCC into a sinl supr vrtx, and join two supr vrtics C i and C j i tr ar vrtics v i C i and v j C j suc tat (v i, v j ) E, tn t rsultin dirap, calld t componnt dirap, is ncssarily acyclic. 27 28 5