Unformatted text preview: eck whether there is a gas station there. If there is a
gas station at this vertex, then we add the edges (ve , vf ) and (vh , vf ) to E . Since the
cost of fueling up is not dependent on the amount of gas that is already in the tank,
we assign both of these edges the cost of fueling up at that city. This procedure takes
O(V ) time, since we iterate over all of the vertices and create a constant number of
new edges. 13 6.006 Quiz 2 Solutions Name We can now run Dijkstra’s algorithm on this graph to ﬁnd paths from sf to tf , th...
View Full Document
This document was uploaded on 03/17/2014 for the course ELECTRICAL 6.006 at MIT.
- Fall '11