Spanning Tree Definition Let G be a connected
Spanning Tree
Definition “Let G be a connected graph. A spanning subgraph of G which is a tree is called a spanning tree of G. ” ie “ a subgraph of G, which is a tree and contains all the vertices of G is called a spanning tree” Branches: The edges which are present in the tree are called the branches of the spanning tree. Chords: The edges which are absent from the tree are called chord of the spanning tree The number of branches in a spanning tree = v-1. The number of chord in a spanning tree = e-v+1
Minimum Spanning tree Prim’s algorithm: Let G=(V, E) be a connected weighted graph. Step 1: Take a vertex V 0 in the graph G. Set T= {V 0 , ф} Step 2: Find the edge e 1=(v 0, v 1) in E such that its one end vertex v 0 is in T and its weight is minimum. Include the vertex v 1 and the edge e 1 in T. ie T={(v 0, v 1) , (e 1)} Step 3: Choose the next edge ei=(vi, vj) in such a way that its one end vertex vi is in T and the other end vertex vj is not in T ( ie ei should not form the ckt. )and the weight of the ei is as small as possible. Step 4 : Repeat step 3 untill T contains all the vertex of G. The set T will give the minimum spanning tree.
Kruskal’s algorithm: Let G=(V, E) be a weighted connected graph. Step 1: Pick up an edge ei of G such that its weight is minimum. Step 2: If edge e 1, e 2, e 3…. . Ek, have been selected , then pick an edge ek+1 1) ek+1 != ei for any i= 1, 2, 3……. k. 2) The edge e 1, e 2…. ek, ek+1 do not form a ckt. 3) The weight w(ek+1) is as small as possible(Subject to condition 2) Step 3: stop when all vertices included & step 2 can’t be implemented.
- Slides: 4