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

Quadratic equation, for what k, q.p. kx2-8x+k can be factored into real lin...

for what k, q.p. kx2-8x+k can be factored into real linear factors. kx2-8x+k

Introduction to knowing your maths learner, INTRODUCTION : The other day I...

INTRODUCTION : The other day I overheard 6-year-old Ahmed explaining to his older sister about why swallowing the seeds of an orange is harmful. He said, "The seed will become a p

Theory of meta-games, Theory of Meta-games This theory shows to describ...

Theory of Meta-games This theory shows to describe how most people play non zero sum games concerning a number of persons Prisoner's dilemma is an illustration of this. The

Inequalities, seven more than a number is less than or equal to -18

seven more than a number is less than or equal to -18

Math help until tuesday, I need help with pre algebra in 5th grade intermid...

I need help with pre algebra in 5th grade intermidate school math until Tuesday afternoon please

Probability, Mike sells on the average 15 newspapers per week (Monday – Fri...

Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers

What is the maximum volume of rectangular box, 1. A rectangular piece of ca...

1. A rectangular piece of cardboard measuring 26 inches by 42 inches is to be made into a box with an open top by cutting equal size squares from each comer and folding up the side

What is inductive reasoning, What is Inductive Reasoning ? Sometimes we...

What is Inductive Reasoning ? Sometimes we draw conclusions based on our observations. If we observe the same results again and again, we conclude that the event always has the

Help with individual questions, Hi, I''m looking for assistance/solutions t...

Hi, I''m looking for assistance/solutions to individual questions. I''ve already answered them but seek confirmation my answers are correct. I don''t want answers to a complete e

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