For context: I am playing a game where you're supposed to transport goods with your ship to make money. Different goods have different purchase costs and profit margins. This made me figure I can come up with a formula of some sort to find out the most profitable stowage plan.
Given that there is a limited budget b and a limited stowage capacity c and three cargo types:
$$\begin{array}{c|c|c} & \text{Cost} & \text{Revenue} \\ \hline \text{x} & 50 & 200 \\ \hline \text{y} & 250 & 500 \\ \hline \text{z} & 600 & 1000 \\ \end{array}$$
When there is no limited stowage capacity (b is finite and c is infinite) it makes sense to buy and sell x, as it has the highest profit margin. However when there is no limited budget (b is infinite and c is finite), it makes sense to transport z, as the value density of the goods rise and c of z holds more value than c of x.
The problem arises when both b and c are (relatively) low. How do you calculate the highest profit, when there are 3 variables to play with?