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

Math Help, 1. Which of the following is greater than 4.3 x 10^9 a. 2.1 x ...

1. Which of the following is greater than 4.3 x 10^9 a. 2.1 x 10^9 b. 3.2 x 10^9 c. 5.3 x 10^9 d. 7.4 x 10^8 2. Which of the following is less than 6.5 x 10^-5 a. 1.4 x 10

Pre-calculus, finding the vertex for the function of the form f(x)=ax^2+bx...

finding the vertex for the function of the form f(x)=ax^2+bx+c

Simple equations, three times the first of the three consecutive odd intege...

three times the first of the three consecutive odd integers is 3 more than twice the third integer. find the third integer.

How to join as maths expert, Sir, I am a Maths teacher from kolkata,India....

Sir, I am a Maths teacher from kolkata,India.i want to join your website as Maths'' expert.Please guide me as to how to join your website and earn some money. I will be really grat

What will the day of the week be the further time at the gym, Max goes to t...

Max goes to the gym every fourth day. Ellen's exercise routine is to go every third day. Today is Monday and both Max and Ellen are at the gym. What will the day of the week be the

Area between curves, Area between Curves In this section we will be fi...

Area between Curves In this section we will be finding the area between two curves. There are in fact two cases that we are going to be looking at. In the first case we des

Definition of a function, A function is a relation for which each of the va...

A function is a relation for which each of the value from the set the first components of the ordered pairs is related with exactly one value from the set of second components of t

Trigonometry, what are reason inside a circle?

what are reason inside a circle?

The length of the rectangle is 2 inches more than the width, The area of a ...

The area of a rectangle is 24 square inches. The length of the rectangle is 2 inches more than the width. How many inches is the width? Let x = the number of inches in the widt

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