What is the best way to implement cost matrix?

When optimizing routes, I needed to create a cost matrix.
After searching the forum, I found several solutions. Which one is more preferable in view of the accuracy and speed of calculations?

  1. Using GreatCircleDistanceCalculator (Haversine)
  1. Using another library or implementing custom solution (for example - Vincenty instead Haversine)
  1. Getting distance & time from graphhopper for every pair of coordinates.

Thanks in advance for your help!


1 Like

If I understand you correctly, then you recommend using the OSRM API to implement the cost matrix?
Many thanks

I recommend using the hosted Matrix API: Documentation - GraphHopper Directions API

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.