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

Which expression has an answer of 18, Which expression has an answer of 18?...

Which expression has an answer of 18? Use the order of operations and try every option. The first option results in 14 since 2 . 5 = 10, then 10 + 4 = 14. This does not work. T

Proof of sum-difference of two functions, Proof of Sum/Difference of Two Fu...

Proof of Sum/Difference of Two Functions : (f(x) + g(x))′  = f ′(x) +  g ′(x)  It is easy adequate to prove by using the definition of the derivative.  We will start wi

Vectors, A triangle has vertices A (-1, 3, 4) B (3, -1, 1) and C (5, 1, 1)....

A triangle has vertices A (-1, 3, 4) B (3, -1, 1) and C (5, 1, 1). The area of ABC is a) 30.1 b) 82.1 c) 9.1 d) 52.1

Analysis and optimization, 1. In an in finite horizon capital/consumption m...

1. In an in finite horizon capital/consumption model, if kt and ct are the capital stock and consumption at time t, we have f(kt) = ct+kt+1 for t ≥ 0 where f is a given production

Angles, samuel left mauritius at 22:30 on saturday and travelled to london ...

samuel left mauritius at 22:30 on saturday and travelled to london (GMT) for 14h30min he had a stopover for 4 h in london and he continued to travel to toronto for another 6h20min

Determine radicals in exponent form, Evaluate following.               ...

Evaluate following.                √16 and Solution To evaluate these first we will convert them to exponent form and then evaluate that since we already know how to

Describe adding and subtracting fractions in details, Describe Adding and S...

Describe Adding and Subtracting Fractions in details? To add or subtract fractions, here are some steps: 1. Find the lowest common denominator (LCD) or any common denominato

Equation of a straight line, In a two dimensional case, the form of t...

In a two dimensional case, the form of the linear function can be obtained if we know the co-ordinates of two points on the straight line. Suppose  x' and  x"  are two

Find and classify the differential equation, Find and classify the equilibr...

Find and classify the equilibrium solutions of the subsequent differential equation. y' = y 2 - y - 6 Solution The equilibrium solutions are to such differential equati

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