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

Coefficients of the equation, If coefficients of the equation ax 2 + bx + ...

If coefficients of the equation ax 2 + bx + c = 0, a ¹ 0 are real and roots of the equation are non-real complex and  a + c (A) 4a + c > 2b (B) 4a + c Please give t

Horizontal asymptotes, Horizontal asymptotes : Such as we can have vert...

Horizontal asymptotes : Such as we can have vertical asymptotes defined in terms of limits we can also have horizontal asymptotes explained in terms of limits. Definition

Invoices and trade discounts, Natureland garden center buys lawn mowers tha...

Natureland garden center buys lawn mowers that list for $679.95 less a 30% discount. What is the dollar amount of the discount?

Compute the measure of the larger angle, Two angles are supplementary. The ...

Two angles are supplementary. The evaluate of one is 30 more than twice the measure of the other. Determine the measure of the larger angle. a. 130° b. 20° c. 50° d. 70

Derive the probability distribution of the completion times, Derive the pro...

Derive the probability distribution of the completion times: a. The following probability distributions relate to the completion times, in weeks, T A and T B of two independ

Find where the breakdown occurred and his original speed, A cyclist, after ...

A cyclist, after riding a certain distance, stopped for half an hour to repair his bicycle, after which he completes the whole journey of 30km at half speed in 5 hours.  If the bre

Calculate the net amount and distance, 1. A train on the Bay Area Rapid Tra...

1. A train on the Bay Area Rapid Transit system has the ability to accelerate to 80 miles/hour in half a minute. A.   Express the acceleration in miles per hour per minute. B

Logarithms, how do they solve log9 = ... 27

how do they solve log9 = ... 27

Graphing , what effect is the constant in an equation have on an graph

what effect is the constant in an equation have on an graph

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