You were given a table with four currencies with their respective trading values (not symmetric) and asked that given a start currency and an end currency you maximize the end value. You can't trade for the same currency twice.
any ideas how to solve this . ? My approach was to convert multiplication of rates to log(rate ) and then use -log(rate ) to find maximum path using bellmen ford ( dijjstra will not work as logg can produce negative values for rate <1 ) .
is that correct , my doubt is that if there is neggative cycle and even if we detect it on some node , how do we know if the path is indeed maximum from start to end from all paths ?