You are on page 1of 6

Project title: Minimal Spanning Tree

Batch: A
1) Abhijeet Pisal

2) Abhishek Kharoshi

3) Aditya Savant

Outline:
*What is a graph?

A linear graph (or simply a graph) G=(V,E) consists of a set of objects V={v1,v2,….}called vertices and
another set E={e1,e2,….}, whose elements are called edges, such that each edge ek is identified with an
unordered pair (vi,vj) of vertices. The vertices vi, vj associated with an edge ek are called end vertices of
ek. The graph is represented by a diagram, in which the vertices are represented as points and edge as a
line joining these vertices.

Example: Graph with five vertices and seven edges

*What is a tree?

A tree is a connected graph without any circuits.

Example:
. *Weighted tree: A weighted tree is a graph (sub graph of a graph) where each edge has a weight. The
weight can be the length of the edge, or the distance between the two points, or it could represent the
difficulty of going between the points, or the cost. In any case, the weight is a number. It will usually be
positive (or non-negative, with zero a possibility), but the math’s is the same if we allow negative
numbers. As it is each edge of the graph that will be assigned a distance, rather than the pairs of vertices
themselves, no distance is assigned for pairs of vertices not joined by an edge.

“Value or weight of a weighted tree is the sum of all weights”.

Example:

*”Spanning Tree” What is a spanning tree?

A tree T is said to be a spanning tree of a connected graph G if T is a sub graph of G and T contains all
vertices of G. For instance, the sub graph in heavy lines in the figure below is the spanning tree of the
graph as shown. Every connected graph has at least one spanning tree.

*Minimal spanning tree:


A spanning tree with the smallest weight in a weighted graph is called a shortest spanning tree or shortest-distance
spanning tree or minimal spanning tree.

In other words, Given a graph G with distances assigned to its edges, then a minimum spanning tree, H, is a
spanning tree of G, where the sum of the weights of the edges are the lowest possible. There may be more than
one minimum spanning tree. For a trivial example, any spanning tree of a graph G, with all weights 1, will be a
minimum spanning tree, with the relevant sum equal to n-1, where n is the number of vertices of the original
graph.
Examples:

1)

2)

*There are two ways of finding a minimal spanning tree namely:

 Kruskal's algorithm and


 Prim's algorithm.
Kruskal's algorithm

Kruskal's algorithm is one way of finding a minimum spanning tree for a network G. We start with a
graph H consisting of all the vertices of G, but with no edges. Then we follow the following instructions:

1. Consider the set E of edges in G, that will connect the end points when added to H
2. Find the member of E with the lowest weight. If there are more than one such member, pick any
one.
3. Add this edge to H
4. If H is not connected, then go back to step 1. Otherwise, H is a minimum spanning tree of G.

Example:

Prim's algorithm

Prim's algorithm is an alternative way of finding a minimum spanning tree for a network G. Again, we
start with a graph H, consisting of all the vertices of G, but with no edges. Then we follow the following
instructions:

1. Pick any vertex v in the graph


2. Make it the only member of a set S
3. Consider the set E of edges joining one member of S to a vertex not in S.
4. Find the member of E with the lowest weight. If there are more than one such member, pick any
one.
5. Add this edge to H, and the add the vertex not in S, to S.
6. If H is not connected, then go back to step 3. Otherwise, H is a minimum spanning tree of G.

Example:
Reference: Narsingh Deo, Wikipedia A-level mathematics.

You might also like