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

Three set problems, In a class,there are 174 students in form three,86 stud...

In a class,there are 174 students in form three,86 students play table tennis,84 play football and 94 play volleyball,30 play table tennis and volleyball,34 play volleyball and foo

Problem solving sequence: the operations, marianne took $100.00 to a store ...

marianne took $100.00 to a store that was holding a no-tax sale. she bought a shirt for $24.99, sandals for $18.50, shorts for $16.49, and a beach bag for $21.69. how much did she

Functions, The figure shows the sketch graphs of the functions

The figure shows the sketch graphs of the functions

Types of series - special series , Series - Special Series In this pa...

Series - Special Series In this part we are going to take a concise look at three special series.  In fact, special may not be the correct term.  All three have been named th

Linear code with generator matrix , 1. Consider the code of size 4 (4 codew...

1. Consider the code of size 4 (4 codewords) and of length 10 with codewords listed below. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1

Identify the surface for the equation , Identify the surface for each of th...

Identify the surface for each of the subsequent equations. (a) r = 5 (b) r 2 + z 2 = 100 (c) z = r Solution (a)  In two dimensions we are familiar with that this

Maths For Fun, Ask Suppose I offer you a loan to start a safety matchstick ...

Ask Suppose I offer you a loan to start a safety matchstick production unit on the following terms: I shall first advance you Rs.50,000/- to set up your unit, and wait for 3 month

Calculate time interval, From top of a tower a stone is thrown up and it re...

From top of a tower a stone is thrown up and it reaches the ground in time t1. A second stone is thrown down with the same speed and it reaches the ground in t2. A third stone is r

Example of division of fractions, Example of division of fractions: E...

Example of division of fractions: Example: (4/5)/(2/9) = Solution: Step 1:             Invert the divisor fraction (2/9) to (9/2). Step 2:             Multip

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