Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Network & Security Expert

Question 1.

We have discussed Prim's algorithm in class for computing the minimum spanning tree (MST). The first step is to codify the network information, i.e., how do we represent the link casts? One way is to use a matrix representation. If the link casts have been expressed as a matrix C, then the (i, j)th element of the matrix gives the cost of the link between i and j (obviously, if i = j, Cii = 0, for all i). For example, the cost matrix for the network shown in Fig. 1 is (first row/column is for node A, second row/column is for node B, etc.):

C =

0 1 5 2
1 0 2 6
5 2 0 1 3
2 6 1 0 4
3 0 1
4 1 0

You can assume that the user would not make any error in entering the link cost matrix (i.e., the matrix would be symmetric, non-negative, and all elements along the leading diagonal will be 0). That is, your code does not need to check for potential errors in the link cost matrix.

Write a function `computePrimMST(sourceID,C)' which takes as inputs the source node ID and the link cost matrix and returns the MST. The pseudocode is available on slide-101 of Chapter-5 notes. The function should return the MST as a 3-column list. The first two columns define the edge chosen and the third column lists the cost of that edge. For example, for the network in Fig. 1, the MST returned by the function could be:

1 2 1
2 3 2
3 4 1
3 5 3
5 6 1

This means that the edges chosen are (from top to bottom): (i) (A, B) with a cost of 1, (ii) (B, C) with a cost of 2, (iii) (C, D) with a cost of 1, (iv) (C, E) with a cost of 1, and (v) (E, F) with a cost of 1. The total cost of the MST is therefore 8.

You cannot use built in functions which directly compute the MST or im¬plement Prim's algorithm.

1023_Fig.jpg

Figure 1: Network for Problem 1.

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M91903917
  • Price:- $75

Priced at Now at $75, Verified Solution

Have any Question?


Related Questions in Computer Network & Security

Suppose that serendipity bank has excess reserves of 12000

Suppose that Serendipity Bank has excess reserves of $12,000 and check able deposits of $150,000. If the reserve ratio is 20 percent, what is the size of the bank's actual reserves?

With smaller companies saving thousands and larger

With smaller companies saving thousands and larger companies saving billions through flexible manufacturing, if you are a discrete parts manufacturer seeking to be more lean, it is important to consider whether this migh ...

Content analysis assignmentoverviewthis assignment has

Content Analysis Assignment Overview This assignment has three major aims: - To help students gain good understanding of all ITECH1102 theoretical and practical material. - To encourage students to use content analysis s ...

Sip encodingwhy does the session initiation protocol sip

SIP, ENCODING Why does the session initiation protocol SIP allow the sender and receiver to choose two different multimedia encoding schemes? Describe a scenario where it makes sense to use different protocols for sender ...

Question suppose you work in a network security company and

Question: Suppose you work in a network security company, and you need to prepare a survey report of a particular security issue of wireless networking. To start with, select an area of wireless network security. We have ...

Metasoft ltd is a software development company which works

MetaSoft Ltd is a software development company which works across Australia and New Zealand. The company is considering the following strategic proposal: - They plan to close down the Melbourne data centre rather than up ...

The abstract should not be more than 250 words describe

The abstract should not be more than 250 words. Describe your project, focusing on research questions and research method for next stage of the project. 1. Introduction [The introduction should describe what the project ...

Question do some research and find a case of cyber

Question : Do some research and find a case of cyber harassment or cyberbullying. Explain the case, and discuss the relevant theories of criminal justice associated with the perpetrator(s). Your response should be a mini ...

Two countries australia and france have their interest

Two Countries Australia and France have their interest rates to be 8% and 2 %, respectively. If their currencies trade according to 2 Australian $s buy one euro in the spot market, what will their future spot rate be in ...

How would you explain the concept of a quality adjusted

How would you explain the concept of a quality adjusted life year? When is it appropriate to use "QALYs" instead of simply improved life expectancy as the outcome measure in an economic evaluation?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As