Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL:
|
|
- Rudolf Waters
- 5 years ago
- Views:
Transcription
1 Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 9 Notes Class URL:
2 Notes slides from before lecture Notes February 8 (1) HW4 is due on FRIDAY February 10 11:59pm HW5 should be posted by tomorrow (due on Thursday, February 16, 11:59pm) HW3 grades are published (or, will be published) as of today 72-hour regrade window If you used unauthorized resources in doing HW3, please instructors ASAP. Other cases will be referred to colleges. Discussion worksheets: partial credit is pro-rated from 7/10 = 5% credit MT1 should be back to you this week (target = Wednesday night) Today: Day of posted slides Any logistic, other issues?
3 Connected Components Disconnected graphs can be broken up into pieces where each is connected. Each (maximal) connected piece of the graph is a connected component. maximal means that if you make it any larger, it will lose the given (in this case, connected ) property.
4 Eulerian Tours and Fleury s Algorithm CSE21 Winter 2017, Day 12 (B00), Day 8 (A00) February 8,
5 Vocabulary Path (or walk): describes a route from one vertex to another (v 1, e 1, v 2, e 2,, v k ) Length of path: number of edges Simple path: path that doesn t repeat vertices Circuit (or cycle or closed walk): path that starts and ends at the same vertex, with length greater than zero Loop (or self-loop): an edge from a vertex to itself
6 Consider only undirected graphs. Finding Eulerian tours Path that includes each edge once 1 st goal: Determine whether a given undirected graph G has an Eulerian tour. 2 nd goal: Actually find an Eulerian tour in an undirected graph G, when possible.
7 Connected Components Disconnected graphs can be broken up into pieces where each is connected. Each connected piece of the graph is a connected component. Does this graph have an Eulerian tour?
8 Finding Eulerian tours Let G = (V,E) be an - undirected - connected graph with n vertices. 1 st goal: Determine whether G has an Eulerian tour. 2 nd goal: If yes, find the tour itself.
9 Finding Eulerian tours Observation: If v is an intermediate* vertex on a path p, then p must enter v the same number of times it leaves v. * not the start vertex, not the end vertex. v
10 Finding Eulerian tours Observation: If v is an intermediate* vertex on a path p, then p must enter v the same number of times it leaves v. An Eulerian tour contains all edges incident on v. So, half of the edges are used to enter v, half to leave. * not the start vertex, not the end vertex. v
11 Recall: Degree The degree of a vertex in an undirected graph is the total number of edges incident with it, except that a loop contributes twice. Rosen p. 652
12 Finding Eulerian tours Observation: If v is an intermediate* vertex on a path p, then p must enter v the same number of times it leaves v. An Eulerian tour contains all edges incident on v. So, half of the edges are used to enter v, half to leave. Degree of v must be even! v * not the start vertex, not the end vertex.
13 (Summary of) Observation: Finding Eulerian tours In an Eulerian tour, any intermediate vertex has even degree. In a circuit, all vertices are intermediate so all have even degree. In a tour starting and ending at different vertices (not a circuit), the starting and ending vertices will have odd degree; all others will have even degree.
14 [Side note: remember contrapositive?] p q p q q p T T T T T F F F T T F T F F T T
15 Finding Eulerian tours Theorem: If G has an Eulerian tour, G has at most two odd-degree vertices. Which of the following statements is equivalent to the theorem (using the facts we know so far about graphs)? A. If the number of odd-degree vertices in G is anything other than 0 or 2, then G has no Eulerian tour. B. If G has three or more odd-degree vertices, then G does not have an Eulerian tour. C. If G has an Eulerian tour, then G has either all vertices with even degree or G has exactly two vertices with odd degree. D. All of the above. E. None of the above.
16 Finding Eulerian tours Theorem: If G has an Eulerian tour, G has at most two odd-degree vertices. Which of the following statements is the converse to the theorem? A. If G does not have an Eulerian tour, then G does not have at most two odd-degree vertices. B. If G has at most two odd-degree vertices, then G has an Eulerian tour. C. If G does not have at most two odd-degree vertices, then G does not have an Eulerian tour. D. More than one of the above. E. None of the above.
17 Finding Eulerian tours Theorem: If G has an Eulerian tour, G has at most two odd-degree vertices. Question: Is the converse also true? I.e., If G has at most two odd-degree vertices, then must G have an Eulerian tour?
18 Finding Eulerian tours Theorem: If G has an Eulerian tour, G has at most two odd-degree vertices. Question: is the converse also true? i.e If G has at most two odd degree vertices, then must G have an Eulerian tour? Answer: give algorithm to build the Eulerian tour! We'll develop some more graph theory notions along the way.
19 Eulerian tour? Finding Eulerian tours
20 Finding Eulerian tours Eulerian tour? Start at 4. Where should we go next? A. 2 or 3. B. 2 or 5. C. 3 or 5. D. 2 or 3 or 5.
21 Bridges A bridge is an edge, which, if removed, would cause G to be disconnected. A D B C E Which of the edges in this graph are bridges? A. D, E B. C, D C. D only D. None of the above.
22 Bridges A bridge is an edge, which, if removed, would cause G to be disconnected. Connection with Eulerian tours: In an Eulerian tour, we have to visit every edge on one side of the bridge before we cross it (because there's no coming back). Do you see divide & conquer in here?
23 Eulerian Tours: HOW (Fleury's Algorithm) 1. Check that G has at most 2 odd-degree vertices. 2. Start at vertex v, an odd-degree vertex if possible. 3. While there are still edges in G, 4. If there is more than one edge incident on v 5. Cross any edge incident on v that is not a bridge 6. Else, cross the only edge available from v. 7. Delete the edge just crossed from G, update v.
24 Eulerian Tours: HOW (Fleury's Algorithm) 1. Check that G has at most 2 odd-degree vertices. 2. Start at vertex v, an odd-degree vertex if possible. 3. While there are still edges in G, 4. If there is more than one edge incident on v 5. Cross any edge incident on v that is not a bridge 6. Else, cross the only edge available from v. 7. Delete the edge just crossed from G, update v. What Eulerian tour do you get when following Fleury's algorithm, starting at vertex 4?
25 Eulerian Tours: WHY (Fleury's Algorithm) 1. Check that G has at most 2 odd-degree vertices. 2. Start at vertex v, an odd-degree vertex if possible. 3. While there are still edges in G, 4. If there is more than one edge incident with v 5. Cross any edge incident with v that is not a bridge 6. Else, cross the only edge available from v. 7. Delete the edge just crossed from G, update v. Will there always be such an edge? Will go through each edge at most once, so if the while loop iterates E times, get an Eulerian tour.
26 Eulerian Tours: WHY (Fleury's Algorithm) 1. Check that G has at most 2 odd-degree vertices. 2. Start at vertex v, an odd-degree vertex if possible. 3. While there are still edges in G, 4. If there is more than one edge incident with v 5. Cross any edge incident with v that is not a bridge 6. Else, cross the only edge available from v. 7. Delete the edge just crossed from G, update v. Will there always be such an edge? Need to show (loop invariant): Connected graph with no more than one bridge from v. If we enter the while loop, then after the t th iteration of the while loop, the (remaining) graph is still connected, AND there is at most one other odd-degree vertex in the (remaining) graph other than v, AND across every bridge from v there is an odd-degree vertex (and hence there is at most one bridge incident with v).
27 Fleury s algorithm: invariants 1. Check that G has at most 2 odd-degree vertices. 2. Start at vertex v, an odd-degree vertex if possible. 3. While there are still edges in G, 4. If there is more than one edge incident with v 5. Cross any edge incident with v that is not a bridge 6. Else, cross the only edge available from v. 7. Delete the edge just crossed from G, update v. Will there always be such an edge? (1) If v has odd degree then there is exactly one other vertex w of odd degree. If v has even degree, all other vertices have even degree. (2) The (remaining) graph G stays connected (deleting edges as we use them).
28 Fleury s algorithm: invariants (1) If v has odd degree then there is exactly one other vertex w of odd degree. If v has even degree, all other vertices have even degree. Proof by induction B.C.: Since G has at most 2 odd-degree vertices and we pick one as v, there must be at most one other. I.H.: Suppose that after k iterations, the current vertex has odd degree and one other vertex has odd degree, or else all vertices have even degree
29 Fleury s algorithm: invariants (1) If v has odd degree then there is exactly one other vertex w of odd degree. If v has even degree, all other vertices have even degree. I.H.: Suppose that after k iterations, the current vertex has odd degree and one other vertex has odd degree, or else all vertices have even degree
30 Fleury s algorithm: invariants (2) The (remaining) graph G stays connected (deleting edges as we use them). Proof by induction: B.C. G starts as being connected. I.H. After k iterations, G is still connected. I.S.. We remove the current vertex v and all its incident edges. What can happen to the graph? Removing the current vertex v and its incident edges, the graph could split into connected components C 1, C 2,, C m
31 Fleury s algorithm: invariants (2) The (remaining) graph G stays connected (deleting edges as we use them). We remove the current vertex v and all its incident edges. What can happen to the graph?
32 Fleury s algorithm: invariants (2) The (remaining) graph G stays connected (deleting edges as we use them). We remove the current vertex v and all its incident edges. What can happen to the graph? Put another way: Let s see what the structure of G can possibly be. Three cases There is a single component. I.e., m = 1 and there is only one edge from v. G stays connected since we delete v after the one edge is removed.
33 Fleury s algorithm: invariants (2) The (remaining) graph G stays connected (deleting edges as we use them). We remove the current vertex v and all its incident edges. What can happen to the graph? Put another way: Let s see what the structure of G can possibly be. Three cases There is a component C i (shown here: C 1 ) with at least 2 edges from v. Neither is a bridge, so Fleury s algorithm can take either edge and the graph will stay connected.
34 Fleury s algorithm: invariants (2) The (remaining) graph G stays connected (deleting edges as we use them). Put another way: Let s see what the structure of G can possibly be. Three cases We remove the current vertex v and all its incident edges. What can happen to the graph? First, note that aside from Cases I, II and III, there are no other cases. Next, we re going to show that Case III cannot happen. If two connected components each have a bridge from v, only one of them contains w (= the other odd-degree vertex). Let s look at the subgraph of G that includes v and a different component (shown in the blue outline). In this subgraph, the degree of v is 1 (purple edge). But the handshake lemma then implies that there must be another odd-degree vertex w in this other component, which is impossible. (Since this component didn t contain w, all of its vertices must have even degree.)
35 Eulerian Tours WHY Fleury's Algorithm 1. Check that G has at most 2 odd-degree vertices. 2. Start at vertex v, an odd-degree vertex if possible. 3. While there are still edges in G, 4. If there is more than one edge incident with v 5. Cross any edge incident with v that is not a bridge 6. Else, cross the only edge available from v. 7. Delete the edge just crossed from G, update v. Will there always be such an edge? Why is more than one bridge from v bad? v
36 Seven Bridges of Konigsberg Is there a path where each edge occurs exactly once? Eulerian tour No! Rosen p. 693
37 Seven Bridges of Konigsberg redux Which of these puzzles can you draw without lifting your pencil off the paper? A. No B. No C. No D. Yes
38 Eulerian Tours: recap Consider only undirected graphs. 1 st goal: Determine whether a given undirected graph G has an Eulerian tour. G has an Eulerian tour if and only if G has at most 2 odd-degree vertices. 2 nd goal: Actually find an Eulerian tour in an undirected graph G, when possible. Fleury's Algorithm: don't burn your bridges.
39 Eulerian Tours: recap Number of odd-degree vertices Is such a graph possible? ,5,7,... 4,6,8,... yes no yes no yes Is an Eulerian tour possible? yes, a circuit yes, not a circuit no
40 DAGs and Graph Search CSE21 Winter 2017, Day 13 (B00), Day 9 (A00) February 10,
41 Today s plan Definition of a DAG. Ordering algorithm on a DAG. Graph search and reachability. In the textbook: Sections 10.4 and 10.5
42 (some) Prerequisites for (some) CSE classes year plan: Take classes in some order. If course A is prerequisite for course B, must take course A before we take course B
43 (some) Prerequisites for (some) CSE classes Which of the following orderings are ok? A. 30, 145, 151, 100. B. 110, 105, 21, 101. C. 21, 105, 130. D. More than one of the above. E. None of the above
44 (some) Prerequisites for (some) CSE classes What if we want to include all vertices (i.e. courses)? Is this possible for any graph?
45 (some) Prerequisites for (some) CSE classes What if we want to include all vertices (i.e. courses)? Is this possible for any graph? Classify graphs for which it is possible. 2. For those, find a good ( legal ) ordering
46 (some) Prerequisites for (some) CSE classes What if we want to include all vertices (i.e. courses)? Is this possible for any graph? Classify graphs for which it is possible. 2. For those, find a good ( legal ) ordering
47 Barriers to ordering Which of the following graphs have good orderings? A. C. B. D. E. None of the above.
48 Barriers to ordering A can't be first (because B is before it). B can't be first (because C is before it). C can't be first (because D is before it). D can't be first (because A is before it). A B D C Cycle Whenever there is a cycle, can't find a good ordering.
49 Directed Acyclic Graphs Directed graphs with no cycles are called directed acyclic graphs (DAGs).
50 Directed Acyclic Graphs Directed graphs with no cycles are called directed acyclic graphs (DAGs). ABGCEHDFI A topological ordering of a graph is an (ordered) list of all its vertices such that, for each (directed) edge (v,w) in the graph, v comes before w in the list.
51 Topological ordering ABGCEHDFI Two algorithmic questions: 1. Given an (ordered) list of all vertices in the graph, is it a topological ordering? 2. Given a graph, produce a topological ordering (if one exists).
52 Topological ordering ABGCEHDFI 1. Given an (ordered) list of all vertices in the graph, is it a topological ordering? How would you do this?
53 Topological ordering A, B, G, C, E, H, D, F, I At what vertex should we start? 2. Given a graph, produce a topological ordering (if one exists). A. Any vertex is okay. B. We must start at A. C. Choose any vertex with at least one outgoing edge. D. Choose any vertex with no incoming edges. E. None of the above.
54 Sources of a DAG In a DAG, vertices with no incoming edges are called sources. Which of these vertices are sources? A. Only A and G. B. Only A. C. Only I. D. Only I and F. E. None of the above.
55 Sources of a DAG Lemma 1: Every DAG has a (at least one) source How would you prove this?
56 Sources of a DAG Lemma 1: Every DAG has a (at least one) source How would you prove this? Not a source look at incoming edges
57 Sources of a DAG Lemma 1: Every DAG has a (at least one) source How would you prove this? Not a source look at incoming edges
58 Sources of a DAG Lemma 1: Every DAG has a (at least one) source How would you prove this? Found a source!
59 Sources of a DAG Lemma 1: Every DAG has a (at least one) source Let G be a DAG. We want to show that G has a source vertex. In a proof by contradiction (aka indirect proof), what should we assume? A. G has a source vertex. B. All the vertices in G are sources. C. No vertex in G is a source. D. G has at least one source vertex and at least one vertex that's not a source. E. None of the above.
60 Sources of a DAG Lemma 1: Every DAG has a (at least one) source Proof of Lemma 1: Let G be a DAG with n >1 vertices. We want to show that G has a source vertex. Assume towards a contradiction that no vertex in G is a source. Let v 0 be a vertex in G. Since v 0 is not a source (by assumption), it has an incoming edge. Let v 1 be a vertex in G such that (v 1, v 0 ) is an edge in G. Since v 1 is also not a source, let v 2 be a vertex in G such that (v 2, v 1 ) is an edge in G. Keep going to find v 0, v 1, v 2,, v n vertices. There must be a repeated vertex in this list (Pigeonhole Principle). Contradiction (contradicts the given fact that G is acyclic)!!!
61 Sources of a DAG Notation: G-v is the graph that results when we remove v and all of its outgoing edges from G. Lemma 2: If v is a source vertex of G, then G is a DAG if and only if G-v is a DAG. Look at the proof (following slides) we ll pick up with this on Monday!
Eulerian Tours and Fleury s Algorithm
Eulerian Tours and Fleury s Algorithm CSE21 Winter 2017, Day 12 (B00), Day 8 (A00) February 8, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Vocabulary Path (or walk):describes a route from one vertex
More informationEulerian Tours and Fleury s Algorithm
Eulerian Tours and Fleury s Algorithm CSE21 Winter 2017, Day 12 (B00), Day 8 (A00) February 8, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Vocabulary Path (or walk): describes a route from one vertex
More informationEulerian tours. Russell Impagliazzo and Miles Jones Thanks to Janine Tiefenbruck. April 20, 2016
Eulerian tours Russell Impagliazzo and Miles Jones Thanks to Janine Tiefenbruck http://cseweb.ucsd.edu/classes/sp16/cse21-bd/ April 20, 2016 Seven Bridges of Konigsberg Is there a path that crosses each
More informationGraphs and Puzzles. Eulerian and Hamiltonian Tours.
Graphs and Puzzles. Eulerian and Hamiltonian Tours. CSE21 Winter 2017, Day 11 (B00), Day 7 (A00) February 3, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Exam Announcements Seating Chart on Website Good
More informationNotes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:
Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 10 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes February 13 (1) HW5 is due
More informationCSE 21 Spring 2016 Homework 5. Instructions
CSE 21 Spring 2016 Homework 5 Instructions Homework should be done in groups of one to three people. You are free to change group members at any time throughout the quarter. Problems should be solved together,
More informationCS70 - Lecture 6. Graphs: Coloring; Special Graphs. 1. Review of L5 2. Planar Five Color Theorem 3. Special Graphs:
CS70 - Lecture 6 Graphs: Coloring; Special Graphs 1. Review of L5 2. Planar Five Color Theorem 3. Special Graphs: Trees: Three characterizations Hypercubes: Strongly connected! Administration You need
More informationCSE 331: Introduction to Algorithm Analysis and Design Graphs
CSE 331: Introduction to Algorithm Analysis and Design Graphs 1 Graph Definitions Graph: A graph consists of a set of verticies V and a set of edges E such that: G = (V, E) V = {v 0, v 1,..., v n 1 } E
More informationDiscrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs
CS 70 Discrete Mathematics for CS Spring 2008 David Wagner Note 13 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite to writing a
More information11.2 Eulerian Trails
11.2 Eulerian Trails K.. onigsberg, 1736 Graph Representation A B C D Do You Remember... Definition A u v trail is a u v walk where no edge is repeated. Do You Remember... Definition A u v trail is a u
More informationCharacterization of Graphs with Eulerian Circuits
Eulerian Circuits 3. 73 Characterization of Graphs with Eulerian Circuits There is a simple way to determine if a graph has an Eulerian circuit. Theorems 3.. and 3..2: Let G be a pseudograph that is connected
More informationDiscrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8
CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite
More informationCSE 21 Spring 2016 Homework 5. Instructions
CSE 21 Spring 2016 Homework 5 Instructions Homework should be done in groups of one to three people. You are free to change group members at any time throughout the quarter. Problems should be solved together,
More informationCPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60
CPS 102: Discrete Mathematics Instructor: Bruce Maggs Quiz 3 Date: Wednesday November 30, 2011 NAME: Prob # Score Max Score 1 10 2 10 3 10 4 10 5 10 6 10 Total 60 1 Problem 1 [10 points] Find a minimum-cost
More information8.2 Paths and Cycles
8.2 Paths and Cycles Degree a b c d e f Definition The degree of a vertex is the number of edges incident to it. A loop contributes 2 to the degree of the vertex. (G) is the maximum degree of G. δ(g) is
More informationLecture 22 Tuesday, April 10
CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,
More informationCrossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)
15-251 Great Ideas in Theoretical Computer Science Lecture 12: Graphs I: The Basics February 22nd, 2018 Crossing bridges Königsberg (Prussia) Now Kaliningrad (Russia) Is there a way to walk through the
More informationIntroduction to Graphs
Introduction to Graphs Slides by Lap Chi Lau The Chinese University of Hong Kong This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer
More informationFundamental Properties of Graphs
Chapter three In many real-life situations we need to know how robust a graph that represents a certain network is, how edges or vertices can be removed without completely destroying the overall connectivity,
More informationMC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points
MC 0 GRAPH THEORY 0// Solutions to HW # 0 points + XC points ) [CH] p.,..7. This problem introduces an important class of graphs called the hypercubes or k-cubes, Q, Q, Q, etc. I suggest that before you
More informationAn Introduction to Graph Theory
An Introduction to Graph Theory Evelyne Smith-Roberge University of Waterloo March 22, 2017 What is a graph? Definition A graph G is: a set V (G) of objects called vertices together with: a set E(G), of
More informationγ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.
MAD 3105 Spring 2006 Solutions for Review for Test 2 1. Define a graph G with V (G) = {a, b, c, d, e}, E(G) = {r, s, t, u, v, w, x, y, z} and γ, the function defining the edges, is given by the table ɛ
More informationNotebook Assignments
Notebook Assignments These six assignments are a notebook using techniques from class in the single concrete context of graph theory. This is supplemental to your usual assignments, and is designed for
More informationGraph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011
Graph Theory Martin Stynes Department of Mathematics, UCC email: m.stynes@ucc.ie January 26, 2011 1 Introduction to Graphs 1 A graph G = (V, E) is a non-empty set of nodes or vertices V and a (possibly
More informationGraph Theory Part Two
Graph Theory Part Two Recap from Last Time A graph is a mathematical structure for representing relationships. Nodes A graph consists of a set of nodes (or vertices) connected by edges (or arcs) A graph
More informationEECS 203 Lecture 20. More Graphs
EECS 203 Lecture 20 More Graphs Admin stuffs Last homework due today Office hour changes starting Friday (also in Piazza) Friday 6/17: 2-5 Mark in his office. Sunday 6/19: 2-5 Jasmine in the UGLI. Monday
More informationFinding Strongly Connected Components
Yufei Tao ITEE University of Queensland We just can t get enough of the beautiful algorithm of DFS! In this lecture, we will use it to solve a problem finding strongly connected components that seems to
More informationCS4800: Algorithms & Data Jonathan Ullman
CS4800: Algorithms & Data Jonathan Ullman Lecture 12: Graph Search: BFS Applications, DFS Feb 20, 2018 BFS Review BFS Algorithm: Input: source node! " # =! " % = all neighbors of " # " & = all neighbors
More informationLecture 10. Finding strongly connected components
Lecture 10 Finding strongly connected components Announcements HW4 due Friday Nothing assigned Friday because MIDTERM in class, Monday 10/30. Please show up. During class, 1:30-2:50 If your last name is
More informationLecture 5: Graphs. Rajat Mittal. IIT Kanpur
Lecture : Graphs Rajat Mittal IIT Kanpur Combinatorial graphs provide a natural way to model connections between different objects. They are very useful in depicting communication networks, social networks
More informationNotes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 4 Notes. Class URL:
Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 4 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes January 23 (1) HW2 due tomorrow
More informationIntermediate Math Circles Wednesday, February 22, 2017 Graph Theory III
1 Eulerian Graphs Intermediate Math Circles Wednesday, February 22, 2017 Graph Theory III Let s begin this section with a problem that you may remember from lecture 1. Consider the layout of land and water
More information14 More Graphs: Euler Tours and Hamilton Cycles
14 More Graphs: Euler Tours and Hamilton Cycles 14.1 Degrees The degree of a vertex is the number of edges coming out of it. The following is sometimes called the First Theorem of Graph Theory : Lemma
More informationINTRODUCTION TO GRAPH THEORY. 1. Definitions
INTRODUCTION TO GRAPH THEORY D. JAKOBSON 1. Definitions A graph G consists of vertices {v 1, v 2,..., v n } and edges {e 1, e 2,..., e m } connecting pairs of vertices. An edge e = (uv) is incident with
More informationDiscrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7
CS 70 Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7 An Introduction to Graphs A few centuries ago, residents of the city of Königsberg, Prussia were interested in a certain problem.
More information5 Graphs
5 Graphs jacques@ucsd.edu Some of the putnam problems are to do with graphs. They do not assume more than a basic familiarity with the definitions and terminology of graph theory. 5.1 Basic definitions
More informationProblem Set 2 Solutions
Design and Analysis of Algorithms February, 01 Massachusetts Institute of Technology 6.046J/18.410J Profs. Dana Moshkovitz and Bruce Tidor Handout 8 Problem Set Solutions This problem set is due at 9:00pm
More informationChapter 3. Graphs CLRS Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 3 Graphs CLRS 12-13 Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 25 3.4 Testing Bipartiteness Bipartite Graphs Def. An undirected graph G = (V, E) is bipartite
More informationDO NOT RE-DISTRIBUTE THIS SOLUTION FILE
Professor Kindred Math 104, Graph Theory Homework 2 Solutions February 7, 2013 Introduction to Graph Theory, West Section 1.2: 26, 38, 42 Section 1.3: 14, 18 Section 2.1: 26, 29, 30 DO NOT RE-DISTRIBUTE
More informationIntroduction to Graphs
Introduction to Graphs Historical Motivation Seven Bridges of Königsberg Königsberg (now Kaliningrad, Russia) around 1735 Problem: Find a walk through the city that would cross each bridge once and only
More informationAssignment # 4 Selected Solutions
Assignment # 4 Selected Solutions Problem 2.3.3 Let G be a connected graph which is not a tree (did you notice this is redundant?) and let C be a cycle in G. Prove that the complement of any spanning tree
More informationProblem Set 2 Solutions
Problem Set 2 Solutions Graph Theory 2016 EPFL Frank de Zeeuw & Claudiu Valculescu 1. Prove that the following statements about a graph G are equivalent. - G is a tree; - G is minimally connected (it is
More informationIntroduction to Graphs
Introduction to Graphs CSE21 Winter 2017, Day 10 (B00), Day 6-7 (A00) February 1, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 What is a graph? A (directed) graph G is A nonempty set of vertices V, also
More informationCHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/z
CHAPTER 10 GRAPHS AND TREES Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/z SECTION 10.1 Graphs: Definitions and Basic Properties Copyright Cengage Learning. All rights reserved. Graphs: Definitions
More informationNumber Theory and Graph Theory
1 Number Theory and Graph Theory Chapter 6 Basic concepts and definitions of graph theory By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com
More informationHow can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?
1 Introduction Graph theory is one of the most in-demand (i.e. profitable) and heavily-studied areas of applied mathematics and theoretical computer science. May graph theory questions are applied in this
More informationv V Question: How many edges are there in a graph with 10 vertices each of degree 6?
ECS20 Handout Graphs and Trees March 4, 2015 (updated 3/9) Notion of a graph 1. A graph G = (V,E) consists of V, a nonempty set of vertices (or nodes) and E, a set of pairs of elements of V called edges.
More informationK 4 C 5. Figure 4.5: Some well known family of graphs
08 CHAPTER. TOPICS IN CLASSICAL GRAPH THEORY K, K K K, K K, K K, K C C C C 6 6 P P P P P. Graph Operations Figure.: Some well known family of graphs A graph Y = (V,E ) is said to be a subgraph of a graph
More informationVarying Applications (examples)
Graph Theory Varying Applications (examples) Computer networks Distinguish between two chemical compounds with the same molecular formula but different structures Solve shortest path problems between cities
More information1 Digraphs. Definition 1
1 Digraphs Definition 1 Adigraphordirected graphgisatriplecomprisedofavertex set V(G), edge set E(G), and a function assigning each edge an ordered pair of vertices (tail, head); these vertices together
More informationCS781 Lecture 2 January 13, Graph Traversals, Search, and Ordering
CS781 Lecture 2 January 13, 2010 Graph Traversals, Search, and Ordering Review of Lecture 1 Notions of Algorithm Scalability Worst-Case and Average-Case Analysis Asymptotic Growth Rates: Big-Oh Prototypical
More informationLecture 19 Thursday, March 29. Examples of isomorphic, and non-isomorphic graphs will be given in class.
CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 19 Thursday, March 29 GRAPH THEORY Graph isomorphism Definition 19.1 Two graphs G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) are isomorphic, write G 1 G
More informationMAT 145: PROBLEM SET 4
MAT 145: PROBLEM SET 4 DUE TO FRIDAY FEB 22 Abstract. This problem set corresponds to the sixth week of the Combinatorics Course in the Winter Quarter 2019. It was posted online on Friday Feb 15 and is
More informationMath 443/543 Graph Theory Notes 2: Transportation problems
Math 443/543 Graph Theory Notes 2: Transportation problems David Glickenstein September 15, 2014 1 Readings This is based on Chartrand Chapter 3 and Bondy-Murty 18.1, 18.3 (part on Closure of a Graph).
More informationCSE 421 Applications of DFS(?) Topological sort
CSE 421 Applications of DFS(?) Topological sort Yin Tat Lee 1 Precedence Constraints In a directed graph, an edge (i, j) means task i must occur before task j. Applications Course prerequisite: course
More information2. CONNECTIVITY Connectivity
2. CONNECTIVITY 70 2. Connectivity 2.1. Connectivity. Definition 2.1.1. (1) A path in a graph G = (V, E) is a sequence of vertices v 0, v 1, v 2,..., v n such that {v i 1, v i } is an edge of G for i =
More informationMaster Theorem, Introduction to Graphs
Master Theorem, Introduction to Graphs CSE21 Winter 2017, Day 10 (B00), Day 6-7 (A00) February 1, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Divide & Conquer: General Strategy Divide the problem of
More informationMatching Theory. Figure 1: Is this graph bipartite?
Matching Theory 1 Introduction A matching M of a graph is a subset of E such that no two edges in M share a vertex; edges which have this property are called independent edges. A matching M is said to
More informationGrades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grades 7 & 8, Math Circles 31 October/1/2 November, 2017 Graph Theory Introduction Graph Theory is the
More informationBIL694-Lecture 1: Introduction to Graphs
BIL694-Lecture 1: Introduction to Graphs Lecturer: Lale Özkahya Resources for the presentation: http://www.math.ucsd.edu/ gptesler/184a/calendar.html http://www.inf.ed.ac.uk/teaching/courses/dmmr/ Outline
More informationLecture 3: Graphs and flows
Chapter 3 Lecture 3: Graphs and flows Graphs: a useful combinatorial structure. Definitions: graph, directed and undirected graph, edge as ordered pair, path, cycle, connected graph, strongly connected
More informationChapter 11: Graphs and Trees. March 23, 2008
Chapter 11: Graphs and Trees March 23, 2008 Outline 1 11.1 Graphs: An Introduction 2 11.2 Paths and Circuits 3 11.3 Matrix Representations of Graphs 4 11.5 Trees Graphs: Basic Definitions Informally, a
More informationGraphs. Data Structures and Algorithms CSE 373 SU 18 BEN JONES 1
Graphs Data Structures and Algorithms CSE 373 SU 18 BEN JONES 1 Warmup Discuss with your neighbors: Come up with as many kinds of relational data as you can (data that can be represented with a graph).
More informationGraph Theory Questions from Past Papers
Graph Theory Questions from Past Papers Bilkent University, Laurence Barker, 19 October 2017 Do not forget to justify your answers in terms which could be understood by people who know the background theory
More informationIntroduction to Graph Theory
Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex
More informationOutline. Graphs. Divide and Conquer.
GRAPHS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books. Outline Graphs.
More informationIntroduction III. Graphs. Motivations I. Introduction IV
Introduction I Graphs Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Graph theory was introduced in the 18th century by Leonhard Euler via the Königsberg
More informationChapter 3: Paths and Cycles
Chapter 3: Paths and Cycles 5 Connectivity 1. Definitions: Walk: finite sequence of edges in which any two consecutive edges are adjacent or identical. (Initial vertex, Final vertex, length) Trail: walk
More informationCMPSCI 250: Introduction to Computation. Lecture #22: Graphs, Paths, and Trees David Mix Barrington 12 March 2014
CMPSCI 250: Introduction to Computation Lecture #22: Graphs, Paths, and Trees David Mix Barrington 12 March 2014 Graphs, Paths, and Trees Graph Definitions Paths and the Path Predicate Cycles, Directed
More informationShared Variables and Interference
Solved Shared Variables and Interference CS 536: Science of Programming, Fall 2018 A. Why Parallel programs can coordinate their work using shared variables, but it s important for threads to not interfere
More informationGraph Theory: Starting Out
Graph Theory: Starting Out Administrivia To read: Chapter 7, Sections 1-3 (Ensley/Crawley) Problem Set 5 sent out; due Monday 12/8 in class. There will be two review days next week (Wednesday and Friday)
More informationAnnouncements. HW3 is graded. Average is 81%
CSC263 Week 9 Announcements HW3 is graded. Average is 81% Announcements Problem Set 4 is due this Tuesday! Due Tuesday (Nov 17) Recap The Graph ADT definition and data structures BFS gives us single-source
More informationLecture 20 : Trees DRAFT
CS/Math 240: Introduction to Discrete Mathematics 4/12/2011 Lecture 20 : Trees Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we discussed graphs. Today we continue this discussion,
More informationElements of Graph Theory
Elements of Graph Theory Quick review of Chapters 9.1 9.5, 9.7 (studied in Mt1348/2008) = all basic concepts must be known New topics we will mostly skip shortest paths (Chapter 9.6), as that was covered
More informationNumber Theory and Graph Theory
1 Number Theory and Graph Theory Chapter 7 Graph properties By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com 2 Module-2: Eulerian
More informationSolutions to In-Class Problems Week 4, Fri
Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr. Radhika Nagpal Solutions to In-Class Problems Week 4, Fri Definition: The
More informationDesign and Analysis of Algorithms
CSE, Winter 8 Design and Analysis of Algorithms Lecture : Graphs, DFS (Undirected, Directed), DAGs Class URL: http://vlsicad.ucsd.edu/courses/cse-w8/ Graphs Internet topology Graphs Gene-gene interactions
More informationShared Variables and Interference
Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but
More informationMath 776 Graph Theory Lecture Note 1 Basic concepts
Math 776 Graph Theory Lecture Note 1 Basic concepts Lectured by Lincoln Lu Transcribed by Lincoln Lu Graph theory was founded by the great Swiss mathematician Leonhard Euler (1707-178) after he solved
More informationGraph Algorithms. Imran Rashid. Jan 16, University of Washington
Graph Algorithms Imran Rashid University of Washington Jan 16, 2008 1 / 26 Lecture Outline 1 BFS Bipartite Graphs 2 DAGs & Topological Ordering 3 DFS 2 / 26 Lecture Outline 1 BFS Bipartite Graphs 2 DAGs
More informationCS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department
CS473-Algorithms I Lecture 3-A Graphs Graphs A directed graph (or digraph) G is a pair (V, E), where V is a finite set, and E is a binary relation on V The set V: Vertex set of G The set E: Edge set of
More informationAssignment 4 Solutions of graph problems
Assignment 4 Solutions of graph problems 1. Let us assume that G is not a cycle. Consider the maximal path in the graph. Let the end points of the path be denoted as v 1, v k respectively. If either of
More informationGraphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402
Graphs (MTAT.05.080, 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402 homepage: http://courses.cs.ut.ee/2012/graafid (contains slides) For grade: Homework + three tests (during or after
More informationLecture 5: Graphs. Graphs! Euler Definitions: model. Fact! Euler Again!! Planar graphs. Euler Again!!!!
Lecture 5: Graphs. Graphs! Euler Definitions: model. Fact! Euler Again!! Planar graphs. Euler Again!!!! Konigsberg bridges problem. Can you make a tour visiting each bridge exactly once? Konigsberg bridges
More informationMath.3336: Discrete Mathematics. Chapter 10 Graph Theory
Math.3336: Discrete Mathematics Chapter 10 Graph Theory Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall
More informationCSE 20 DISCRETE MATH WINTER
CSE 20 DISCRETE MATH WINTER 2016 http://cseweb.ucsd.edu/classes/wi16/cse20-ab/ Today's learning goals Explain the steps in a proof by (strong) mathematical induction Use (strong) mathematical induction
More informationToday. Types of graphs. Complete Graphs. Trees. Hypercubes.
Today. Types of graphs. Complete Graphs. Trees. Hypercubes. Complete Graph. K n complete graph on n vertices. All edges are present. Everyone is my neighbor. Each vertex is adjacent to every other vertex.
More informationInstant Insanity Instructor s Guide Make-it and Take-it Kit for AMTNYS 2006
Instant Insanity Instructor s Guide Make-it and Take-it Kit for AMTNYS 2006 THE KIT: This kit contains materials for two Instant Insanity games, a student activity sheet with answer key and this instructor
More informationGraphs. Part I: Basic algorithms. Laura Toma Algorithms (csci2200), Bowdoin College
Laura Toma Algorithms (csci2200), Bowdoin College Undirected graphs Concepts: connectivity, connected components paths (undirected) cycles Basic problems, given undirected graph G: is G connected how many
More informationGraphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph
Graphs and Trees Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) who is connected to whom Web search views web pages as a graph Who points to whom Niche graphs (Ecology):
More informationBasics of Graph Theory
Basics of Graph Theory 1 Basic notions A simple graph G = (V, E) consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges. Simple graphs have their
More informationMITOCW watch?v=zm5mw5nkzjg
MITOCW watch?v=zm5mw5nkzjg The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To
More informationLecture 3: Recap. Administrivia. Graph theory: Historical Motivation. COMP9020 Lecture 4 Session 2, 2017 Graphs and Trees
Administrivia Lecture 3: Recap Assignment 1 due 23:59 tomorrow. Quiz 4 up tonight, due 15:00 Thursday 31 August. Equivalence relations: (S), (R), (T) Total orders: (AS), (R), (T), (L) Partial orders: (AS),
More informationV1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).
CS4234: Optimisation Algorithms Lecture 4 TRAVELLING-SALESMAN-PROBLEM (4 variants) V1.0: Seth Gilbert, V1.1: Steven Halim August 30, 2016 Abstract The goal of the TRAVELLING-SALESMAN-PROBLEM is to find
More informationThe Konigsberg Bridge Problem
The Konigsberg Bridge Problem This is a classic mathematical problem. There were seven bridges across the river Pregel at Königsberg. Is it possible to take a walk in which each bridge is crossed exactly
More information14.2 Euler Paths and Circuits filled in.notebook November 18, Euler Paths and Euler Circuits
14.2 Euler Paths and Euler Circuits The study of graph theory can be traced back to the eighteenth century when the people of the town of Konigsberg sought a solution to a popular problem. They had sections
More informationArtificial Intelligence
Artificial Intelligence Graph theory G. Guérard Department of Nouvelles Energies Ecole Supérieur d Ingénieurs Léonard de Vinci Lecture 1 GG A.I. 1/37 Outline 1 Graph theory Undirected and directed graphs
More informationFundamental Graph Algorithms Part Three
Fundamental Graph Algorithms Part Three Outline for Today Topological Sorting, Part II How can we quickly compute a topological ordering on a DAG? Connected Components How do we find the pieces of an undirected
More informationBinomial Coefficient Identities and Encoding/Decoding
Binomial Coefficient Identities and Encoding/Decoding CSE21 Winter 2017, Day 18 (B00), Day 12 (A00) February 24, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 MT2 Review Sessions Today and Tomorrow! TODAY
More informationCSE 417 Network Flows (pt 4) Min Cost Flows
CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it
More information