Question

In: Computer Science

Trace through of Dijkstra’s Algorithm, using vertex v5 as the source vertex. Here is adjacency matrix...

Trace through of Dijkstra’s Algorithm, using vertex v5 as the source vertex.

Here is adjacency matrix representing the graph with n = 6 vertices:

1

2

3

4

5

6

1

0

999

5

8

999

4

2

9

0

999

999

12

3

3

999

10

0

2

9

999

4

999

999

999

0

999

999

5

999

7

17

999

0

11

6

5

999

11

16

2

0

            Initially we have: vnear = 5. Fill array performing initiation.

1

2

3

4

5

6

touch

length

             Repeat the main loop 5 times:

Hint: copy and paste following table five times, then fill all values for arrays.

            vnear =

1

2

3

4

5

6

touch

length

Solutions

Expert Solution

Step 1 Let us first discuss about Dijkstra algorithm

Step 2 Using Dijkstra algorithm

1)vnear= Intially

1 2 3 4 5 6
length 0
touch N N N N - N

2)vnear= 5

1 2 3 4 5 6
length 999 7 17 999 0 11
touch 5 5 5 5 - 5

3)vnear = 2

1 2 3 4 5 6
touch 2 5 5 5 - 2
length 16 7 17 999 0 10

4)vnear = 6

1 2 3 4 5 6
touch 6 5 5 6 - 2
length 15 7 17 26 0 10

5)vnear = 1

1 2 3 4 5 6
touch 6 5 5 1 - 2
length 15 7 17 23 0 10

6)vnear = 3

1 2 3 4 5 6
touch 6 5 5 3 _ 2
length 15 7 17 19 0 10

At the end ,node 4 will be selected finally


Related Solutions

Express the degree of a vertex in terms of the adjacency matrix Describe how you can...
Express the degree of a vertex in terms of the adjacency matrix Describe how you can find out whether a graph is connected, based on its adjacency matrix, using only matrix addition and multiplication.
Describe and analyze an algorithm to determine the number of shortest paths from a source vertex...
Describe and analyze an algorithm to determine the number of shortest paths from a source vertex s to a target vertex t in an arbitrary directed graph G with weighted edges. You may assume that all edge weights are positive and that all necessary arithmetic operations can be performed in O(1) time. [Hint: Compute shortest path distances from s to every other vertex. Throw away all edges that cannot be part of a shortest path from s to another vertex....
Need to write a code using c# Strassen’s Algorithm for matrix multiplication.
Need to write a code using c# Strassen’s Algorithm for matrix multiplication.
Strassen’s algorithm for matrix multiplication relies on using 7 multiplications (instead of 8 as in the...
Strassen’s algorithm for matrix multiplication relies on using 7 multiplications (instead of 8 as in the straightforward algorithm) to multiply a pair of 2 by 2 matrices. Explain why it is not possible to further reduce this number, 7, to anything less than 4, in multiplying a pair of 2 by 2 matrices.
Strassen’s algorithm for matrix multiplication relies on using 7 multiplications (instead of 8 as in the...
Strassen’s algorithm for matrix multiplication relies on using 7 multiplications (instead of 8 as in the straightforward algorithm) to multiply a pair of 2 by 2 matrices. Explain why it is not possible to further reduce this number, 7, to anything less than 4, in multiplying a pair of 2 by 2 matrices.
2. Using matrices, create an algorithm that takes a matrix of dimension N x N and...
2. Using matrices, create an algorithm that takes a matrix of dimension N x N and feed it in a spiral shape with the sequential number from 1 to N^2. Then do an algorithm in PSEint
Using the dynamic programming-based algorithm for chain matrix multiplcation, show the best way to multiply a...
Using the dynamic programming-based algorithm for chain matrix multiplcation, show the best way to multiply a chain of matrices with dimensions that are: 10x5, 5x2, 2x20, 20x12, 12x4 and 4x60. Finally, use the resulting tables to provide the complete optimal parenthesization of the matrix chain product A0 · A1 · A2 · A3 · A4 · A5.
Find the equation of a circle that passes through (1,7). (6,2) and (4,5) using a matrix.
Find the equation of a circle that passes through (1,7). (6,2) and (4,5) using a matrix.
Using the normal graphs of basic micro-economics, please trace through the expected relative price and employment...
Using the normal graphs of basic micro-economics, please trace through the expected relative price and employment impacts of a single family detached housing subsidy to the poor in the markets for:    Single family detached Homes,  Carpenters,  Glass,  iPods,  Beer,  Purchases of restaurant meals by the rich.  First-class air tickets from San Francisco to Paris  The Audi R8 (This is a cool sports car on a Formula One racing frame.)
Using the normal graphs of basic micro-economics, please trace through the expected relative price and employment...
Using the normal graphs of basic micro-economics, please trace through the expected relative price and employment impacts of a single family detached housing subsidy to the poor in the markets for:    Single family detached Homes,  Carpenters,  Glass,  iPods,  Beer,  Purchases of restaurant meals by the rich.  First-class air tickets from San Francisco to Paris  The Audi R8 (This is a cool sports car on a Formula One racing frame.)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT