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

Find out a particular solution to equation, Example: Find out a particular...

Example: Find out a particular solution to y'' - 4y' - 12 y = 3e 5t Solution The point here is to get a particular solution, though the first thing that we're going to

Vector calculus, If F ( x,y, z) = x y² y4 i + ( 2x2 y + z) j - y3 z² k, fin...

If F ( x,y, z) = x y² y4 i + ( 2x2 y + z) j - y3 z² k, find: i). question #Minimum 100 words accepted#

Determine coefficient of traction, Problem 1 Work through TALPAC 10 Bas...

Problem 1 Work through TALPAC 10 Basics (refer to attached handout). Answer the set of questions at the end of tutorial module. Problem 2 Referring to both the haul cyc

Measurement of the sampling distribution, Caterer determines that 87% of p...

Caterer determines that 87% of people who sampled the food thought it was delicious. A random sample of 144 out of population of 5000 taken. The 144 are asked to sample the food. I

Algebra, 00000000110 write in scientific notation

00000000110 write in scientific notation

Ratio, what is the simplest form of 6:9?

what is the simplest form of 6:9?

Determine if the three vectors lie in similar plane or not, Determine if th...

Determine if the three vectors a → = (1, 4, -7), b → = (2, -1, 4) and c → = (0, -9, 18) lie in similar plane or not. Solution Thus, as we noted prior to this example al

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