Lecture 11 CSE 331 Sep 19, 2014.

Slides:



Advertisements
Similar presentations
Coloring Warm-Up. A graph is 2-colorable iff it has no odd length cycles 1: If G has an odd-length cycle then G is not 2- colorable Proof: Let v 0, …,
Advertisements

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 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,
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
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.
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
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.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Graph Representations And Traversals. Graphs Graph : – Set of Vertices (Nodes) – Set of Edges connecting vertices (u, v) : edge connecting Origin: u Destination:
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
Breadth-First Search (BFS)
Graph Algorithms BFS, DFS, Dijkstra’s.
CSE373: Data Structures & Algorithms Lecture 19: Spanning Trees
Lecture 12 Graph Algorithms
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
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.
Richard Anderson Lecture 4
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.
Algorithms (2IL15) – Lecture 5 SINGLE-SOURCE SHORTEST PATHS
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 24 CSE 331 Oct 29, 2012.
Lecture 23 CSE 331 Oct 24, 2011.
Lecture 13 CSE 331 Sep 27, 2017.
Lecture 16 CSE 331 Oct 4, 2017.
Lecture 13 CSE 331 Sep 24, 2013.
Richard Anderson Autumn 2016 Lecture 5
Lecture 12 CSE 331 Sep 28, 2012.
Lecture 12 CSE 331 Sep 26, 2011.
Lecture 14 CSE 331 Sep 29, 2017.
Lecture 33 CSE 331 Nov 15, 2013.
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 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) V are the vertices; E are the edges.
Lecture 11 CSE 331 Sep 22, 2016.
Richard Anderson Winter 2019 Lecture 6
Richard Anderson Lecture 5 Graph Theory
Lecture 15 CSE 331 Oct 4, 2010.
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 11 CSE 331 Sep 19, 2014

HW 2 due today I will not accept HWs after 1:15pm Place Q1, Q2 and Q3 in separate piles I will not accept HWs after 1:15pm

Other HW related stuff HW 3 has been posted online: see piazza Solutions to HW 2 at the END of the lecture Graded HW 1 available from Monday onwards

Out of town next week Andrew Hughes will cover the lecture for me

Graphs Graph G = (V,E) Directed vs Undirected (default) u w No “self loops”

Paths , , Sequence of vertices connected by edges Connected Path length 3 ,

Connectivity u and w are connected iff there is a path between them A graph is connected iff all pairs of vertices are connected

Connected Graphs Every pair of vertices has a path between them

Cycles Sequence of k vertices connected by edges, first k-1 are distinct ,

Formally define everything http://imgs.xkcd.com/comics/geeks_and_nerds.png

Rest of Today’s agenda Prove n vertex tree has n-1 edges Formal definitions of paths, cycles, connectivity and trees Prove n vertex tree has n-1 edges Algorithms for checking connectivity

HW 2 due today I will not accept HWs after 1:15pm Place Q1, Q2 and Q3 in separate piles I will not accept HWs after 1:15pm

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”

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