CSE331 Lecture 12

# CSE331 Lecture 12 - L j all nodes at distance j from s L j...

This preview shows pages 1–13. Sign up to view the full content.

Lecture 12 CSE 331 Sep 26, 2011

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Reminders HW 1 ready for pickup MID TERM IN 2 WEEKS (in class)
Determining connectivity in graphs s t Are s and t connected? http://www.cise.ufl.edu/research/sparse/matrices/Nasa/barth5.html

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Brute-force algorithm List all possible distinct vertex sequences between s and t Check if any is a path between s and t n! such sequences n! such sequences
Algorithm motivation al l al l

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Distance between u and v Length of the shortest length path between u and v Distance between RM and BO? 1
Questions?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Breadth First Search (BFS) Is s connected to t ? Build layers of vertices connected to s L 0 = {s} Assume L 0 ,..,L j have been constructed L j+1 set of vertices not chosen yet but are connected to L j Stop when new layer is empty

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: L j : all nodes at distance j from s L j : all nodes at distance j from s Exercise for you Prove that L j has all nodes at distance j from s BFS Tree BFS naturally defines a tree rooted at s L j forms the j th “level” in the tree u in L j+1 is child of v in L j from which it was “discovered” 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 1 1 2 2 3 3 L L 1 4 4 5 5 7 7 8 8 L 2 6 6 L 3 Add non-tree edges Add non-tree edges Connected Component Connected component (of s ) is the set of all nodes connected to s Algo to compute the connected component of s ? Today’s agenda Every edge in is between consecutive layers Computing Connected component...
View Full Document

{[ snackBarMessage ]}

### Page1 / 13

CSE331 Lecture 12 - L j all nodes at distance j from s L j...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online