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

  An overview of wireless lan security - term paper

Computer Science or Information Technology deals with Wireless LAN Security. Wireless LAN Security is gaining importance in the recent times. This report talks about how vulnerable are wireless LAN networks without any security measures and also talk..

  Computer networks and security against hackers

This case study about a company named Magna International, a Canada based global supplier of automotive components, modules and systems. Along with the company analysis have been made in this assignment.

  New attack models

The Internet evolution is and is very fast and the Internet exposes the connected computers to attacks and the subsequent losses are in rise.

  Islamic Calligraphy

Islamic calligraphy or Arabic calligraphy is a primary form of art for Islamic visual expression and creativity.

  A comprehensive study about web-based email implementation

Conduct a comprehensive study about web-based email implementation in gmail. Optionally, you may use sniffer like wireshark or your choice to analyze the communication traffic.

  Retention policy and litigation hold notices

The purpose of this project is to provide you with an opportunity to create a document retention policy. You will also learn how to serve a litigation hold notice for an educational institute.

  Tools to enhance password protection

A report on Tools to enhance Password Protection.

  Analyse security procedures

Analyse security procedures

  Write a report on denial of service

Write a report on DENIAL OF SERVICE (DoS).

  Phising email

Phising email It is multipart, what are the two parts? The HTML part, is it inviting the recepient to click somewhere? What is the email proporting to do when the link is clicked?

  Express the shannon-hartley capacity theorem

Express the Shannon-Hartley capacity theorem in terms of where is the Energy/bit and is the psd of white noise.

  Modern symmetric encryption schemes

Pseudo-random generators, pseudo-random functions and pseudo-random permutations

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