150 likes | 244 Views
Lecture 11. CSE 331 Sep 25, 2009. Homeworks. Please hand in your HW 2 now. HW 3 and graded HW 1 at the end of class. Graphs. Representation of relationships between pairs of entities/elements. # vertices = n #edges = m. Edge. Vertex. Paths. ,.
E N D
Lecture 11 CSE 331 Sep 25, 2009
Homeworks Please hand in your HW 2 now HW 3 and graded HW 1 at the end of class
Graphs Representation of relationships between pairs of entities/elements # vertices = n #edges = m Edge Vertex
Paths , Sequence of (distinct) vertices connected by edges Connected Path length 3 , , ,
Connected Graphs Every pair of vertices has a path between them
Cycles Sequence of k vertices connected by edges, first k-1 are distinct , , ,
Tree Connected undirected graph with no cycles
A rooted tree How many rooted trees can an n vertex tree have? 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
What about large graphs? s t Are s and t connected?
Brute-force algorithm? List all possible vertex sequences between s and t 2n such sequences Check if any is a path between s and t