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

Stakeholders, what is the benefit for stakeholders or disadvantage in a mon...

what is the benefit for stakeholders or disadvantage in a monoply

Determine the optimal strategy, On a picnic outing, 2 two-person teams are ...

On a picnic outing, 2 two-person teams are playing hide-and-seek. There are four hiding locations (A, B, C, and D), and the two peoples of the hiding team can hideseparately in any

What is the ratio of the areas of sectors , What is the ratio of the areas ...

What is the ratio of the areas of sectors I and II ?                               (Ans:4:5) Ans:    Ratio will be 120/360  Π r 2 : 150/360  Π r 2 4/12  : 5/12  =

Arden''s Theorem, Find the Regular Grammar for the following Regular Expres...

Find the Regular Grammar for the following Regular Expression: a(a+b)*(ab*+ba*)b.

Determine how many poles are there in the stack, 1. A stack of poles has 22...

1. A stack of poles has 22 poles in the bottom row, 21 poles in the next row, and so on, with 6 poles in the top row. How many poles are there in the stack? 2. In the formula N

Two tailed tests, Two Tailed Tests A two tailed test is generally used ...

Two Tailed Tests A two tailed test is generally used in statistical work as tests of significance for illustration, if a complaint lodged by the client is about a product not m

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

Trignometry, Prove that cosec2theta+ sec2theta can never be less than 2

Prove that cosec2theta+ sec2theta can never be less than 2

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