24.5 Exercises

Procedural

Questions 1 and 2, suppose we run Dijkstra's from A. Break ties alphabetically. Breaking ties alphabetically means that if we insert B into the fringe, and C is in the fringe with the same priority, we have a tie! To break this tie, we will do so alphabetically, putting B before C.

  1. What is the order that vertices are visited? Please separate vertices with spaces, e.g. A B C ....

  2. Select all the edges in the shortest paths tree. *

Problem 1

A B E C F D G

For this, and all questions on this check in, refer to this walkthrough video for an explanation: https://youtu.be/5MFOu8bNvd8

Problem 2

AE

AB

CE

DF

EG

EF

For questions 3-5, suppose we run A* from A to D. Break ties alphabetically

  1. What is the order that vertices are visited? Note that not all vertices need be visited. Please separate vertices with spaces, e.g. A B C ....

  2. Select all the edges in the shortest path from A -> D, as determined by A*. Note that this may not be the correct shortest path. Also note that we are NOT finding the shortest path tree, but just the edges on the shortest path!

  3. In the previous question, you probably noticed that the actual shortest path from A -> D was not found! The reason for this is because the value of one heuristic is too high. Determine which heuristic this is, and what is the maximum its value can be so that A* returns the correct shortest path.

Problem 3

A E C B D

Problem 4

AE

CD

CE

Problem 5

F:2

Last updated