Reputation: 45
I'm having a hard time formulating a model that will later be implemented with (Octave, glpk function) linear programming.
The problem appears to be quite simple but I fail to translate it into the mathematical notation.
I have warehouses, each of them accumulates certain amounts of material. This material needs to be transported to other locations called processing facilities. The processing facility can ether exist at the same location the warehouse is or not at all. The model would have to tell me which warehouses should have a processing facility with regards to cost.
I have a distance matrix between all warehouses and transportation cost per mile per tone of material.
Placing a processing facility has a price as well.
The problem I'm having is how to incorporate facility placement and transportation price to the model in such a way that the model would tell me where the processing should be done.
I've followed this example.
But I'm getting a feeling that my problem is a multivariate and should be solved differently.
Upvotes: 0
Views: 142
Reputation: 11911
Most parts are quite similar to the example, but you will have to introduce 0/1-variables p_j to indicate wether you have a processing-facility at location j. As a result you'll not have a plain LP but rather a MIP, but your solver should be able to handle this.
You'll have to add some conditions like x_ij <= p_j*M with some Big-M that's greater than all goods that might possibly be transported so you can only transport materials to locations that have a processing facility. Likewise you'll add some terms c_j*p_j to your cost-function to cover the placement-cost.
Upvotes: 1