Vote count:
0
I have used R package lpsolve in past, but feel that it is not perfect for my current problem.
I want to optimize below problem.
I have nodes and links as depicted in the diagram. I start from new york and I want to ship fruits to customer on day 4. Each node consist of 4 parts: physical location, item, site type, time. You can say that node name is combination of above 4 fields.
I can take 2 paths. My objective is to meet the customer demand and to send all fruits to sink at minimum cost.
Transportation cost for each fruit and time take to travel on the lane is given by text which is on transportation route.
my new york location is the only input and it gets 50 fruits on day 1 and customer is the only output location and in this case customer is looking for 30 fruits on day 4.
in the current scenario solution is to send 30 fruits along newyork, newmexico, customer lane and 20 fruits along newyork, arizona, customer lane. For 20 fruits we will choose newyork, arizona, customer lane as arizona, customer lane has less cost (90 USD) as compared to newmexico, customer cost (100 usd)Inline image 6
To provide the input to model, I create a sink to newyork link and send 50 fruits on that lane. Transportation lanes from arizona and newmexico to Newyork are very costly and because of the high cost, my optimization will avoid them as much as possible.
as of now I am building all links and nodes using sql. I am also using sql to populate quantity that newyork gets and quantity that customer wants. Then I optimize my network using IBM ILOG.
I want to replace IBM ILOG optimization part with R package. Which package should I use?
my constraints are: input quantity to each node has to be equal to output quantity from each node. new york get 50 fruits on day 1 customer want 30 fruits on day 4 and we cannot give more to a customer.
to make optimization easy I create sink to newyork link, which I have shown by dotted line.
In ILOG I can create TUPLEs and then write my optimization code. I guess I can solve this problem in R package Lpsolve too, but creating constraints and objective is going to involve writing many loops. In my actual network I have 10000+ nodes and I was wondering if there is any R package specially designed for this purpose.
Would it be possible to provide simple code to solve below problem in R?
Aucun commentaire:
Enregistrer un commentaire