Ma/CS 6b Class 1: Graph Recap

Similar documents
Ma/CS 6b Class 1: Graph Recap

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence

Presentation Martin Randers

COMP 423 lecture 11 Jan. 28, 2008

What are suffix trees?

COMBINATORIAL PATTERN MATCHING

Notes for Graph Theory

1.5 Extrema and the Mean Value Theorem

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

MTH 146 Conics Supplement

CS143 Handout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexical Analysis

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. Example: Pancake Problem. Example: Pancake Problem

9 Graph Cutting Procedures

Today. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search.

Answer Key Lesson 6: Workshop: Angles and Lines

Theory of Computation CSE 105

CS201 Discussion 10 DRAWTREE + TRIES

Today. Search Problems. Uninformed Search Methods. Depth-First Search Breadth-First Search Uniform-Cost Search

Section 10.4 Hyperbolas

Union-Find Problem. Using Arrays And Chains. A Set As A Tree. Result Of A Find Operation

Suffix Tries. Slides adapted from the course by Ben Langmead

CSCI 446: Artificial Intelligence

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Fig.1. Let a source of monochromatic light be incident on a slit of finite width a, as shown in Fig. 1.

AI Adjacent Fields. This slide deck courtesy of Dan Klein at UC Berkeley

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. General Tree Search. Uniform Cost. Lecture 3: A* Search 9/4/2007

Compression Outline :Algorithms in the Real World. Lempel-Ziv Algorithms. LZ77: Sliding Window Lempel-Ziv

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?

Rational Numbers---Adding Fractions With Like Denominators.

CSEP 573 Artificial Intelligence Winter 2016

Network Interconnection: Bridging CS 571 Fall Kenneth L. Calvert All rights reserved

10.5 Graphing Quadratic Functions

Premaster Course Algorithms 1 Chapter 6: Shortest Paths. Christian Scheideler SS 2018

4-1 NAME DATE PERIOD. Study Guide. Parallel Lines and Planes P Q, O Q. Sample answers: A J, A F, and D E

From Dependencies to Evaluation Strategies

Objective: Students will understand what it means to describe, graph and write the equation of a parabola. Parabolas

The Distributed Data Access Schemes in Lambda Grid Networks

Fig.25: the Role of LEX

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

Intermediate Information Structures

CSCI1950 Z Computa4onal Methods for Biology Lecture 2. Ben Raphael January 26, hhp://cs.brown.edu/courses/csci1950 z/ Outline

CS 221: Artificial Intelligence Fall 2011

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

F. R. K. Chung y. University ofpennsylvania. Philadelphia, Pennsylvania R. L. Graham. AT&T Labs - Research. March 2,1997.

Suffix trees, suffix arrays, BWT

Typing with Weird Keyboards Notes

TO REGULAR EXPRESSIONS

Lexical Analysis: Constructing a Scanner from Regular Expressions

Chapter 4 Fuzzy Graph and Relation

Orthogonal line segment intersection

Product of polynomials. Introduction to Programming (in C++) Numerical algorithms. Product of polynomials. Product of polynomials

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):

Summer Review Packet For Algebra 2 CP/Honors

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

Finite Automata. Lecture 4 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 21, 2015

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

Lily Yen and Mogens Hansen

CS481: Bioinformatics Algorithms

Graphing Conic Sections

9.1 apply the distance and midpoint formulas

Uninformed Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 31 Jan 2012

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών. Lecture 3b Lexical Analysis Elias Athanasopoulos

Information Retrieval and Organisation

The Greedy Method. The Greedy Method

MATH 25 CLASS 5 NOTES, SEP

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

Chapter44. Polygons and solids. Contents: A Polygons B Triangles C Quadrilaterals D Solids E Constructing solids

A dual of the rectangle-segmentation problem for binary matrices

Graphs with at most two trees in a forest building process

CSCE 531, Spring 2017, Midterm Exam Answer Key

Dr. D.M. Akbar Hussain

Slides for Data Mining by I. H. Witten and E. Frank

LR Parsing, Part 2. Constructing Parse Tables. Need to Automatically Construct LR Parse Tables: Action and GOTO Table

Hyperbolas. Definition of Hyperbola

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFORMATICS 1 COMPUTATION & LOGIC INSTRUCTIONS TO CANDIDATES

10.2 Graph Terminology and Special Types of Graphs

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

