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

Parallelogram, fig angles of a irregular polygons exterior and interior .

fig angles of a irregular polygons exterior and interior .

Euler equations, Euler Equations - Series Solutions to Differential Equ...

Euler Equations - Series Solutions to Differential Equations In this section we require to look for solutions to, ax 2 y′′ + bxy′ + cy = 0 around x0  = 0. These ki

Find integer if consecutive even integers is the number 126, The sum of two...

The sum of two consecutive even integers is the number 126. What are the integers? Two consecutive even integers are numbers in sequence, such as 4 and 6 or -30 and -32, that a

Credit and invoice, mr ouma bought two sets of spanners for sh 300per set ...

mr ouma bought two sets of spanners for sh 300per set two machanic vice at sh 1000each three set of screw driver at sh 115 per set and tool box for sh 300

Trigonometry, how to change sin 24 degree in digits?

how to change sin 24 degree in digits?

By the last gymnastics competition estimate keri total score, In her last g...

In her last gymnastics competition Keri scored a 5.6 on the floor exercise, 5.85 on the vault, and 5.90 on the balance beam. What was Keri's total score? Keri's three scores re

Find the number of ways to arrange words, Q. Find the number of ways three ...

Q. Find the number of ways three letter "words" can be chosen from the alphabet if none of the letters can be repeated? Solution:  There are 26 ways of choosing the first lett

An example of build upon the child''s background, What are the other differ...

What are the other differences between learners that a teacher needs to keep in mind, while teaching?  Let us see an example in which a teacher took the pupil's background into acc

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