What algorithm can I use in this case? I think that any greedy algorithm cant labor in this case.?
I am working on project for school and I would like your help.I am making it in C#. You have one ship and 3-7 ports/docks(number of ports/docks depends from map).The goal is to sell goods to other ports and make money from it. Every port sells and buys items(there are 3-5 different items with different prices,and every port will but and sell every item that exists) but the prices differ from one to another port,AND every items has its weight but it is always same. Your ship has limit what it can carry(weight limit). Ship is situated in one port and can travel to any other,the distance from each port is known. You can visit each port only once but you dont have to visit every port ,but when you finish visiting ports you should be back at starting point , the first port. You dont have a money limit ,but when you return to your first port you should have more money than when you started,that means that you can buy anything as long as you make money from it by selling it in another port. For every mile/km you travel with your ship you spend X liters of fuel per Y pound/kg of weight you carry on ship, so there is no point in buying an item from one port and selling it for better price at other port if the cost of fuel for transporting the items was so high that you lost more money than you made . What algorithm should i use , and what is the best way to solve this problem?
|