Tuesday, 20 August 2013

Selecting trades to maximize ownership between a variety of buy / sell weighted fields

Selecting trades to maximize ownership between a variety of buy / sell
weighted fields

Say I have four(or more) items: beer, cheese, milk, and honey.
And I can trade these items for other items with a percentage loss each
time (due to effort). How can I select the best approach to maximize one
item?
beer->cheese :: buy:10 sell:1
beer->milk :: buy:5 sell: 9
beer->honey :: buy:4 sell 8
cheese->beer :: buy:20 sell 10
cheese->milk :: buy:1 sell:15
cheese->honey :: buy:8 sell: 34
milk->beer :: buy:10 sell:13
milk->cheese :: buy:7 sell: 3
milk->honey :: buy:8 sell 3
honey->beer :: buy:110 sell:1
honey->cheese :: buy:28 sell: 9
honey->milk :: buy:43 sell 0.2
In this case I want to acquire the most beer as I am thirsty, on another
day I may want to merely have a trade chain that results in the most
worth. I assume I can merely bruteforce it, by looking at all of the
profitable trades I am able to do, and then branching from there. Is there
a better way? Is there a generalized way to maximize either worth or beer?

No comments:

Post a Comment