mamut_routing_tools.generation.matrices¶
Distance/time/euclidean matrices for a set of instance vertices, plus the depot-edge road geometry the workbench meta files embed.
Shortest = metres, fastest = seconds (3.6 * metres / km-per-hour class speed), both ceil'd to int, exactly like the Julia workbench. Matrix rows are computed with scipy's C Dijkstra over the road graph in CSR form.
metric_csr
¶
The road graph as a CSR weight matrix under one metric.
shortest weights are edge lengths in metres, fastest are free-flow
traversal times in seconds. Public because the campaign city profiler runs
its own partial Dijkstras over exactly these weights.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/generation/matrices.py
compute_matrices
¶
compute_matrices(graph: RoadGraph, vertices: list[int]) -> tuple[list[list[int]], list[list[int]], EdgeGeometry, EdgeGeometry]
(D_short, D_fast, depot-edge geometry per metric) for instance vertices.
Geometry covers exactly the depot edges the workbench meta embeds: from the
depot (vertices[0]) to every customer, and from every customer back to the
depot, keyed "{u}_{v}" on graph vertex ids with [lon, lat] polylines.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/generation/matrices.py
euclidean_matrix_from_vertices
¶
euclidean_matrix_from_vertices(graph: RoadGraph, vertices: list[int]) -> tuple[list[list[int]], list[tuple[float, float]]]
ENU-plane euclidean matrix (ceil'd metres) + per-vertex ENU coords.