Lecture 12 CSE 331 Sep 28, 2012.

Slides:



Advertisements
Similar presentations
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
Advertisements

Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
Lecture 13 CSE 331 Oct 2, Announcements Please turn in your HW 3 Graded HW2, solutions to HW 3, HW 4 at the END of the class Maybe extra lectures.
Lecture 16 CSE 331 Oct 9, Announcements Hand in your HW4 Solutions to HW4 next week Remember next week I will not be here so.
Lecture 12 CSE 331 Sep 30, Announcements Final exam: Dec 16, 11:45am-2:45pm, NSC 210 HW 2 solutions at the end of the lecture Mid term: Oct 16,
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Lecture 13 CSE 331 Oct 2, Announcements Mid term in < 2 weeks Graded HW2 at the END of the class.
Lecture 11 CSE 331 Sep 25, Homeworks Please hand in your HW 2 now HW 3 and graded HW 1 at the end of class.
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
Lecture 5 CSE 331. Graphs Problem Statement Algorithm Problem Definition “Implementation” Analysis A generic tool to abstract out problems.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
Lecture 12 CSE 331 Sep 28, Upcoming Important Dates Tuesday Oct 8 (~1.5 weeks) Mini Project group compositions Monday Oct 12 (2 weeks) Quiz 1 Monday.
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
Graph Algorithms BFS, DFS, Dijkstra’s.
Discrete Mathematicsq
CSE373: Data Structures & Algorithms Lecture 19: Spanning Trees
Lecture 12 Graph Algorithms
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Lecture 20 CSE 331 Oct 15, 2010.
Lecture 23 CSE 331 Oct 26, 2016.
Lecture 17 CSE 331 Oct 3, 2014.
Lecture 10 CSE 331 Sep 21, 2016.
Lecture 10 CSE 331 Sep 20, 2017.
Lecture 15 CSE 331 Oct 5, 2012.
Lecture 15 CSE 331 Sep 29, 2014.
CSE 421: Introduction to Algorithms
Lecture 14 CSE 331 Sep 30, 2016.
Lecture 13 CSE 331 Sep 29, 2010.
Lecture 12 CSE 331 Sep 26, 2016.
Lecture 12 CSE 331 Sep 25, 2017.
Lecture 14 CSE 331 Sep 30, 2011.
Lecture 13 CSE 331 Oct 1, 2012.
Lecture 24 CSE 331 Oct 25, 2013.
Chapter 22: Elementary Graph Algorithms I
Lecture 9 CSE 331 Sep 18, 2017.
Lecture 23 CSE 331 Oct 25, 2017.
Lecture 23 CSE 331 Oct 24, 2011.
Lecture 13 CSE 331 Sep 27, 2017.
CSE 421: Introduction to Algorithms
Lecture 13 CSE 331 Sep 24, 2013.
Richard Anderson Autumn 2016 Lecture 5
Lecture 12 CSE 331 Sep 26, 2011.
Lecture 14 CSE 331 Sep 29, 2017.
Lecture 9 CSE 331 Sep 19, 2016.
Lecture 22 CSE 331 Oct 15, 2014.
Lecture 11 CSE 331 Sep 23, 2011.
Richard Anderson Winter 2009 Lecture 6
Lecture 15 CSE 331 Oct 3, 2011.
Lecture 11 CSE 331 Sep 19, 2014.
Lecture 10 CSE 331 Sep 21, 2012.
Lecture 24 CSE 331 Oct 24, 2014.
Lecture 36 CSE 331 Nov 30, 2012.
Lecture 11 CSE 331 Sep 21, 2017.
Lecture 12 CSE 331 Sep 22, 2014.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Lecture 26 CSE 331 Nov 1, 2010.
Lecture 11 CSE 331 Sep 22, 2016.
Lecture 25 CSE 331 Oct 28, 2011.
Richard Anderson Winter 2019 Lecture 6
Richard Anderson Lecture 5 Graph Theory
Lecture 15 CSE 331 Oct 4, 2010.
CSE 373: Data Structures and Algorithms
Lecture 11 Graph Algorithms
Richard Anderson Winter 2019 Lecture 5
Lecture 13 CSE 331 Sep 28, 2016.
Richard Anderson Autumn 2015 Lecture 6
Lecture 11 CSE 331 Sep 20, 2013.
Lecture 36 CSE 331 Nov 22, 2013.
Lecture 24 CSE 331 Oct 29, 2018.
Presentation transcript:

Lecture 12 CSE 331 Sep 28, 2012

HW 3 due today I will not take any HW after 1:15pm Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm

Interview Pro Current engineers Potential leg-up on hiring Monday (10/1) - 6-8:30 - Salvadore Lounge (2nd Floor Davis Hall) - Resumes/fancy clothing optional Current engineers Potential leg-up on hiring Learn industry expectations Free Food/Swag Sign up here

Other HW related stuff HW 4 has been posted online: see blog/piazza Solutions to HW 3 at the END of the lecture Graded HW 2: pickup from TAs next week

Tree Connected undirected graph with no cycles

Rooted Tree

A rooted tree AC’s child=SG Pick any vertex as root SG’s parent=AC Let the rest of the tree hang under “gravity”

HW 3 due today I will not take any HW after 1:15pm Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm

Rest of Today’s agenda Prove n vertex tree has n-1 edges Algorithms for checking connectivity

Checking by inspection

What about large graphs? Are s and t connected?

Brute-force algorithm? List all possible vertex sequences between s and t nn such sequences Check if any is a path between s and t

Algorithm motivation all

Distance between u and v Length of the shortest length path between u and v Distance between RM and BO? 1

Questions?

Breadth First Search (BFS) Is s connected to t? Build layers of vertices connected to s Lj : all nodes at distance j from s L0 = {s} Assume L0,..,Lj have been constructed Lj+1 set of vertices not chosen yet but are connected to Lj Stop when new layer is empty

Exercise for you Prove that Lj has all nodes at distance j from s

BFS Tree BFS naturally defines a tree rooted at s Add non-tree edges Lj forms the jth “level” in the tree u in Lj+1 is child of v in Lj from which it was “discovered” 1 7 1 L0 2 3 L1 2 3 8 4 5 4 5 7 8 L2 6 6 L3