Question: ( 2 0 pts . ) Shortest Path in Currency Trading. Shortest path algorithms can be applied in currency trading. Let c 1 , c

(20 pts.) Shortest Path in Currency Trading. Shortest path algorithms can be applied in currency trading.
Let c1,c2,dots,cn be various currencies; for instance, c1 might be dollars, c2 pounds, and c3 lire. For any two
currencies ci and cj, there is an exchange rate ri,j; this means that you can purchase ri,j units of currency
cj in exchange for one unit of ci. These exchange rates satisfy the condition that ri,j*rj,i1, so that if you
start with a unit of currency ci, change it into currency cj and then convert back to currency ci, you end up
with less than one unit of currency ci(the difference is the cost of the transaction).
(a) Give an efficient algorithm for the following problem: Given a set of exchange rates ri,j, and two
currencies s and t, find the most advantageous sequence of currency exchanges for converting currency
s into currency t. Toward this goal, you should represent the currencies and rates by a graph whose
edge weights are real numbers.
(b) The exchange rates are updated frequently, reflecting the demand and supply of the various curren-
cies. Occasionally the exchange rates satisfy the following property: there is a sequence of currencies
ci1,ci2,dots,cik such that ri1,i2*ri2,i3dotsrik-1,ik*rik,i1>1. This means that by starting with a unit of currency
ci1 and then successively converting it to currencies ci2,ci3,dots,cik, and finally back to ci1, you would
end up with more than one unit of currency ci1. Such anomalies last only a fraction of a minute on the
currency exchange, but they provide an opportunity for risk-free profits. Give an efficient algorithm
for detecting the presence of such an anomaly. Use the graph representation you found above.
 (20 pts.) Shortest Path in Currency Trading. Shortest path algorithms can

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!