# Matrices ## Compute a matrix - [POST /matrix](https://docs.graphhopper.com/openapi/matrices/postmatrix.md): Calculate a matrix of travel times and/or distances between N origins and M destinations. This includes the common cases of routes from one origin to many destinations, or from many origins to one destination. ## Compute a matrix - [GET /matrix](https://docs.graphhopper.com/openapi/matrices/getmatrix.md): For N origins and M destinations, compute routes from all origins to all destinations and output the result as a matrix of travel times and/or distances. This includes the common cases of routes from one origin to many destinations, or from many origins to one destination. ## Submit a matrix computation job - [POST /matrix/calculate](https://docs.graphhopper.com/openapi/matrices/calculatematrix.md): An alternate endpoint for computing a large matrix asynchronously, where a request against the regular endpoint would result in a timeout. The request format is the same, but instead of the result, you are given a job identification number that you can use to retrieve the result once it is available. In most cases, prefer the regular endpoints. Here are some full examples via curl: Pick the returned and use it in the next GET requests: When the calculation is finished () the JSON response will contain the full matrix JSON under : Please note that if an error occured while calculation the JSON will not have a status but contain directly the error message e.g.: And the optional array. ## Retrieve result of a matrix computation job - [GET /matrix/solution/{jobId}](https://docs.graphhopper.com/openapi/matrices/getmatrixsolution.md)