Skip to content

Conversation

@fiendskrah
Copy link

First shippable verison of route module referenced by #4 (defunct) and the initial PR by @ljwolf.

This work was completed during the Google Summer of Code 2025; a NumFOCUS-sponsored project for the Python Spatial Analysis Library (PySAL). See the project blog.

The spopt.route module wraps around the routingpy library to leverage street data for use in solving vehicle routing problems using PyVRP.

The user can setup a OSRM instance (described in the new notebook route.py) and then refer to it in the solve function:

from routingpy import OSRM
m.solve(stop=pyvrp.stop.MaxRuntime(60), routing=OSRM, routing_kws={"base_url": "http://localhost:5000"})

As well, the user can decide to not pass a router,

m.solve(stop=pyvrp.stop.MaxRuntime(60))

which will solve the problem using haversine distances.

Because spopt.route leverages the base functions in routingpy which are shared by all of the library's routers (matrix and directions), users should be able to pass the other API-enabled routers and get the same functionality if their required keywords are passed to routing_kws (e.g. for Valhalla, this would include the keyword "profile" : "auto"). The OSRM service is considered the 'default' use case, but other services should be simple to incorporate.

The new notebook route.py describes the confirmed functional routers in more detail.

@ljwolf
Copy link
Owner

ljwolf commented Sep 11, 2025

I'd like to merge this here to get this into spopt#465!

@ljwolf ljwolf merged commit 8b11450 into ljwolf:main Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants