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

Decimals, how will the decimal point move when 245.398 is multiplied by 10

how will the decimal point move when 245.398 is multiplied by 10

Define universal set, Q. What is set theory? Define universal set? Ans...

Q. What is set theory? Define universal set? Ans. The  universe , or  universal set , written as  U , is the set that contains all elements being considered in a given dis

Find no. of diagonals, In a polygon no 3 diagnols are concurrent. If the to...

In a polygon no 3 diagnols are concurrent. If the total no of points of intersection are 70 ( interior ). find the no. of diagnols? Ans) Since no 3 diagonals are concurrent, There

Climate and vegetation of southeast asia, 1.) How does the monsoon influenc...

1.) How does the monsoon influence the climate and vegetation of Southeast Asia? 2.) What is the main crop in Southeast Asia and the main systems by which it is produce? How and

Which of the subsequent binomials could represent the length, The area of a...

The area of a rectangle is represented through the trinomial: x 2 + x - 12. Which of the subsequent binomials could represent the length and width? Because the formula for the

The coordinate axes, Trace the curve y 2 = (x + 2) 2 (x - 6). Clearly sta...

Trace the curve y 2 = (x + 2) 2 (x - 6). Clearly state all the properties you have used for tracing it(e.g., symmetry about the axes, symmetry about the origin, points of interse

Find the sum of a+b and a-b, Find the sum of a+b, a-b, a-3b, ...... to 22 t...

Find the sum of a+b, a-b, a-3b, ...... to 22 terms. Ans:    a + b, a - b, a - 3b, up to 22 terms d= a - b - a - b = 2b S22 =22/2 [2(a+b)+21(-2b)] 11[2a + 2b - 42b] =

Exponential functions, Exponential Functions : We'll begin by looking at t...

Exponential Functions : We'll begin by looking at the exponential function,                                                              f ( x ) = a x We desire to differe

Draw the state diagram - transition function, 1. Let M be the PDA with stat...

1. Let M be the PDA with states Q = {q0, q1, and q2}, final states F = {q1, q2} and transition function δ(q0, a, λ) = {[q0, A]} δ(q0, λ , λ) = {[q1, λ]} δ(q0, b, A) = {[q2

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