1

I have the following problem in GAMS

I implemented a location routing problem. While checking the .log file I noticed something that could speed up the calculation time immensly if I fixed it. Let me state an example first:

Let's assume that we have a set S of all nodes consisting of s1*s140 nodes whereas nodes i1*i10 represent potential Warehouses and i11*i140 represent customers to be served. So we have have

Sets

i "all nodes" /i1*i40/
WH(i) "only potential Warehouse locations" /i1*i10/
K(i) "only customer sites" /i11*i140/

alias(i,j)

Binary Variables

z(WH) 1 if warehouse location WH is opened
y(K,WH) 1 if customer site K is assigned to warehouse WH
x(i,j) If node j is immediately headed to after node i.

Parameters

WHKAPA Capacity of a warehouse
d(K) Demand of a customer.
Cfix Opening Costs for a warehouse
dist(i,j)

The objective function minimizes the fixed opening costs and the routing costs.

While setting the capacity of a warehouse large enough to be able to serve all customers and setting high opening costs for each warehouse my assumption was that the optimal solution would consist of one warehouse being opened which serves all customers.

My assumption was right however I noticed that CPLEX takes a very long time to check the solution space for opening way to many Warehouses, first.

The optimality Gap then "jumps" to a near optimal solution when fewer Warehouses are opened (see attached screenshot). So basically a lot of time is spent scanning obviously "bad" solutions. Actually I consciously used examples where the obviously best solution would have to consist of one Warehouse only.

My question to you:

How can I "direc"t CPLEX to checkout solutions consisting of one Warehouse opened first without giving a maximal number of possible opened warehouses within the model (i. e. sum(WH, z(WH)) =l= 1 ; )

I tried Branching prioritys using the .prior suffix and the mipordind = 1 option. Cplex still checked solutions consisting of 10 Warehouses opened so I assume it did not help.

I also tried to set the Warehouse opening costs ridiculously high. However solutions that included opening the maximum number of possible warehouses were still checked and time lost.

Sorry for the long post I hope I have put all necessary information in :)

Looking forward for your advice

Kind Regards Adam

logfile

JustBaron
  • 2,319
  • 7
  • 25
  • 37
Adam92
  • 11
  • 2
  • Maybe you will find some ideas [here](http://www-01.ibm.com/support/docview.wss?uid=swg21399949). I also would play with the *MIP emphasis switch* argument. A more complex following step would be an own heuristic for obtaining a good initial-solution (leading to much fathoming in bnb) or even better: a callback-like heuristic. The latter highly depends on what CPLEX API supports here. An example would be: it's called with the relaxation and your callback might try to make it an integral solution. – sascha Mar 12 '18 at 12:47
  • Hey, sascha. Thank you for the reply. You are right, the mip emphasis switch is a useful tool. However, the problem in this case is that that CPLEX finds feasible solutions quite early. However the solutions contain of opening every possible warehouse location which again is illogical. CPLEX obviously finds a near optimal solution ( which consits of opening one warehouse only) but only after checking all possibilities of opening much more hubs. I just wonder how to "push" CPLEX to check for those "one warehouse first" solutions. – Adam92 Mar 12 '18 at 21:09
  • It's not necessary illogical in terms of the core-component: relaxation. This really is broad. Either add an own heuristic at a good callback-point (relax -> feas; maybe) or remodel with an upper limit and solve multiple models in an iterative deepening manner (<=1, <=2, <=3). It probably depends on your model (which i did not analyze) if you can check easily if you are at an optimum when at N=5 for example. This could become bad of course if many warehouses are needed for good cost(try to reuse MIP-solutions). Apart from that, play with the heuristics and make sure feasibility-pump is active. – sascha Mar 12 '18 at 21:13
  • Thank you for the detailed advice. You are right with your point, that it does not necessarily have to be illogical since CPLEX views the model as a generic MIP. I tried experimenting with starting solutions. Since I impelented the model in GAMS I read about the possibility to use .mst files. However, I can't find proper instructions on how to generate and use them. Any experience with that? Or how would you provide initial solutions ? – Adam92 Mar 13 '18 at 09:00

0 Answers0