0

I have read up on several papers that described the use of heuristics in various routing problems that results in a faster run time for the solvers used (e.g. Gecode, CBC). For e.g., in the CPLEX/MiniZinc IDE, we have a constraint problem for the Vehicle Routing Problem (VRP), and a data file with contains the locations which the vehicle needs to go to (.dzn file in MiniZinc). Then, the authors in these papers implemented various kinds of routing heuristics to obtain a solution (may not be optimal) for each constraint model.

Thus my question is, how are the heuristics (can be customized to one that you designed, that is not built-in with he solver) implemented? Are the heuristics done in another IDE?

I have been looking around online literature but have yet to find out how this is actually done, especially for the case of MiniZinc and Cplex with the Gecode solver for example. It will be great if some insight can be shared on this issue! :)

Stoner
  • 846
  • 1
  • 10
  • 30
  • 1
    Generally in some programming language. As in, they are just code, not written in an IDE used for linear programming. Most of the heuristics I come up with are written/prototyped in Python (PyCharm as IDE), but any language may readily be used. Output from these heuristics can then be used to hot-start your ILP solution (I do not know about MiniZinc, but CPLEX allows you to do this quite easily). – Nelewout Aug 16 '18 at 15:09
  • @N.Wouda Thanks for the clarifications. With regards to your pointers, how do you then attain the output from your heuristics (say for e.g. did you somehow integrate them into your optimization model), and what do you mean by hot-starting the ILP solution? – Stoner Aug 16 '18 at 16:01
  • 1
    I mostly work with the [Python API for CPLEX](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/GettingStarted/topics/set_up/Python_setup.html), after which integrating my heuristic output into the CPLEX model is actually really easy. Hot-starting is explained [here](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.1/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/mip/para/49_mipStarts.html), but may not always be possible. – Nelewout Aug 16 '18 at 16:15
  • 1
    @N.Wouda Sorry but just to clarify, by "heuristic output" do you mean that for e.g., in the case of a routing problem with an assignment to each vehicle (order batching), if an assignment heuristic is used initially, then the heuristic output in the form of assignments for each vehicle will be inserted into the routing model? – Stoner Aug 16 '18 at 16:33
  • For e.g. we obtain that vehicle 1 has a set of orders {1,2,3} and vehicle 2 has a set of orders {4,5,6} from the assignment heuristic, and the full original model has the assignments for each vehicle in the form: v_i <= 6, i=1,2 (where v_i denotes the elements/locations in the set of orders)? – Stoner Aug 16 '18 at 16:35
  • The idea is that the output variables for both the heuristic and the linear programme are the same: both should output assignment decisions. Fundamentally, they should solve the same problem. Only then can you (easily) compare outcomes. – Nelewout Aug 16 '18 at 16:37
  • @N.Wouda Ah.. Do you mean that its just another way of solving the problem, but to implement the heuristic, I have to somehow integrate it into the solver used? – Stoner Aug 17 '18 at 03:22
  • 1
    Yes, it (generally, but not always) is another way to solve the problem. Note that sometimes it may also solve part of the problem, these are partial heuristics. The solver is used for linear programming/optimal solutions - heuristics can be written in any programming language. – Nelewout Aug 17 '18 at 07:42
  • @N.Wouda Thank you for the explanations. By any chance, do you know of any available examples which I can have access to online? I'm very new to this area (have been only in the textbook side of heuristics) and I will really like to be able to implement my own heuristic on an optimization model.. – Stoner Aug 17 '18 at 13:08
  • 1
    I do not know of any direct stuff, but most papers in OR do deal with this two-step procedure. I'd invite you to read publications. One I came across when quickly searching github for code is [this](https://github.com/mrocklin/heft) (and [here](https://ieeexplore.ieee.org/document/993206/)). – Nelewout Aug 18 '18 at 07:55
  • @N.Wouda Thanks for the share! I will take a look at them, and hopefully I it'll work out. :) – Stoner Aug 18 '18 at 09:23

0 Answers0