Question: Problem 1 ( Pizza Delivery, 3 0 points ) Alice, who lives at a vertex s of a directed, weighted graph G = ( V
Problem Pizza Delivery, points
Alice, who lives at a vertex of a directed, weighted graph with nonnegative
weights is going to her friend's house at vertex for dinner. Naturally, Alice wants to get
from to as soon as possible, but it appears that her friend is terrible at cooking, so along
the way she wants to get a pizza from a pizza store just in case her friend cooks something
inedible. Let's say the pizza stores form a subset of the vertices BsubV. Thus, starting at
Alice must go to some vertex binB of her choice, and then head from to using the
shortest overall route possible assuming she wastes no time at the pizza store We can help
Alice reach as soon as possible, by solving the following subproblems.
Compute the shortest distance from to all pizza stores binB.
Compute the shortest distance from every pizza store binB to Note that this is the
dual of the singlesource shortest path where we are now asking for the shortest path
from every node to a particular destination.
Combine part and to solve the full problem.
A straightforward solution is to run Dijkstra's algorithm twice once in part and once in
part In this problem, you will improve this solution by running Dijkstra's algorithm only
once. Specifically, you should define a new graph on vertices and at most
edges and appropriate weights for these edges so that the original problem can be solved
using a single Dijkstra call on Briefly argue correctness of your proposed solution. Hint:
This is another problem on reductions. You might want to refresh your memories on Problem
in Homework which is also a reduction problem.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
