I have been stuck on this question for a while trying to figure out the recurrence relationship for the following problem.
Problem description:
Suppose in a market the following trade options are possible:
- 1 metal to 2 wood
- 1 wood to 0.2 glass
- 1 glass to 1.5 metal
- 1 wood to 0.4 fire
- 1 fire to 3 metal
Determine if it's possible to make profit on a certain item simply by trading.
For example in the described scenario above, we can make a profit on metal by doing the following:
1 metal -> 2 wood -> 0.8 fire -> 2.4 metal
The part where I'm stuck at is how the subproblems should be broken down. This problem seems familiar to the parenthesis multiplication problem, where we are trying to maximize the end result through a series of multiplications but with more restrictions.
I don't want the full answer but hints that can nudge me towards the right direction would be really appreciated!
Thanks!