Route optimization for MWS410 with OptiMap (continued)

Today I unbury old scripts from my archives, and I post them here and on my GitHub.

This script illustrates how to integrate the M3 Delivery Toolbox – MWS410/B with OptiMap – Fastest Roundtrip Solver to calculate and show on Google Maps the fastest roundtrip from the Warehouse to the selected Delivery addresses; it’s an application of the Traveling Salesman Problem (TSP) to M3. This is interesting for a company to reduce overall driving time and cost, and for a driver to optimize its truck load according to the order of delivery.


The Warehouse (WHLO) is now detected from the selected rows, and its address is dynamically retrieved using API MMS005MI.GetWarehouse; no need to specify the Warehouse address as a parameter anymore.

Create a view in M3 Delivery Toolbox MWS410/B that shows the address fields in the columns (e.g. ADR1, ADR2, ADR3), and set the field names in the parameter of the script.

8 10 13

OptiMap_V4  [PENDING]

Add ability to Export OptiMap’s route to M3 Loading (MULS) and Unloading sequence (SULS) using API MYS450MI.AddDelivery, closing the loop of integrating M3 to OptiMap.

This is an idea for version 4. Script to be developed…

Source code

I posted the source code on my GitHub.

Related posts

Published by


M3 Technical Consultant

5 thoughts on “Route optimization for MWS410 with OptiMap (continued)”

  1. Hey Thibaud. How is it going ? This one is interesting. Your script is working fine. Thinking about v4… Have you ever think about how to retrieve the result from Optimap ? I see we can use labels for our addresses. I don’t understand how you can pass labels in the query; it could be useful if you click later on “export raw path with labels”. At the end, MYS450MI/AddDelivery allows us to update SULS and MULS. If you attach the deliveries to a shipment and print the loading/unloading list in DRS100, the sorting on the printout corresponds to what you have uploaded.


    1. Hi Maxime,

      I am doing good thank you. Glad to read you again here.

      I do not have plans to develop V4, although I would like to if the opportunity arises. Feel free to develop it yourself and publish it here if you want; that would be great.

      As for retrieving the result from OptiMap, it should be possible with the correct HTTP request from the Smart Office script and process the result, instead of simply using LaunchTask.

      It is also possible to calculate and visualize the shortest path of a picking list inside the warehouse; see my series on Warehouse Optimization.

      As for the labels, I have not explored that. It looks really interesting and would be good to have.

      Are you working on something similar at your work? Please come write a blog post about your experience with this topic, the results, new version of the script, or anything that could be useful to others too.




  2. In fact, you can use labels by adding : namei=xxxx before &loc(i+1)
    ex : name0=ADR0&loc0=…&name1=ADR1&loc1=…
    The base http request is :
    Row path with labels result :
    ADR0: (46.9431271, 6.8467862999999625)
    ADR1: (48.6917395, 6.181768299999931)
    ADR3: (48.8426079, 2.3233072000000447)
    ADR0: (46.9431271, 6.8467862999999625)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s