4 ms·
Your best bet is to calculate a full cost (time/distance) matrix upfront before running the optimisation. Both Google and GraphHopper offer cost matrix calcula
by n4r9 9y ago
Your best bet is to calculate a full cost (time/distance) matrix upfront before running the optimisation.
Both Google and GraphHopper offer cost matrix calculations as part of their web API. I imagine in both cases you need an expensive API key though.
If you're going to use GraphHopper, you might as well install it yourself, import the OpenStreetMap file for the region you want, and use it to calculate the cost matrix on your own computer for free!
- edshiro 9y agoYes good point. Pre-loading the full distance matrix is the right thing to do here. That's what we were doing at a startup as I was at a few years ago. GraphHopper is quite expandable so it is nice to work with once you understand how it functions. But you definitely need to put your Java hat on :).