How to efficiently combine distance matrices

Hi, I have the highest subscription available, but sometimes I need a matrix of larger than 150x150. I’ve come up several formulas to make several routexl matrix requests to populate a custom matrix of lets say 300 unique address. The problem is that if my custom matrix is any larger than the routexl limit (lets say 150 for this example), then i’m looking at about 4-6 different requests at least, and a lot of duplication of addresses between them.

I’m looking for a way to populate a custom (larger than 150x150) matrix without taxing routexl servers or a lot of waste. The ideal solution is a one-to-all matrix instead of an all-to-all. Is that possible with Routexl?

btw thats only ideal if the processing time scales logically, i.e. a 1x100 matrix takes 1% of the processing time of a 100x100 matrix. I don’t actually know if it scales like that

If there are any other efficient ways to create a matrix of matrices, that would work too.

The current maximum is 150 locations per request, either for distance matrix or route optimization. For 300 points you should be able to populate a custom matrix with 4 requests:

  1. the first 150 against the first 150
  2. the first 150 against the second 150
  3. the second 150 against the first 150
    4. the second 150 against the second 150

Currently, the API calculates routes between each combination of locations seperately. Even if we’d increase the maximum number, the 4 requests 150x150 will take almost the same amount of time as 1 request 300x300. The only gain would be less connection time and maybe some caching.

You are right, we’re wrong. It’s currently N x N instead of N x M.

We’ll come back to this issue.

You could try to use the tour call and skip the optimization. This will return the locations in the same order, including cumulative travel durations and distances.

From the cumulative numbers it’s easy to calculate back to each pair. Each pair then represents one element in your total travel matrix.

Here is an example for 10 locations in a distance matrix of 20:

Thanks for the quick reply! Correct me if I’m wrong, but routexl uses an all-to-all method of creating the distance matrix, and only allows 150 max elements per request. So in your example of sending a single request of “the first 150 against the second 150” (which would be 300 unique addresses/elements), wouldn’t that mean sending 300 addresses in that request?

I might not be understanding you, I sorry if that’s the case. But the APIs as I read them aren’t very flexible when it comes to distance matrices.

The best solution I have is what I mentioned before. Basically I would have to split the limit in half, so it would be (in the case of a 100 element limit):

Request 1: the first 100
Request 2: the second 100

This would populate 2 quadrants of a 200-element custom matrix. Then it gets messy, some of the future requests overlapping with the first 2:

Request 3: the first and third blocks of 50 elements
Request 4: the second and forth blocks
Request 5: the first and forth
Request 6: the second and third

I scratched this out quickly last night, but its all that I can come up with in an all-to-all matrix provider like routexl. All 6 requests would have the maximum number of elements allowed. And even if the custom matrix is 101 elements, all 6 requests are still needed.

So yes please clarify your response, because if its possible it is a much better solution