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

Basic set union operation, Q. Basic Set Union Operation? Ans. Supp...

Q. Basic Set Union Operation? Ans. Suppose instead that your school needs to know which students are taking either art or business or both. Then the students who are ta

Function and relation, how to know if it is function and if is relation

how to know if it is function and if is relation

Area of a circle, There's a nice way to show why the expresion for the area...

There's a nice way to show why the expresion for the area of a circle of radius R is: Pi * R 2 . It has an comman relationship with the experation for the circumference of a

Real exponents, It is a fairly short section.  It's real purpose is to ackn...

It is a fairly short section.  It's real purpose is to acknowledge that the exponent properties work for any exponent.  We've already used them on integer and rational exponents al

If an item costs $1.45 to what amount will louise round, Louise is estimati...

Louise is estimating the cost of the groceries in her cart. She rounds the cost of every item to the nearest dollar to form her calculations. If an item costs $1.45, to what amount

Equal groupings -categories of multiplication, Equal groupings - when we...

Equal groupings - when we want to find how many objects there are in several equal-sized sets. (e.g., if there are 3 baskets, each with 4 bananas, 4 oranges and 4 apples, respec

In sequence to remain the pole perpendicular to the ground, A cable is atta...

A cable is attached to a pole 24 ft above ground and fastened to a stake 10 ft from the base of the pole. In sequence to remain the pole perpendicular to the ground, how long is th

Lognormal distribution, The Lognormal Distribution If ln(X) is a normal...

The Lognormal Distribution If ln(X) is a normally distributed random variable, then X is said to be a lognormal variable. If P1, P2, P3, ... are the prices of a scrip in per

Full asymptotic expansion , Consider the integral where the notatio...

Consider the integral where the notation means a contour that is parallel to the real z axis, but moved down by a distance d . Use the method of steepest descents to deri

Determine the domain and range of function, Determine the domain of each of...

Determine the domain of each of the following functions.                         f( x ) = x - 4 / x 2 - 2 x -15 Solution With this problem we have to avoid division by

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