Question

Use Dijkstras Algorithm to solve single source shortest path problem for the graph given below. Use vertex a as the start node. It will be useful to build a table as explained in class. elow. Use vertex a as the start node. It will be useful to build a 4 4 6Correction: in question - There two 'e' nodes. So name the middle one as 'e'. So the node that 'c' points to is 'd' instead of 'e'

0 0
Add a comment Improve this question Transcribed image text
Answer #1

WITH INFERENCE FROM YOUR LAST LINE, WHICH STATES THAT THE NODE THAT C POINTS TO IS D, HENCE THE FIGURE MUST LOOK LIKE THIS:

4 4

SINCE WE START WITH VERTEX 'A' AS GIVEN IN THE QUESTION, WE WILL LOOK FOR THE EDGE HAVING THE LEAST DISTANCE FROM A:

SO THE GRAPH NOW LOOKS LIKE:

NOW FROM VERTEX B WE FIND THE EDGE WITH THE LOWEST DISTANCE:

INFINITE0 4 INFINITE INFINITE

HENCE THE GRAPH WILL NOW LOOK LIKE THIS:

NOW WE WILL FIND THE EDGE ORIGINATING FROM VERTEX C WITH THE SHORTEST PATH, HENCE:

INFINITE INFINITE0 6 INFINITE

HENCE THE NEW GRAPH WILL LOOK LIKE THIS:

4 6 3

NOW WE WILL FIND THE EDGE ORIGINATING FROM VERTEX D WITH THE SHORTEST PATH, HENCE:

INFINITE 2 INFINITE 0 4

SINCE TAKING THE PATH FROM D TO B WILL TAKE US BACK AND FORM A CYCLE, HENCE THE PATH D TO E IS CHOSEN, HENCE THE GRAPH LOOKS LIKE THIS :

4. 4

THIS IS THE SHORTEST PATH.

Add a comment
Know the answer?
Add Answer to:
Correction: in question - There two 'e' nodes. So name the middle one as 'e'. So...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the graph below. Use Dijkstra's algorithm to find the shortest path from vertex A to vertex F.

    Consider the graph below. Use Dijkstra's algorithm to find the shortest path from vertex A to vertex F. Write your answer as a sequence of nodes separated by commas (no blank spaces) starting with the source node: _______ What's the weight of the shortest path? _______ 

  • Consider the graph below. Use Dijkstra's algorithm to find the shortest path from vertex A to vertex C

    Consider the graph below. Use Dijkstra's algorithm to find the shortest path from vertex A to vertex C. Write your answer as a sequence of nodes with no blank spaces or any separators in between, starting with the source node: What's the weight of the shortest path? 

  • c++ question: Canvas 10 pts Question 17 Consider the graph below. Use Dijkstra's algorithm to find...

    c++ question: Canvas 10 pts Question 17 Consider the graph below. Use Dijkstra's algorithm to find the shortest path from vertex A to vertex F. Write your answer as a sequence of nodes separated by commas (no blank spaces) starting with the source node: What's the weight of the shortest path? 2 3. 6. 2. 12 10 pts Question 18 LO

  • Hi I'm stuck with this homework question and hope you can help me. 9. In the...

    Hi I'm stuck with this homework question and hope you can help me. 9. In the graph below (A) Determine the shortest path from a to ALL other nodes using Dijkstra's Shortest Path Algorithm. The answers must be in the following form: For each node, give the shortest path from a to that node (that is, list the nodes in the path) Also for each path give the length of the path. (B) ON THIS SHEET OF PAPER SHOWING A...

  • please answer one of the two 1. (25) [Single-source shortest-path: algorithm tracing] Show the tracing of...

    please answer one of the two 1. (25) [Single-source shortest-path: algorithm tracing] Show the tracing of Dijkstra's shortest path search algorithm on the weighted directed graph shown below. Do the tracing it twice, first starting with the nodes and, second, starting with the node z. For each tracing, each time the shortest path to a new node is determined, show the graph with the shortest path to the node clearly marked and show inside the node the shortest distance to...

  • 5. Apply Dijkstra's algorithm as discussed in class to solve the single-source shortest-paths problem for the...

    5. Apply Dijkstra's algorithm as discussed in class to solve the single-source shortest-paths problem for the following graph. Consider node A to be the source. (20 points) a. Show the completed table. b. State the shortest path from A to E and state its length. C. State the shortest path from A to F and state its length. d. State the shortest path from A to G and state its length. A 12 9 B 17 8 7 10 8...

  • Apply Dijkstra's algorithm as discussed in class to solve the single-source shortest-paths problem for the following...

    Apply Dijkstra's algorithm as discussed in class to solve the single-source shortest-paths problem for the following graph. Consider node A to be the source. (20 points) a. Show the completed table. b. State the shortest path from A to E and state its length. State the shortest path from A to F A 9 and state its length. d. State the shortest path from A to G 17 and state its length. 7 C. 12 B 8 10 D 8...

  • Creating a Graph with GraphStream

    Ask the user to provide two node IDs as inputs and you would calculate the shortest path between themImplement Dijkstra's algorithm (covered in class on 17th Nov.) to calculate the shortest path between any pair of nodes in the above graph. Keep asking the user for such inputs until the user decides to stop.You can implement this using a do-while loop.Display the shortest path found by Dijkstra's algorithm along with Node IDs so that Dr. Dutta can verify the correctness...

  • PYTHON ONLY Implement the Dijkstra’s Shortest path algorithm in Python. A graph with 10 nodes (Node...

    PYTHON ONLY Implement the Dijkstra’s Shortest path algorithm in Python. A graph with 10 nodes (Node 0 to node 9) must be implemented. You are supposed to denote the distance of the edges via an adjacency matrix (You can assume the edge weights are either 0 or a positive value). The adjacency matrix is supposed to be a 2-D array and it is to be inputted to the graph. Remember that the adjacency list denotes the edge values for the...

  • can you please solve this CORRECTLY? Exercise 4 - Shortest path (25 pts) Using Dijkstra's algorithm,...

    can you please solve this CORRECTLY? Exercise 4 - Shortest path (25 pts) Using Dijkstra's algorithm, find the shortest path from A to E in the following weighted graph: a- Once done, indicate the sequence (min distance, previous node) for nodes D and E. (15pts) b- Below is a high-level code for Dijkstra's algorithm. The variables used in the code are self-explanatory. Clearly explain why its running time (when we use a min-heap to store the values min distance of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT