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

Equation, how do you slove 4u-5=2u-13

how do you slove 4u-5=2u-13

Geometry, what shapes can go into a triangular prism

what shapes can go into a triangular prism

Explain the common forms of linear equations, Explain the Common Forms of L...

Explain the Common Forms of Linear Equations ? An equation whose graph is a line is called a linear equation. Here are listed some special forms of linear equations. Why should

the bug should start to move in order to increase, The temperature at the ...

The temperature at the point (x, y) on a metal plate is given by the function f(x, y) = x 3 + 4xy + y 2 where f is in degrees Fahrenheit and x and y are in inches, with the origin

Type i and type ii errors-rejection and acceptance regions, Type I and type...

Type I and type II errors When testing hypothesis (H 0 ) and deciding to either reject or accept a null hypothesis, there are four possible happenings. a) Acceptance of a t

Determine the approximate raw act score, Using the same mean and standard d...

Using the same mean and standard deviation as mean m = 20.1 and a standard deviation s = 5.8. Joe was informed that he scored at the 68 th percentile on the ACT, what was Joe's ap

Determine the mean of given question, Q . Mrs. Cooper asked her math class ...

Q . Mrs. Cooper asked her math class to keep track of their own grade. Michael, one of the students, lost his assignments, but he remembered the grades of 6 out of 8 assignments:

Algebra, let setM={X,2X,4X} for any numberX .if average (arthemetic mean)of...

let setM={X,2X,4X} for any numberX .if average (arthemetic mean)of the number in setM is 14.what is the value of X?

Find solution to an equation or inequality, Illustrates that each of the fo...

Illustrates that each of the following numbers are solutions to the following equation or inequality. (a) x = 3 in x 2 - 9 = 0 (b) y = 8 in 3( y + 1) = 4 y - 5 Solution

How to solving one-step equations, How to Solving One-Step Equations? E...

How to Solving One-Step Equations? Equations, where one math operation is acting on the variable, can be solved in one step. The trick is to get the variable x by itself - isol

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