0

I'm building a routing service in Java with routing tools like graphhopper for generating routes between points, and jsprit for vehicle routing problems embedded in app through Maven.

In jsprit, a cost matrix can be added which marks the time and distance between 2 points in the matrix. But that would mean that for each edge in the graph, I would have to make a request to graphhopper to get the info.

My question is, if that's the correct way to handle this problem? I have searched over the API and cannot find an option to generate matrix. What is the best practice for this scenario.

Thanks in advance

Karussell
  • 17,085
  • 16
  • 97
  • 197
AJ_1310
  • 3,303
  • 3
  • 19
  • 26

1 Answers1

2

Creating the matrix is a good and straightforward way to handle the problem.

The community builds a solution, at the moment doing the matrix in brute force manner (two for loops). But there are more efficient ways to generate the matrix like we do in our commercial offering.

Note: I'm the author of GraphHopper

Karussell
  • 17,085
  • 16
  • 97
  • 197
  • Hi Karussell, thank you for the input, could you provide an example? The ones I have found are outdated from 2014. – AJ_1310 Jun 18 '16 at 18:47