Physics 208: Electricity and Magnetism Exam 1, Secs Feb IMPORTANT. Read these directions carefully:

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have

Greedy Algorithm. Algorithm Fall Semester

ZZ - Advanced Math Review 2017

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES)

Here is an example where angles with a common arm and vertex overlap. Name all the obtuse angles adjacent to

4/29/18 FIBONACCI NUMBERS GOLDEN RATIO, RECURRENCES. Fibonacci function. Fibonacci (Leonardo Pisano) ? Statue in Pisa Italy

Phylogeny and Molecular Evolution

EECS 281: Homework #4 Due: Thursday, October 7, 2004

Physics 152. Diffraction. Difrraction Gratings. Announcements. Friday, February 2, 2007

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

Quiz2 45mins. Personal Number: Problem 1. (20pts) Here is an Table of Perl Regular Ex

MATH 2530: WORKSHEET 7. x 2 y dz dy dx =

Network Layer: Routing Classifications; Shortest Path Routing

The Math Learning Center PO Box 12929, Salem, Oregon Math Learning Center

Recovering Conductances of Resistor Networks in a Punctured Disk

I/O Efficient Dynamic Data Structures for Longest Prefix Queries

50 AMC LECTURES Lecture 2 Analytic Geometry Distance and Lines. can be calculated by the following formula:

arxiv:cs.cg/ v1 18 Oct 2005

Transcription:

M/CS 6 Clss 1: Grph Recp By Adm Sheffer Course Detils Adm Sheffer. Office hour: Tuesdys 4pm. dmsh@cltech.edu TA: Victor Kstkin. Office hour: Tuesdys 7pm. 1:00 Mondy, Wednesdy, nd Fridy. http://www.mth.cltech.edu/~2014-15/2term/m006/ 1

Course Structure No exm! Grde sed on weekly homework ssignments. Due y noon on Wednesdys. Plese red the homework policy on the wesite! Books Introduction to Grph Theory, 2 nd edition, Dougls West. Grph Theory, 4th edition, Reinhrd Diestel. Grphs Undirected grph Directed grph Edge Vertex In this clss, unless stted otherwise, the grph is undirected. 2

Grph Representtion We write G = V, E. Tht is, the grph G hs vertex set V nd edge set E. Exmple. In the figure: V =,, c, d, e. E = *,,, d,, e,, c,, e +. c d e Grph Representtion (cont.) V =,, c, d, e. E = *,,, d,, e,, c,, e +. c c d e d e 3

Simple Grphs An edge is loop if oth of its endpoints re the sme vertex. Two edges re prllel if they re etween the sme pir of vertices. A grph is simple if it contins no loops nd no prllel edges. Unless stted otherwise, the grph is simple. A loop Prllel edges Degrees The degree of vertex is the numer of edges tht re djcent to it. Prove. In ny grph, the sum of the degrees of the vertices is even. Proof. Every edge contriutes 1 to the degree of exctly two vertices. Thus, v V deg v = 2 = 2 E. e E 4

Sugrphs nd Averge Degree Given two grphs G = (V, E) nd G = V, E. We sy tht G is sugrph of G if V V nd E E. We sy tht G is n induced sugrph on V V if E contins exctly the edges of E tht connect two vertices of V. The verge degree of grph G = V, E is deg G = 1 deg v = 2 E V V. v V Induced Sugrphs Which of these is n induced sugrph? c d c d c d c 5

Sugrphs with Lrge Degrees Prolem. For every grph G = V, E with E 1 there exists n induced sugrph H of G, such tht the minimum degree in H is lrger thn deg G /2. E V = 7 6 Solution Set k = deg G /2 = E / V. We repetedly remove vertices of degree t most k until none re left. If no vertex of G hs degree k, we re done. Otherwise, how cn we mke sure tht we do not remove the entire grph? Denote our sequence of sugrphs s G = G 0, G 1, G 2,, G m. At ech step, we remove one vertex nd t most k edges. We thus hve deg G m deg G m 1 deg G 1 2k. 6

Solution (cont.) Denote our sequence of sugrphs s G = G 0, G 1, G 2,, G m. At ech step, we remove one vertex nd t most k edges. We thus hve deg G m deg G m 1 deg G 1 > 2k. Since deg G m 2k, it must contin edges. Pths nd Cycles Pth etween nd. Cycle through A cycle is pth tht strts nd ends in the sme vertex. 7

