This approach makes use of Mapbox GL JS to display the map and the Optimization API to calculate the best route.
Also makes use of Google Maps API for reverse geocoding and auto-comple for addresses.
You will need to request API tokens for both APIs, see instructions below:
Configuration:
Set respective site properties values for the APIs keys inside the TravellingSalesmanProblem module:
Solution build was based on the sample tutorial available here: https://docs.mapbox.com/help/tutorials/optimization-api/
How to use:
Example: