Lecture 11 CSE 331 Sep 21, 2017.

Slides:



Advertisements
Similar presentations
Graph Traversals Visit vertices of a graph G to determine some property: Is G connected? Is there a path from vertex a to vertex b? Does G have a cycle?
Advertisements

Algorithms and Data Structures
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.
Breadth First Search (BFS) Part 2 COMP171. Graph / Slide 2 Shortest Path Recording * BFS we saw only tells us whether a path exists from source s, to.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Lecture 18 CSE 331 Oct 11, Mid term Next Monday in class.
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.
Graphs and MSTs Sections 1.4 and 9.1. Partial-Order Relations Everybody is not related to everybody. Examples? Direct road connections between locations.
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.
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.
Graphs 1 Neil Ghani University of Strathclyde. Where are we …. We studied lists: * Searching and sorting a list Then we studied trees: * Efficient search.
Representing Graphs Depth First Search Breadth First Search Graph Searching Algorithms.
Graph Algorithms BFS, DFS, Dijkstra’s.
Discrete Mathematicsq
Discrete Math 2 Weighted Graph Search Tree
Lecture 12 Graph Algorithms
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Lecture 23 CSE 331 Oct 26, 2016.
CS120 Graphs.
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
Graph Representation (23.1/22.1)
Elementary Graph Algorithms
Lecture 9 CSE 331 Sep 18, 2017.
Lecture 23 CSE 331 Oct 25, 2017.
Lecture 23 CSE 331 Oct 24, 2011.
Yan Shi CS/SE 2630 Lecture Notes
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 28, 2012.
Lecture 12 CSE 331 Sep 26, 2011.
Lecture 14 CSE 331 Sep 29, 2017.
Lecture 9 CSE 331 Sep 19, 2016.
Lecture 11 CSE 331 Sep 23, 2011.
Algorithms Lecture # 29 Dr. Sohail Aslam.
Lecture 15 CSE 331 Oct 3, 2011.
Lecture 11 CSE 331 Sep 19, 2014.
Lecture 24 CSE 331 Oct 24, 2014.
Lecture 12 CSE 331 Sep 22, 2014.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Lecture 11 CSE 331 Sep 22, 2016.
Applications of BFS CSE 2011 Winter /17/2019 7:03 AM.
Richard Anderson Winter 2019 Lecture 6
Lecture 15 CSE 331 Oct 4, 2010.
Lecture 11 Graph Algorithms
Richard Anderson Winter 2019 Lecture 5
Lecture 13 CSE 331 Sep 28, 2016.
Lecture 11 CSE 331 Sep 20, 2013.
Lecture 24 CSE 331 Oct 29, 2018.
Presentation transcript:

Lecture 11 CSE 331 Sep 21, 2017

Mini Project group due Monday!

HW 3 is out!

Support page is very imp.

Solutions to HW 2 Handed out at the end of the lecture

Tree Connected undirected graph with no cycles

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

Questions?

Rest of Today’s agenda Algorithms for checking connectivity Finish Proving 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