More on Pths nd Cycles A pth/cycle is sid to e simple if it does not visit ny vertex more thn once. The length of pth/cycle is the numer of edges tht it consists of. Exmple. A simple cycle of length 5. Connected Grphs A grph G = (V, E) is connected if for ny pir u, v V, there is pth in G etween u nd v. 8

Connected Components A connected component (for short, component) of grph G = V, E is mximl connected sugrph of G. For exmple, grph with three connected components: Pths nd Degrees Prolem. Let G = V, E e grph such tht the degree of every v V is t lest d (for some d 2). Prove tht G contins pth of length d. A grph with minimum degree 3. 9

Proof Assume, for contrdiction, tht longest pth P is of length c < d. Consider vertex v which is n endpoint of P. Since deg v d c + 1, it must e connected to t lest one vertex u P. By dding the edge v, u to P, we otin longer pth, contrdicting the mximlity of P. v A Vrint of the Prolem Prolem. Let G = V, E e grph such tht the degree of every v V is t lest d (for some d 2). Then there exists cycle of length t lest d + 1 10

Distnce Consider n undirected grph G = (V, E) nd two vertices v, u V. The distnce in G etween u nd v, denoted d u, v is the length of the shortest pth etween the two vertices. The dimeter of G is the mximum distnce etween two vertices of G Tht is, mx d u, v. u,v Dimeter nd Cycles Prove. Let G = V, E e grph of dimeter D tht contins t lest one cycle. Then G contins cycle of length t most 2D + 1. Exmple. Dimeter: 2 Length of shortest cycle: 5 11

Proof Assume, for contrdiction, tht the length of the shortest cycle C is t lest 2D + 2. Consider two vertices u, v with distnce of D + 1 in C. If there is no shorter pth etween u nd v, we get contrdiction to the dimeter eing D. If there is shorter pth etween u nd v, we get contrdiction for C eing the shortest cycle in G. More Degrees nd Distnces Prolem. Consider n grph G = V, E nd integers k, d 3, such tht The degree of every vertex of V is t most d. There exists vertex v V such tht for every u V we hve d u, v k. Wht is the mximum numer of vertices tht V cn contin? 12

Solution We prtition the vertices of V ccording to their distnce from v: How mny vertices stisfy d v, u = 0? 1 How mny vertices stisfy d v, u = 1? At most d. How mny vertices stisfy d v, u = 2? At most d(d 1). How mny vertices stisfy d v, u = i? At most d d 1 i 1, for every 1 i k. Solution (cont.) We hve the ound V 1 + d + d d 1 + + d d 1 k 1 = 1 + d d 1 k 1 d 1 1 = d d 1 k 2. d 2 Is this tight? Yes 13

Trees nd Forests In grph, tree is connected sugrph contining no cycles. A forest is set of non-connected trees. A forest with four trees Leves Given tree T, lef of T is vertex of degree 1. Clim. Every tree contins lef. Proof. Consider vertex v in T. If v hs degree 1, we re done. Otherwise, we trvel the tree without crossing ny edge more thn once. No vertex is visited twice since there re no cycles in T. Thus, eventully we will get stuck. The vertex tht we got stuck in is of degree 1. 14

The Size of Tree Given tree with n vertices, how mny edges re in it? Exctly n 1. Proof sketch. By induction. By removing lef we otin tree y one vertex nd one edge. Unique Pths in Trees Clim. In ny tree T there is exctly one pth etween ny two vertices. Assume, for contrdiction, tht there re two pths P, Q in T etween vertices s nd t. u the lst common vertex efore the pths P, Q split (when trveling from s to t). v the first vertex common to oth pths fter u. The portions of P nd Q s u v t etween u nd v form cycle. Contrdiction! 15

Rooted Trees A rooted tree is tree with specil vertex the root tht is singled out. We drw the tree with the root on top, nd the edges grow downwrds. A vertex v is the prent of vertex u if there is n edge u, v nd v is ove u. Ech vertex, except for the root, hs unique prent. s t s is the root nd t s prent The BFS Algorithm s c d e The BFS lgorithm receives grph G = V, E nd vertx s V. It outputs BFS tree, contining shortest pths from s to ny vertex rechle from s. A rooted tree with root s. c d s e 16

Levels of the BFS Tree The i th level of the BFS tree is the set of vertices v V tht stisfy d v = i. s c f e d f s c e Level 0 Level 1 Level 2 d Level 3 * This is the origin of the nme Bredth First Serch. The End 17