Graphs 1.3

# Graphs 1.3 - Spanning Trees A spanning tree of a connected...

This preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: Spanning Trees A spanning tree of a connected graph is a spanning subgraph that is a tree A spanning tree is not unique unless the graph is a tree Spanning trees have applications to the design of communication networks Graph A spanning forest of a graph is a spanning subgraph that is a forest Spanning tree CSE 2011 Prof. J. Elder - 11 - Last Updated: 4/1/10 10:16 AM Reachability in Directed Graphs A node w is reachable from v if there is a directed path originating at v and terminating at w. E is reachable from B B is not reachable from E E D C F A CSE 2011 Prof. J. Elder B - 12 - Last Updated: 4/1/10 10:16 AM Properties Property 1 Notation v deg(v) |V| number of edges deg(v) Proof: each edge is counted twice number of vertices |E| = 2|E| degree of vertex v Property 2 In an undirected graph with no self-loops and no multiple edges |E| |V| (|V| Example |V| = 4 |E| = 6 deg(v) = 3 1)/2 Proof: each vertex has degree at most (|V| 1) Q: What is the bound for a digraph? A: E V (V CSE 2011 Prof. J. Elder 1) - 13 - Last Updated: 4/1/10 10:16 AM Main Methods of the (Undirected) Graph ADT Vertices and edges Update methods are positions insertVertex(o): insert a vertex storing element o store elements insertEdge(v, w, o): insert an edge (v,w) storing element o Accessor methods endVertices(e): an array of the two endvertices of e removeVertex(v): remove vertex v (and its incident edges) opposite(v, e): the vertex opposite to v on e removeEdge(e): remove edge e Iterator methods areAdjacent(v, w): true iff v and w are adjacent replace(v, x): replace element at vertex v with x replace(e, x): replace element at edge e with x CSE 2011 Prof. J. Elder - 14 - incidentEdges(v): edges incident to v vertices(): all vertices in the graph edges(): all edges in the graph Last Updated: 4/1/10 10:16 AM Directed Graph ADT Additional methods: isDirected(e): return true if e is a directed edge insertDirectedEdge(v, w, o): insert and return a new directed edge with origin v and destination w, storing element o CSE 2011 Prof. J. Elder - 15 - Last Updated: 4/1/10 10:16 AM ...
View Full Document

## This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Ask a homework question - tutors are online