4) Dijkstra’s shortest-path algorithm to compute the shortest path from “1” to all network nodes is as follows
Step 0: Initially we
take 1 as a minimum Weight and highlight that value
Step 1: In
this we consider the minimum weight other than Node 1 that is at
Node 3 we have minimum weight so highlight that value
Step 2: In this we consider the minimum weight other than Nodes 1
& 3 that is at Node 2 we have minimum weight so highlight that
value
Step 3: In this we consider the minimum weight other than Node 1,2
& 3 that is at Node 5 we have minimum weight so highlight that
value
Step 4: In this we consider the minimum weight other than Node
1,2,3 & 5 that is at Node 6 we have minimum weight so highlight
that value
Step 5: In this we consider the minimum weight other than Node
1,2,3,5 & 6 that is at Node 4 we have minimum weight so
highlight that value
Step 6: In this we consider the minimum weight other than Node 1,2,3,4,5 & 6 that is at Node 8 we have minimum weight so highlight that value
Step 7: In this we consider the minimum weight other than Node 1,2,3,4,5,6 & 8 that is at Node 9 we have minimum weight so highlight that value
Step 8: In this we consider the minimum weight other than Node 1,2,3,4,5,6,8 & 9 that is at Node 10 we have minimum weight so highlight that value
Step 9: In this we consider the minimum weight other than Node 1,2,3,4,5,6,8,9 & 10 that is at Node 7 we have minimum weight so highlight that value
Edge | 1 - 2 | 1 - 3 | 1 - 4 | 1 - 5 | 1 - 6 | 1 - 7 | 1 - 8 | 1 - 9 | 1 - 10 |
Cost | 5 | 3 | 8 | 6 | 7 | 15 | 9 | 12 | 14 |
The shortest path tree from the above routing table.
1) Dijkstra's algorithm to compute the shortest travel time from Juliet's place (vertex 1) to all liquor stores (vertex 4 and vertex 6) is 8 and 7 respectively
2) Dijkstra's algorithm to compute the shortest travel
time from every liquor store (vertex 4 and vertex 6) to the party
location (vertex 10) is
from Vertex 4 to vertex 10 is 6 (4-8-10)
from Vertex 5 to vertex 10 is 9 (6-5-4-8-10)
3) Combine parts (1) and (2) to solve Juliet's problem,
i.e., to find what her path to the party should be
10(1-3-5-4-8-10)
Juliet lives in a small town in Wisconsin called Verona. A stylized map of Verona is...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...
10) Shortest Paths (10 marks) Some pseudocode for the shortest path problem is given below. When DIJKSTRA (G, w,s) is called, G is a given graph, w contains the weights for edges in G, and s is a starting vertex DIJKSTRA (G, w, s) INITIALIZE-SINGLE-SOURCE(G, s) 1: RELAX (u, v, w) 1: if dlv] > dlu (u, v) then 2d[v] <- d[u] +w(u, v) 3 4: end if 4: while Q φ do 5: uExTRACT-MIN Q) for each vertex v...
5. If we apply binary dilation to the same large object twice using the same small structuring element, the effect, if any, of the second dilation on the object is that the object: (a) is unchanged (b) is completely removed (c) becomes larger (d) becomes smaller (e) does not change 6. Which of the following is/are true? (a) Dijkstra's algorithm can be used to find shortest paths in a network (b) Dijkstra's algorithm is a method to find straight lines...
Problem 2 A transportation network is shown in the attached figure. Perform traffic assignment for a demand of 3000 vehicles from zone 3 to zone 5 as follows: (1) Find the shortest path between these two zones using the minimum path algorithm discussed in class, and assign 50% of the traffic to the path. (2) Update the travel time for each links with a traffic load by a factor of 1.2 (ie, 20% increase) and assign another 50% of the...
8. Nick wants to visit some friend. Graph below represents distance to his friends. c. Nick decides to go visit Bob. Given the following additional data about the number of stations it takes to travel between each friend's house, use Dijks- tra's algorithm to find the shortest path from Nick' to the Bob' house. When answering this question you must show every step in your calculations, in- cluding your final fully-labelled graph. Nick Fil L e ? William Marta stations...
Have the explaination please. 4 Graph Application: Network Connectivity (Adapted from Problem 9, Chapter 3 of K&T) Think of a communications network as a connected, undi rected graph, where messages from one node s to another node t are sent along paths from s to t. Nodes can sometimes fail. If a node v fails then no messages can be sent along edges incident on v. A network is particularly vulnerable if failure of a single node v can cause...
Discrete Mathematics Time Complexity Analysis Due: May 9th, 2019 Math 4 6026 Heap Sort Another algorithm for sorting uses a specialized tree structure called a "heap." Specifically, we will use a binary heap, which is like a binary tree with hierarchy. Here is an example of a binary heap structure 1. 2. There is a top vertex, called the parent vertex (aka node). The top parent vertex connects to two vertices a level below. These vertices are the "left child"...
5. Here are the vertices and edges of directed graph G: V= {2.6.c.de.f} E= {ab, ac, af ca. bc. be.bf. cd, ce, de, df). Weights: w(ab) = 2 w(ac) = 5, w(af) = 10, w(ca) = 2. w(be) = 2. w(be) = 10, w(bf) = 11. w(cd)= 9. w(ce) = 7. w(de) = 2. w(df) = 2. a. Draw the Graph. This is a directed, weighted graph so you need to include arrows and weights. You can insert a pic...
Help !! I need help with Depth-First Search using an undirected graph. Write a program, IN JAVA, to implement the depth-first search algorithm using the pseudocode given. Write a driver program, which reads input file mediumG.txt as an undirected graph and runs the depth-first search algorithm to find paths to all the other vertices considering 0 as the source. This driver program should display the paths in the following manner: 0 to ‘v’: list of all the vertices traversed to...