CONSTRUCTION OF MINIMUM COST SPANNING TREE

 

   CONSTRUCTION OF MINIMUM COST SPANNING TREE

Let, G = (V, E) be an undirected connected weighted graph with n vertices, where V is the set of vertices, E is the set of edges and W be the set of weights (cost) associated to respective edges of the graph.

Where   the edge adjacent to vertices

 = the weight associated to the edge .

 The Weight Matrix M of the graph G is constructed as follows: If there is an edge between the vertices in G

then Set,  =  Else Set,  = 0

 Algorithm: Input: the weight matrix  for the undirected weighted graph G

Output: Minimum Cost Spanning Tree T of G.

Step 1: Start

Step 2: Repeat Step 3 to Step 4 until all (n-1) elements matrix of M are either marked or set to zero or in other words all the nonzero elements are marked

Step 3: Search the weight matrix M either column-wise or row-wise to find the unmarked nonzero minimum element  which is the weight of the corresponding edge   in M.

Step 4: If the corresponding edge   of selected  forms cycle with the already marked elements in the elements of the M then Set = 0 Else Mark  

Step 5: Construct the graph T including only the marked elements from the weight matrix M which shall be the desired Minimum cost spanning tree of G.                                      

Fig 1

 NUMERICAL EXAMPLE:

Consider the following graph and its shows the various steps involved in the construction of the minimum cost spanning tree

Fig 2 Graph G

Fig 3[ Matrix of graph G]

From fig 2 Graph G = (V, E) where V is the set of vertices and E represents the edge with weigh are also given. Here V=7 and Edge = 9.

Fig 3 represents the adjacent matrix for the given graph.

Fig 4 graph G

Fig 5 weight matrix

  Fig 4 The minimum element 10 is selected and the corresponding edges (1, 6) are also marked by the color pink. Repeat the process till the iteration will exist

fig 6

Fig7 weight matrix

 From Fig 6 and 7 the next non zero minimum element 12 is marked and the corresponding edges are also colored.

Fig 8

               

 The next non zero minimum element 14 is marked it is shown in the Fig 8. The corresponding marked edges are shown in below Fig 9.

Fig 9 adjacent matrix

Fig 10 adjacent matrix

From Fig 10. the next minimum element 16 is marked.

 

 

 

Fig 11, Adjacent matrix

From Fig 11 the next minimum non zero element18 is marked. But while drawing the edges it forms the circuit so we remove and mark it as 0 instead of 18.

Fig 12 circuit (2,3,4,7)

Next, we go to next minimum element that is 22 it is marked and shown in same Fig 12. and the both marking process of the edges 18 and 19 were shown below figs.

Fig 13

Fig 14

The next minimum element is 24 while marking that its forms a circuit so we mark 0 instead of 24 and we move to the final marking process that is the minimum element is 25 is shaded and edges are colored.

Fig 15 final stage.

We have to study the minimum cost spanning tree using the Matrix Algorithm and find the minimum cost is 99 [1]. So, the final path of minimum cost of spanning is {1, 6}, {6, 5}, {5, 4}, {4, 3}, {3, 2}, {2, 7}.

Comments

Popular posts from this blog

theorem of graph theory

PRIM’S ALGORITHM