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

Progressions, what value of k is he sequence 2k+4,3k-7,k+12 are in an arith...

what value of k is he sequence 2k+4,3k-7,k+12 are in an arithmetic sequence is

Derivative, Uses of derivative in daily life with examples.

Uses of derivative in daily life with examples.

Cylindrical coordinates - three dimensional space, Cylindrical Coordinates ...

Cylindrical Coordinates - Three Dimensional Space Since with two dimensional space the standard (x, y, z) coordinate system is known as the Cartesian coordinate system.  In the

3-d coordinate system - three dimensional spaces, The 3-D Coordinate System...

The 3-D Coordinate System We will start the chapter off with a quite brief discussion introducing the 3-D coordinate system and the conventions that we will be utilizing.  We

Calculate plurality based on the number of voters and candid, Consider an e...

Consider an election with 721 voters. A) If there are 5 candidates, at least x votes are needed to have a plurality of the votes. Find x. B) Suppose that at least 73 votes are n

Mensuration, A palm tree of heights 25m is broken by storm in such a way th...

A palm tree of heights 25m is broken by storm in such a way that its top touches the ground at a distance of 5m from its root,but is not separated from the tree.Find the height at

Constructing a dfa/nfa or a regex), Let ∑ = (0, 1). Define the following la...

Let ∑ = (0, 1). Define the following language: L = {x | x contains an equal number of occurrences of 01 and 10} Either prove L is regular (by constructing a DFA/NFA or a rege

Boeing Company and Ingredient Branding Strategies, . The Boeing Company ma...

. The Boeing Company makes a number of different types of aircraft for the commercial airline industry, e.g., the 727, 747, 757, 767, and 777 jet models. Is there any way for Boei

Basic concepts of second order differential equations, In this section we w...

In this section we will be looking exclusively at linear second order differential equations. The most common linear second order differential equation is in the type.  p (t ) y

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