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

Estimate the area between f ( x ) =x3 - 5x2 + 6 x + 5, Estimate the area be...

Estimate the area between f ( x ) =x 3 - 5x 2 + 6 x + 5 and the x-axis by using n = 5 subintervals & all three cases above for the heights of each of the rectangle. Solution

Partial Differential Equation, Consider the wave equation u_tt - u_xx = 0 w...

Consider the wave equation u_tt - u_xx = 0 with u(x, 0) = f(x) = 1 if -1 Please provide me a detailed answer. I had worked the most part of this question and the only I would like

How does the algorithm work?, How Does The Algorithm Work? Most of us, ...

How Does The Algorithm Work? Most of us, when asked to multiply, say, 35 by 23, write Why do we place the mark x (or 0, or leave a blank) in the second row of the calcul

Mathematic Modeling, Ask question I have 2 problems I need them after 7 hou...

Ask question I have 2 problems I need them after 7 hours

Money, What is the formulate of finding commission

What is the formulate of finding commission

Closure : Activity 5.4, A classmate mixes 2 drops of red food coloring for ...

A classmate mixes 2 drops of red food coloring for every 4 drops of blue food coloring. Create a ratio table with 5 entries to represent this situation. Write the entries of the ra

Linear Equations of Parallel Lines, A line has the equation 2y=-3x+1. Find...

A line has the equation 2y=-3x+1. Find an equation of a line parallel to this line that has a y-intercept of -2.

Simple interest, find the simple interest on Rs. 68,000 at 50/3 per annum f...

find the simple interest on Rs. 68,000 at 50/3 per annum for 9 month

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