I am trying to solve vehicle routing problem in java and I am looking for libraries for the same. I did a POC using google or-tools and it seems to be solving all my use cases. I would like to know if anyone in the community has used OR-tools libraries in production and if yes, what are the problems I have to look out for ?

If not google or-tools, what are the other VRP java libraries you are using and how was your experience using them in production ? I am particularly interested in jsprit/ Optaplanner/or-tools etc., w.r.t ease of use, maintainability (when new constraints have to be added) and the performance in production.


  • 1
    $\begingroup$ Traffic on or.stackexchange is low. You will have more chances to get an answer if you ask on the mailing list groups.google.com/forum/#!forum/or-tools-discuss $\endgroup$ Mar 18, 2020 at 9:42
  • 2
    $\begingroup$ Would you try googling your issue? There are many software/framework which using Java to solve the VRP variants problems. E.g. this, this, this and this links. I hope they would be helpful. $\endgroup$
    – A.Omidi
    Mar 18, 2020 at 10:18

1 Answer 1


I am obviously biased, but if you're looking to do VRP in a Java environment, do take a look at this guide for OptaPlanner that builds a JSON REST service for school timetabling from scratch. It supports logging, database integration and native compilation (yes, Java does that now). In general, OptaPlanner works with Maven or Gradle - Java, Kotlin or Scala - Quarkus or Spring Boot - JDK HotSpot or GraalVM: it's all good.

OptaPlanner is heavily used for the Vehicle Routing Problem, including Fortune 500 customers, such as cases with tens of thousands of vehicles that privately benchmarked it against 3 other implementations (including Google OR tools) and found OptaPlanner had the best results. Your mileage may vary, of course. Especially if you don't powertweak it. We should do open, independent benchmarks between vendors to confirm this and give each vendor a chance to tweak their stuff (private benchmarks aren't fair). Do note that it's a very different philosophy (OO+FP) than traditional solvers (math equations).

To get started with VRP, take a look at optaplanner-examples which has a VRP example and optaweb-vehicle-routing which has OpenStreetMap integration.

  • $\begingroup$ I extracted the zip file of the optaweb after downloading it from Github, I am trying to run optaweb but it is giving me an error ( Cannot resolve symbol 'DepotAngleVisitDifficultyWeightFactory') 'org.optaweb.vehiclerouting.plugin.planner.weight.DepotAngleVisitDifficultyWeightFactory' is imported but the console says that the library is not used ...... Any idea ? $\endgroup$ Mar 20 at 0:43
  • $\begingroup$ It has some trouble recently. I know this simplified quickstarts version works out-of-the-box, but it can use severe optimization config wise: github.com/kiegroup/optaplanner-quickstarts/tree/stable/… $\endgroup$ Mar 20 at 13:31
  • $\begingroup$ this quickstart worked, it showed a map of 2 depots and customers in an italian city... I want this to run for 4 depots and greater number of customers, what should i do exactly ?? $\endgroup$ Mar 21 at 23:40
  • $\begingroup$ Adjust the demo generating code which you can find here: github.com/kiegroup/optaplanner-quickstarts/tree/stable/… $\endgroup$ Mar 22 at 5:55
  • $\begingroup$ I have a dataset of 145 customer and 4 depots with their location Lat&Long Coordinates and a demand for each customer.... I want to import this to the model, what source code I should use for this purpose ?.. The demo contains a randomly generated list of customers not an imported dataset $\endgroup$ Mar 22 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.