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

Quadratic equations by completing the square method, Can we solve the Quadr...

Can we solve the Quadratic Equations by completing the square method? if yes explain it.

Build an equation for a hyperboloid of two sheets, 1. Build an equation for...

1. Build an equation for a hyperboloid of two sheets with the following properties: a. The central axis of the hyperboloid is the y-axis b. The two sheets are 4 units apart, an

Activities to develop ability to classify, Let us now look at some activiti...

Let us now look at some activities that can be organised with preschoolers to develop their ability to classify. 1. You could start by giving children different materials to pla

What is the value of the lesser integer, The sum of three times a greater i...

The sum of three times a greater integer and 5 times a lesser integer is 9. Three less than the greater equivalent the lesser. What is the value of the lesser integer? Let x =

Two train leave show many hours will take before trains pass, Two trains le...

Two trains leave two different cities 1,029 miles apart and head directly toward every other on parallel tracks. If one train is traveling at 45 miles per hour and the other at 53

Find the solution to initial value problem, Illustration:   Find the soluti...

Illustration:   Find the solution to the subsequent IVP. ty' + 2y = t 2 - t + 1,      y(1) = ½ Solution : Initially divide via the t to find the differential equation in

Power of iota, The next topic that we desire to discuss here is powers of i...

The next topic that we desire to discuss here is powers of i. Let's just take a look at what occurring while we start looking at many powers of i . i 1 = i

How many 6-inch tiles are required to tile the floor, Mark intends to tile ...

Mark intends to tile a kitchen floor, which is 9 by 11 ft. How many 6-inch tiles are required to tile the floor? a. 60 b. 99 c. 396 c. Since the tiles are calculated in

Relative frequency definition, Relative Frequency  This type of probab...

Relative Frequency  This type of probability requires us to make some qualifications. We define probability of event A, occurring as the proportion of times A occurs, if we re

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