How do we represent the link costs

Assignment Help MATLAB Programming
Reference no: EM131146447

1. We have discussed Dijkstra's algorithm in class for computing the shortest paths from any source node to all other nodes in a network. The first step is to codify the network information, i.e., how do we represent the link costs? One way is to use a matrix representation. If the link costs 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, Cif = 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.):

525_matrix.jpg

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 al 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 computeDijkstra(sourceID,C)' which takes as inputs the source node ID and the link cost matrix and returns the final best cost vector and the final predecessor vector.

For example, referring to slide-38 of Chapter-5 notes, your out¬put arguments should be [0,2,3,1,2,4] and [A, A, E, A, D, El or [1,1,5,1,4,5] if you label each node by a numeric, i.e., [A, B, C, D, E] -4 [1,2,3,4,5].

The pseudocode is available on slide-36 of Chapter-5 notes.

1. Consider the 6-node network shown in Fig. 1. The numbers shown next to the edges (links) represent the link costs. Using Dijkstra's algorithm, find out the minimum cost paths from node. A to all other nodes in the network. In your homework, you should include a table similar to the one shown on slide 38 of Chapter-5 notes (make sure to show both the minimum cost vector p as well as the predecessor vector). [25 points)

If you cannot implement the predecessor vector, just try to return the final cost vector. You can earn up to 50 points if you do so correctly.

You cannot use built in functions which directly compute the shortest path tree or implement Dijkstra's algorithm.

Here's a MATLAB tip. Suppose x = [2, 3, 1, 4, 5]. Executing (a,b) = min(x) returns a=1 and b=3. The parameter b therefore returns the position in x where the minimum is found.

283_Graph.jpg

Figure 1: Network for Problem 1.

NOTE: You should email me your codes with instructions on how to rim than.

1.Consider the 6-node network shown in Fig. 1. The numbers shown next to the edges (links) represent the link costs. Using Dijkstra's algorithm, find out the minimum cost paths from node. A to all other nodes in the network. In your homework, you should include a table similar to the one shown on slide 38 of Chapter-5 notes (make sure to show both the minimum cost vector p as well as the predecessor vector). 


283_11.png

2. In some cases, link costs reflect reliabilities. In this case, the definition of a best cost path changes. For example, the reliability of the path A -+ B -> C is defined as: r(ARC) = r(A13) x r(BC), i.e., the reliability of it path is the product of the reliabilities of the hops constituting the path. In addition, the reliability measure of a link is a number between 0 (actually, a very very small number, say, 10 10 0) and 1. If the reliability of a link is 0.8, you can interpret that as `the probability that the link will fail is 0.2'. In contrast, if the link costs were to be viewed as dollar costs (or even delays in seconds), you would add up the costs of the hops constituting a path to obtain the cost of that path.
When link costs are modeled as reliabilities, a certain mathematical transformation allows you to convert products of individual reliabilities to sums of transformed reli-abilities. What is that transformation' After the tnumformation, what is the nature of an link costs (maximum and minimum limits)? In Dijkstra's algorithm, we seek to find paths which minimize the sum of link costs. Noting that finding the minimum of -x (where x is an arbitrary variable) is equivalent to finding the maximum of x, explain how you could adapt Dijkstra's algorithm when link costs reflect reliabilities. After you have thought it out, find the most reliable paths from node A to all other nodes for the network shown in Figure 2. in points]
Even though you are not being asked to do anything about this, it is worth¬while to note that there's an alternate definition of the reliability of a path. Just as a chain is only as strong as its weakest link, the reliability of a path is sometimes also defined as the minimum of the reliabilities of the hops constituting a path. Under this definition, if the reliability of the link (A, B) is 0.8 and the reliability of the link (B,C) is 0.2, then the reliability of the path (A 14 B 44 C) is the minimum of 0.8 mid 0.2, or, 0.2. By the definition of the first paragraph, however, the reliability of the path (A i4 B H C) is 0.8 x 0.2 = 0.16.

3. The network shown in Figure 3 is in operation. Distance vector protocol is used for routing. 
(a) Construct the routing tables at each of the five nodes.
(b) Subsequently, the cost of the link (A, D) changes to 5. Node D is the first to detect this and updates its routing table. It then sends out an advertisement to nodes A, C and E. In response, nodes A, C and E update their own routing tables and inform their neighbors (i.e., node A sends to B and D; node C sends to B, D and B; and node E sends to C and D). This process continues until routes/costs have stabilized. If you think this through, you will see that node A's first two routing table updates are in response to: (i) an update from D, and then, (ii) an update from B. Construct the routing tables at A after each of these two steps. In order to answer this, you might have to construct the routing tables at other nodes.

 

1225_11.png

Reference no: EM131146447

Questions Cloud

What factors might compromise the endorsements : Which of the following individuals is likely to be most successful at persuading the public to buy a certain brand of running shoes? Explain your reasoning. What factors might compromise the endorsements of the various people listed in application 2?
What is the definition of compensation : If your school has a subscription to the FASB Codification, go to http://aaahq.org/ ascLogin.cfm to log in and prepare responses to the following.
Whether to purchase the new machine or to keepold machine : indicate whether each of the costs described would be relevant or not to Swenson's Meats' decision about whether to purchase the new machine or to keep the old machine.
Describe the conflict : Describe what you see as being the major contributor to the conflict. Is it misunderstanding? Is it emotion? Is it ethics? Is it power? Etc. Also describe who was most at fault.
How do we represent the link costs : We have discussed Dijkstra's algorithm in class for computing the shortest paths from any source node to all other nodes in a network. The first step is to codify the network information, i.e., how do we represent the link costs?
Companies prepare balance sheets in order : Prepare a personal balance sheet using the format you have learned for a classified balance sheet for a company. For the equity account, use M. Y. Own, Capital.
Provide a definition for each of the four categories : Provide a definition for each of the four categories and 10 essential services of public health listed on the worksheet. (The definition should be approximately three to four sentences each, written in your own words.)
Determine the maximum strain energy acquired by the drill : Knowing that the top of the drill pipe rotates through two complete revolutions before the drill bit at B starts to operate and using G = 11.2 X 106 psi, determine the maximum strain energy acquired by the drill pipe.
Prism company is a pesticide manufacturer : Prism Company is a pesticide manufacturer. Its sales declined greatly this year due to the passage of legislation outlawing the sale of several of Prism's chemical pesticides.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  How to write a program to prepare a marksheet in matlab

How to write a program to prepare a marksheet in MATLAB ?

  Impacts of electric vehicle on distribution networks

The different modes of transport in the world available like air travel, railways and personal transport like cars and motorcycles all have common problems like cost of running and maintenance and fuel prices.

  Implement and demosaic function in matlab

you need to implement and demosaic function in matlab. Load a image in a .png file and process it into a color image. I am required to use 'rggb' with linear interpolation. Can someone help me?

  Write a matlab program that produces the sum of square

Write a Matlab program that produces the sum of square of all the even numbers and cube of all the odd numbers between 1 to 100.

  Write a gui function that will display sliders

Write a GUI function that will display sliders - The wind chill factor measures how cold it feels with a given air temperature.

  Solve the differential equation

Find a general solution of the following differential equation and solve the differential equation

  Random number generator to create a symmetric matrix

Use a random number generator to create a symmetric matrix - without using built-in MATLAB commands, using the Power Method in combination with the Method of Deflation, obtain the eigen values & eigenvectors of the matrix

  Calculate the response spectra for column - matlab program

I want a program in MATLAB that can calculate the response spectra for the columns. Then we should take a sine function for translation and a different sine function for torsion, and see if we are getting correct results.

  Write a script that will loop through values

Write a script that will loop through values of n until the difference between the approximation and the actual value is less than 0.0001.

  Determine the volume of the pyramid

Determine the volume of the pyramid. When the user enters every value, they will then be prompted also for either 'i' for inches, or 'c' for centimeters.

  The gauss-newton method

Write up your results using our standard format. Show and discuss the results of Steps 1-3 in some detail, including the observed convergence rates of steepest descent versus the Gauss-Newton method

  Function that takes as input parameters a function

Define a function that takes as input parameters a function handle f, start, and end values a and b, and a number of steps n. The function should compute and return the average value of f over the range a to b.

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