lec14 - Lecture 14 Connectedness in graphs Spanning trees...

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

View Full Document Right Arrow Icon
Page 1 of 29 CSE 100, UCSD: LEC 14 Lecture 14 Connectedness in graphs Spanning trees in graphs Finding a minimal spanning tree Time costs of graph problems and NP-completeness Finding a minimal spanning tree: Prim’s and Kruskal’s algorithms Intro to disjoint subsets and union/find Reading: Weiss, Ch. 9, Ch 8
Background image of page 1

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

View Full DocumentRight Arrow Icon
Page 2 of 29 CSE 100, UCSD: LEC 14 Connectedness of graphs Some definitions: An undirected graph is connected if For every vertex v in the graph, there is a path from v to every other vertex A directed graph is strongly connected if For every vertex v in the graph, there is a path from v to every other vertex A directed graph is weakly connected if The graph is not strongly connected, but the underlying undirected graph (i.e., considering all edges as undirected) is connected A graph is completely connected if for every pair of distinct vertices v 1, v 2, there is an edge from v 1 to v 2
Background image of page 2
Page 3 of 29 CSE 100, UCSD: LEC 14 Connected graphs: an example Consider this undirected graph: Is it connected? Is it completely connected? V0 V1 V4 V6 V5 V2 V3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Page 4 of 29 CSE 100, UCSD: LEC 14 Strongly/weakly connected graphs: an example Consider this directed graph: Is it strongly connected? Is it weakly connected? Is it completely connected? V0 V1 V4 V6 V5 V2 V3
Background image of page 4
Page 5 of 29 CSE 100, UCSD: LEC 14 Spanning trees We will consider spanning trees for un directed graphs A spanning tree of an undirected graph G is an undirected graph that. .. contains all the vertices of G contains only edges of G has no cycles is connected So, only connected graphs have spanning trees A spanning tree is called “spanning” because it connects all the graph’s vertices A spanning tree is called a “tree” because it has no cycles (recall the definition of cycle for undirected graphs) What is the root of the spanning tree? you could pick any vertex as the root; the vertices adjacent to that one are then the children of the root; etc.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Page 6 of 29 CSE 100, UCSD: LEC 14 Spanning trees: examples Consider this undirected graph G: V0 V1 V4 V6 V5 V2 V3
Background image of page 6
Page 7 of 29 CSE 100, UCSD: LEC 14 Spanning tree? Ex. 1 Is this graph a spanning tree of G? V0 V1 V4 V6 V5 V2 V3
Background image of page 7

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

View Full DocumentRight Arrow Icon
Page 8 of 29 CSE 100, UCSD: LEC 14 Spanning tree? Ex. 2 Is this graph a spanning tree of G? V0 V1 V4 V6 V5 V2 V3
Background image of page 8
Page 9 of 29 CSE 100, UCSD: LEC 14 Spanning tree? Ex. 3 Is this graph a spanning tree of G? V0 V1 V4 V6 V5 V2 V3
Background image of page 9

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

View Full DocumentRight Arrow Icon
Page 10 of 29 CSE 100, UCSD: LEC 14 Spanning tree? Ex. 4 Is this graph a spanning tree of G? V0 V1 V4 V6 V5 V2 V3
Background image of page 10
Page 11 of 29 CSE 100, UCSD: LEC 14 Multiple spanning trees In general a graph can have more than one spanning tree. All these are spanning trees of that graph G (and there are more): Note: The spanning tree for a graph with N vertices always has N-1 edges (like a tree!) V0 V1 V4 V6 V5 V2 V3 V0 V1 V4 V6 V5 V2 V3 V0 V1 V4 V6 V5 V2 V3 V0 V1 V4 V6 V5 V2 V3
Background image of page 11

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

View Full DocumentRight Arrow Icon
Page 12 of 29 CSE 100, UCSD: LEC 14 Finding a spanning tree in an unweighted graph A spanning tree in an unweighted graph is easy to construct.
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/15/2010 for the course CSE CSE100 taught by Professor Kube during the Fall '09 term at UCSD.

Page1 / 29

lec14 - Lecture 14 Connectedness in graphs Spanning trees...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online