Write prim's algorithm, Mathematics

Assignment Help:

Write Prim's Algorithm.  

Ans: Prim's algorithm to find out a minimum spanning tree from a weighted graph in step by step form is given below. 

Let G = (V, E) be graph and S = (VS, ES) be the spanning tree to be found from G.

Step 1: Choose a vertex v1 of V and initialize 

VS = {v1} and

ES

= {}

Step 2: Choose a nearest neighbor of vi from V that is adjacent to some vj∈VS and that edge (vi, vj) does not form a cycle with members edge of ES. Set

VS = VS ∪{vi} and

ES = ES ∪{(vi, vj)}  

Step 3: Again Repeat step2 until |Es| = |V| - 1.


Related Discussions:- Write prim's algorithm

Sketch the feasible region, Sketch the feasible region for the following se...

Sketch the feasible region for the following set of constraints: 3y - 2x  ≥ 0 y + 8x  ≤  53 y - 2x  ≤  2 x  ≥ 3. Then find the maximum and minimum values of the objective

Surface areas and volumes, a conical vessel of radius 6cm and height 8cm is...

a conical vessel of radius 6cm and height 8cm is completely filled with water.a sphere is lowered into the water and its size is such that when it touches the size it is immersed.w

Definition of functions, Definition: An equation is considered as function...

Definition: An equation is considered as function if for any x in the domain of the equation (the domain is the entire x's which can be plugged into the equation) the equation wil

Calculus, I need an explanation of "the integral, from b to a, of the deriv...

I need an explanation of "the integral, from b to a, of the derivative of f (x). and, the integral from a to b. of the derivative of f(t) dt.

Exponets, what does the three mean in the power ?

what does the three mean in the power ?

Population problem - nonhomogeneous systems, The next kind of problem seems...

The next kind of problem seems as the population problem. Back in the first order modeling section we looked at several population problems. In such problems we noticed a single po

Help, Two sessions of swimming lessons were held at a pool. In the first se...

Two sessions of swimming lessons were held at a pool. In the first session 40 students attended. Of these 40 students 60% were girls. How many girls attended the first session of s

Lesson 6 Homework Practice, For every girl taking classes at the martial ar...

For every girl taking classes at the martial arts school there are 3 boys who are taking classes at the school. If there are 236 students taking classes write and solve a proportio

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd