subject

You are the chief trade minister under Emperor Caesar Augustus with the job of directingtrade in the ancient world. The Emperor has proclaimed thatall roads lead to (and from)Rome; that is, all trade must go through Rome. In particular, you are given a stronglyconnected directed graph G= (V, E) with positive edge weights, and there is a particularnodev0∈V(Rome). Give an efficient algorithm for finding shortest path betweenall pairsof nodes, with the one restriction that these paths must all pass through v0 (Rome). Make your algorithm as efficient as you can, perhaps as fast as Dijkstra’s algorithm. Required:
a. Give the efficient algorithm.
b. Occasionally, Augustus will ask you for the (smallest) distance between two vertices. Youwant to do this as quickly as possible, so that Augustus does not have your head. This is called adistance query: Given a pair of vertices (u, v), give the the distance ofthe shortest path that passes throughv0. Describe how you might store the results suchthat you require O(|V|) storage and from your data structure you can compute the result in O(1) time. For your answer, a clear description of the data structure and its usage issufficient.
c. On the other hand, the traders need to know the paths themselves. This is called apath query: Given a part of vertices (u, v), give the shortest path itself, that passes throughv0. Describe how you might store the results such that you requireO(|V|) storage and from your data structure you can compute the result in O(|V|) time. Again, a clear description of the data structure and its usage is sufficient.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
question
Computers and Technology, 22.06.2019 02:00
What is the largest decimal number that can be represented by a binary number with 4 place values? (remember, each place in a binary number has a value of a power of 2, starting in the ones place with 20.)
Answers: 3
question
Computers and Technology, 24.06.2019 06:30
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
question
Computers and Technology, 24.06.2019 15:00
When a presentation is being planned, it is important to ensure that it covers all available information. appeals to the audience. uses multimedia tools. entertains the audience.
Answers: 1
You know the right answer?
You are the chief trade minister under Emperor Caesar Augustus with the job of directingtrade in the...
Questions
Questions on the website: 13722362