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 22:30
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
What multimedia system creates an immersive, real-life experience that the user can interact with?
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
Write a new lc-3 trap subroutine (i.e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i.e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e.g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e.g. b0000 0000 0000 0111 =
Answers: 3
You know the right answer?
You are the chief trade minister under Emperor Caesar Augustus with the job of directingtrade in the...
Questions
question
History, 28.01.2021 23:00
question
Mathematics, 28.01.2021 23:00
question
Mathematics, 28.01.2021 23:00
question
Mathematics, 28.01.2021 23:00
question
English, 28.01.2021 23:00
Questions on the website: 13722367