Compute the mst or implement prims algorithm

Assignment Help Computer Network Security
Reference no: EM131148449

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.

Verified Expert

This is the program to compute minimum spanning tree for the given graph using prim's algorithm. Application is developed in java using Eclipse IDE tool.

Reference no: EM131148449

Questions Cloud

Describe sociocultural values beliefs and practices : To discuss this, use your own personal experiences, those of someone close to you, or the module material. Describe sociocultural values, beliefs, practices, and/or contexts that can either be helpful or make it more challenging to define one's ow..
Describe at least three works of early chinese art : Describe at least three works of early Chinese art; how do these pieces reflect Chinese culture and values? Where did Indian culture originate? In what ways did invaders influence this culture?
Write an essay in theology : Write essay in Theology-  Foundational to the Christian faith is the belief that mankind is created in the image of God.
Inter-ocean transfer be responsible under general average : An Inter-Ocean Transfer cargo ship was forced to jettison some cargo in heavy seas. The various interests in the voyage at the time the property was jettisoned wereValue of the ship: $2.0 millionValue of lumber and wood chips: $1.0 millionValue of ir..
Compute the mst or implement prims algorithm : You cannot use built in functions which directly compute the MST or implement Prim's algorithm - You can assume that the user would not make any error in entering the link cost matrix.
Inter-ocean transfer be responsible under general average : An Inter-Ocean Transfer cargo ship was forced to jettison some cargo in heavy seas. The various interests in the voyage at the time the property was jettisoned wereValue of the ship: $2.0 millionValue of lumber and wood chips: $1.0 millionValue of ir..
What modifier should be added to 2nd electrolyte panel code : A patient is seen in the Emergency Room for dehydration. Diagnostic lab tests are done, including an Electrolyte panel. Before the patient is discharged, the Electrolyte panel is repeated. What modifier should be added to the 2nd Electrolyte panel..
The ethics of requiring that students subsidize a plagiarism : The Ethics of Requiring That Students Subsidize a Plagiarism-Detection Service- As you know, the chief responsibility of all educators at the university is to ensure that students receive the best education possible.
Write an essay that discussing the laborer unrest in america : Write a 1 and 1/2 page essay discussing the laborer unrest in America from 1877 to the 1970s. Discuss the acts, congress, organizations, and conflicts and consequences.

Reviews

Write a Review

Computer Network Security Questions & Answers

  Describe how it applies to the realm of data communication

Write one to two paragraphs on each topic below, and describe how it applies to the realm of data communication. Also discuss what type of damage these computer infections can do to data in a computer.

  Certification and accreditation for commercial systems

Using Network Security Certification and Accreditation for commercial systems. Do you think a formal process like Certification & Accreditation is appropriate to use for commercial systems in private industry (Why or Why Not)?

  What is the single most important asset of security program

What are the benefits if personnel in security management develop skills as educators for their organization's security? Analyze and explain your point of view. Why are security programs relevant? What is the single most important asset of a securi..

  Compare symmetric encryption to asymmetric encryption

Compare and contrast symmetric encryption to asymmetric encryption. PKI uses digital certificates to encrypt / decrypt data. Analyze the process of encrypting and decrypting data using a digital certificate.

  Prepare a trouble ticket to record the problem

Prepare a Trouble Ticket to record the problem

  Explain the purpose of using cvss scores

Select a recent vulnerability from that Database and analyse it from the what problems they can cause (malicious activities an attacker may use them for, including attack types)

  Assignment on cybersquatting

Discuss your reaction to this issue and the implications this issue causes. Can you see the pros and cons of this from the business point of view versus the personal point of view? Discuss your thoughts.

  The six principles of nclb

The six principles of NCLB

  Explain security model of class using cnss model

suppose that the security model is required for protection of your class. Using CNSS model, examine each of the cells and write a short statement.

  What do the terms least restrictive environment

what do the terms Least Restrictive Environment

  Define and describe voip and virtual private networks and

1. list and describe the principal internet services.2. define and describe voip and virtual private networks and

  Explain why shared accounts is considered bad practice

In your own words, explain why each of the following is considered bad practice:

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