DarkSpirit.7046:

I admit, I was first inspired by what gw2spidy has in their website. For example:

http://www.gw2spidy.com/recipe/9269

There are problems with that calculation though:

1. How updated are the prices? Prices change all the time. What can be profitable to craft one minute may not be profitable anymore in the next minute.

2. Those recipes do not include mystic forge recipes. For example, certain ingredients can be obtained more cheaply through the MF than the TP.

3. That most-profitable-path-to-craft tree is only guaranteed good for ONE craft. It doesn’t tell you how many of its ingredients can be bought at those prices by looking at the sale offer queue or how many intermediate ingredient or final product you can craft and still remain profitable.

If you want to do this right, the algorithm would have to be smarter than what they have in gw2spidy. Some less profitable items may turn out to be even more profitable considering the total amount of offers that are higher than the crafting cost. And how many you can actually craft based on the recommended crafting tree would depends on the number of ingredients you can get at those prices.

Am I the only one that finds this problem interesting? Has anyone wrote an algorithm to come up with profitable crafting trees for each stage quantity of output to sell to offer prices and find out how many you can actually craft in order to be profitable and total profit?

I am thinking what a nice interview programming question this would be, if I ever do get a chance to be an interviewer again next time. Write a recursive algorithm to print out most-profitable-crafting tree and calculate total profit from offer prices. Am I evil?

quenoz.3859:

it has been done more effectively by someone, yup.

http://www.gw2craftgold.com/

DarkSpirit.7046:

it has been done more effectively by someone, yup.

http://www.gw2craftgold.com/

Not really.

I don’t see a a minimum cost tree on how to craft an item (assuming it is cheaper to craft than to buy). Which ingredients should you buy and which ingredients should you craft? If buy, then how many ingredients can you buy at such a price? Which would determine how many final items you can craft at such a profit.

StevenL.3761:

I think it would be more interesting if you could punch in the number of items that you are planning to craft. It should then give you detailed instructions and statistics for the first, the second, the third,… all the way to the last item. If instructions and statistics remain the same for several items in a row, then they should be grouped together.

For bonus point: plot the overall returns on a graph

DarkSpirit.7046:

I think it would be more interesting if you could punch in the number of items that you are planning to craft. It should then give you detailed instructions and statistics for the first, the second, the third,… all the way to the last item. If instructions and statistics remain the same for several items in a row, then they should be grouped together.

For bonus point: plot the overall returns on a graph

Sure, we can do all that for bonus points. We can input the number of items to craft and have the profits returned.

This is an interesting problem for recursion and gives a much more useful result, if your goal is to maximize profits through crafting, than the single min cost tree from gw2spidy, which strictly speaking, only applies to crafting 1 item.