Routing and scheduling
route matrixroute matrixroute tsproute tsproute vrproute vrpsched singlesched singlesched flowshopsched flowshopsched jobshopsched jobshop
route matrix <json_points>
Description
Distance matrix (km) of [lat, lon] points
Distance matrix (km) of [lat, lon] points
Parameters
json_points: The points - String - required
json_points: The points - String - required
admin
route matrix "[[-20.8789, 55.4481], [-21.3393, 55.4781], [-21.0096, 55.2707]]"
mentdb
{"km": [[0, 51.28871357314482, 23.465055999849394], [51.28871357314482, 0, 42.50278055581894], [23.465055999849394, 42.50278055581894, 0]]}
route matrix <json_points> <json_params>
Description
Distance matrix with parameters: speed_kmh (gives the minutes)
Distance matrix with parameters: speed_kmh (gives the minutes)
Parameters
json_points: The points - String - required
json_params: The parameters - String - required
json_points: The points - String - required
json_params: The parameters - String - required
admin
route matrix "[[-20.8789, 55.4481], [-21.3393, 55.4781]]" "{\"speed_kmh\": 50}"
mentdb
{"km": [[0, 51.28871357314482], [51.28871357314482, 0]], "minutes": [[0, 61.54645628777378], [61.54645628777378, 0]]}
route tsp <json_points>
Description
Shortest tour through points starting and ending at the first one (nearest neighbor, 2-opt and or-opt, 10 restarts)
Shortest tour through points starting and ending at the first one (nearest neighbor, 2-opt and or-opt, 10 restarts)
Parameters
json_points: The points [lat, lon] - String - required
json_points: The points [lat, lon] - String - required
admin
route tsp "[[-20.8789, 55.4481], [-20.9338, 55.6496], [-21.0096, 55.2707], [-21.3393, 55.4781], [-21.277, 55.5172], [-21.0341, 55.7128], [-21.165, 55.2889], [-20.9466, 55.2893]]"
mentdb
{"points": 8, "tour": [0, 7, 2, 6, 3, 4, 5, 1], "km": 146.8951072353951, "closed": true}
Complete: a table of stops -> points and names -> the tour
admin
-> "[rows]" "[{\"name\": \"Saint-Denis\", \"lat\": -20.8789, \"lon\": 55.4481}, {\"name\": \"Saint-Andre\", \"lat\": -20.9338, \"lon\": 55.6496}, {\"name\": \"Saint-Paul\", \"lat\": -21.0096, \"lon\": 55.2707}, {\"name\": \"Saint-Pierre\", \"lat\": -21.3393, \"lon\": 55.4781}, {\"name\": \"Le Tampon\", \"lat\": -21.277, \"lon\": 55.5172}, {\"name\": \"Saint-Benoit\", \"lat\": -21.0341, \"lon\": 55.7128}, {\"name\": \"Saint-Leu\", \"lat\": -21.165, \"lon\": 55.2889}, {\"name\": \"Le Port\", \"lat\": -20.9466, \"lon\": 55.2893}]"; json load "tuto_t" (route tsp (ml prep matrix [rows] "[\"lat\", \"lon\"]") (concat "{\"names\": " (ml prep vector [rows] "name") "}")); -> "[res]" (concat (math round (json select "tuto_t" "/km") 1) " km: " (json select "tuto_t" "/tour_names")); json unload "tuto_t"; [res]
mentdb
146.9 km: [ "Saint-Denis", "Le Port", "Saint-Paul", "Saint-Leu", "Saint-Pierre", "Le Tampon", "Saint-Benoit", "Saint-Andre" ]
route tsp <json_points> <json_params>
Description
Tour with parameters: input (points or matrix: your own distance or time matrix), start, return (false: open path), restarts, seed, names
Tour with parameters: input (points or matrix: your own distance or time matrix), start, return (false: open path), restarts, seed, names
Parameters
json_points: The points or the matrix - String - required
json_params: The parameters - String - required
json_points: The points or the matrix - String - required
json_params: The parameters - String - required
admin
route tsp "[[-20.8789, 55.4481], [-20.9338, 55.6496], [-21.0096, 55.2707], [-21.3393, 55.4781], [-21.277, 55.5172], [-21.0341, 55.7128], [-21.165, 55.2889], [-20.9466, 55.2893]]" "{\"return\": false, \"names\": [\"Saint-Denis\", \"Saint-Andre\", \"Saint-Paul\", \"Saint-Pierre\", \"Le Tampon\", \"Saint-Benoit\", \"Saint-Leu\", \"Le Port\"]}"
mentdb
{"points": 8, "tour": [0, 7, 2, 6, 3, 4, 5, 1], "km": 125.09232698698634, "closed": false, "tour_names": ["Saint-Denis", "Le Port", "Saint-Paul", "Saint-Leu", "Saint-Pierre", "Le Tampon", "Saint-Benoit", "Saint-Andre"]}
Own matrix
admin
route tsp "[[0, 10, 15, 20], [10, 0, 35, 25], [15, 35, 0, 30], [20, 25, 30, 0]]" "{\"input\": \"matrix\"}"
mentdb
{"points": 4, "tour": [0, 1, 3, 2], "length": 80, "closed": true}
route vrp <json_depot> <json_customers> <capacity>
Description
Vehicle routing from a depot: customers [lat, lon, demand, open_minute, close_minute, service_minutes], vehicle capacity; Clarke-Wright savings then 2-opt; routes with load, km, arrival times
Vehicle routing from a depot: customers [lat, lon, demand, open_minute, close_minute, service_minutes], vehicle capacity; Clarke-Wright savings then 2-opt; routes with load, km, arrival times
Parameters
json_depot: The depot [lat, lon] - String - required
json_customers: The customers - String - required
capacity: The vehicle capacity - Number - required
json_depot: The depot [lat, lon] - String - required
json_customers: The customers - String - required
capacity: The vehicle capacity - Number - required
admin
route vrp "[-21.0, 55.5]" "[[-20.9, 55.5, 3, 0, 600, 10], [-20.95, 55.62, 2, 0, 600, 10], [-21.05, 55.7, 4, 120, 240, 15], [-21.3, 55.5, 3, 0, 600, 10], [-21.25, 55.4, 2, 0, 600, 10], [-21.15, 55.3, 3, 0, 300, 10], [-21.0, 55.28, 1, 0, 600, 5]]" 8
mentdb
{"vehicles_used": 3, "total_km": 195.32153714527544, "routes": [{"customers": [0, 6], "load": 4, "km": 59.36569953913166, "start_minute": 0, "return_minute": 104.04854930869749, "arrival_minutes": [16.67926203503049, 64.7914003698967]}, {"customers": [1, 2], "load": 6, "km": 49.011998221390456, "start_minute": 0, "return_minute": 167.23510860584219, "arrival_minutes": [20.465150863137538, 120]}, {"customers": [3, 4, 5], "load": 8, "km": 86.9438393847533, "start_minute": 0, "return_minute": 160.41575907712996, "arrival_minutes": [50.03778610508987, 77.6764005454789, 110.48023563693965]}]}
route vrp <json_depot> <json_customers> <capacity> <json_params>
Description
Vehicle routing with parameters: vehicles (warning if more are needed), speed_kmh (40), start_minute, max_route_minutes, max_route_km, depot_close_minute, service_minutes (default)
Vehicle routing with parameters: vehicles (warning if more are needed), speed_kmh (40), start_minute, max_route_minutes, max_route_km, depot_close_minute, service_minutes (default)
Parameters
json_depot: The depot - String - required
json_customers: The customers - String - required
capacity: The capacity - Number - required
json_params: The parameters - String - required
json_depot: The depot - String - required
json_customers: The customers - String - required
capacity: The capacity - Number - required
json_params: The parameters - String - required
admin
route vrp "[-21.0, 55.5]" "[[-20.9, 55.5, 3, 0, 600, 10], [-20.95, 55.62, 2, 0, 600, 10], [-21.05, 55.7, 4, 120, 240, 15], [-21.3, 55.5, 3, 0, 600, 10], [-21.25, 55.4, 2, 0, 600, 10], [-21.15, 55.3, 3, 0, 300, 10], [-21.0, 55.28, 1, 0, 600, 5]]" 8 "{\"start_minute\": 60, \"speed_kmh\": 35, \"max_route_minutes\": 360}"
mentdb
{"vehicles_used": 3, "total_km": 195.32153714527544, "routes": [{"customers": [0, 6], "load": 4, "km": 59.36569953913166, "start_minute": 60, "return_minute": 176.7697706385114, "arrival_minutes": [79.06201375432056, 132.61874327988193]}, {"customers": [1, 2], "load": 6, "km": 49.011998221390456, "start_minute": 60, "return_minute": 171.8401241209625, "arrival_minutes": [83.38874384358576, 120]}, {"customers": [3, 4, 5], "load": 8, "km": 86.9438393847533, "start_minute": 60, "return_minute": 239.04658180243425, "arrival_minutes": [117.18604126295986, 147.3444577662616, 183.4059835850739]}]}
Used in use cases (1 recipe)
Logistics & supply chain › Delivery tours with capacities and time windows
Logistics & supply chain › Delivery tours with capacities and time windows
sched single <json_jobs>
Description
One machine: the sequences of the rules SPT, WSPT, EDD and Moore-Hodgson for jobs {"name", "p", "due", "weight"}, with completion times, lateness, tardy jobs
One machine: the sequences of the rules SPT, WSPT, EDD and Moore-Hodgson for jobs {"name", "p", "due", "weight"}, with completion times, lateness, tardy jobs
Parameters
json_jobs: The jobs - String - required
json_jobs: The jobs - String - required
admin
sched single "[{\"name\": \"A\", \"p\": 4, \"due\": 6}, {\"name\": \"B\", \"p\": 3, \"due\": 5}, {\"name\": \"C\", \"p\": 2, \"due\": 8}, {\"name\": \"D\", \"p\": 5, \"due\": 9, \"weight\": 2}, {\"name\": \"E\", \"p\": 1, \"due\": 4}]"
mentdb
{"rules": [{"rule": "spt", "total_weighted_completion": 50, "tardy_jobs": 3, "total_weighted_tardiness": 17, "max_lateness": 6, "sequence": [{"job": "E", "start": 0, "completion": 1, "lateness": -3, "tardiness": 0}, {"job": "C", "start": 1, "completion": 3, "lateness": -5, "tardiness": 0}, {"job": "B", "start": 3, "completion": 6, "lateness": 1, "tardiness": 1}, {"job": "A", "start": 6, "completion": 10, "lateness": 4, "tardiness": 4}, {"job": "D", "start": 10, "completion": 15, "lateness": 6, "tardiness": 6}]}, {"rule": "wspt", "total_weighted_completion": 46, "tardy_jobs": 2, "total_weighted_tardiness": 15, "max_lateness": 9, "sequence": [{"job": "E", "start": 0, "completion": 1, "lateness": -3, "tardiness": 0}, {"job": "C", "start": 1, "completion": 3, "lateness": -5, "tardiness": 0}, {"job": "D", "start": 3, "completion": 8, "lateness": -1, "tardiness": 0}, {"job": "B", "start": 8, "completion": 11, "lateness": 6, "tardiness": 6}, {"job": "A", "start": 11, "completion": 15, "lateness": 9, "tardiness": 9}]}, {"rule": "edd", "total_weighted_completion": 53, "tardy_jobs": 3, "total_weighted_tardiness": 16, "max_lateness": 6, "sequence": [{"job": "E", "start": 0, "completion": 1, "lateness": -3, "tardiness": 0}, {"job": "B", "start": 1, "completion": 4, "lateness": -1, "tardiness": 0}, {"job": "A", "start": 4, "completion": 8, "lateness": 2, "tardiness": 2}, {"job": "C", "start": 8, "completion": 10, "lateness": 2, "tardiness": 2}, {"job": "D", "start": 10, "completion": 15, "lateness": 6, "tardiness": 6}]}, {"rule": "moore", "total_weighted_completion": 51, "tardy_jobs": 2, "total_weighted_tardiness": 16, "max_lateness": 6, "sequence": [{"job": "E", "start": 0, "completion": 1, "lateness": -3, "tardiness": 0}, {"job": "B", "start": 1, "completion": 4, "lateness": -1, "tardiness": 0}, {"job": "C", "start": 4, "completion": 6, "lateness": -2, "tardiness": 0}, {"job": "A", "start": 6, "completion": 10, "lateness": 4, "tardiness": 4}, {"job": "D", "start": 10, "completion": 15, "lateness": 6, "tardiness": 6}]}], "advice": "spt minimizes the mean flow time, wspt the total weighted completion time, edd the maximum lateness, moore the number of tardy jobs"}
sched single <json_jobs> <json_params>
Description
One machine with parameters: rule (spt, wspt, edd, moore, compare)
One machine with parameters: rule (spt, wspt, edd, moore, compare)
Parameters
json_jobs: The jobs - String - required
json_params: The parameters - String - required
json_jobs: The jobs - String - required
json_params: The parameters - String - required
admin
sched single "[{\"name\": \"A\", \"p\": 4, \"due\": 6}, {\"name\": \"B\", \"p\": 3, \"due\": 5}, {\"name\": \"C\", \"p\": 2, \"due\": 8}, {\"name\": \"D\", \"p\": 5, \"due\": 9}, {\"name\": \"E\", \"p\": 1, \"due\": 4}]" "{\"rule\": \"moore\"}"
mentdb
{"rule": "moore", "total_weighted_completion": 36, "tardy_jobs": 2, "total_weighted_tardiness": 10, "max_lateness": 6, "sequence": [{"job": "E", "start": 0, "completion": 1, "lateness": -3, "tardiness": 0}, {"job": "B", "start": 1, "completion": 4, "lateness": -1, "tardiness": 0}, {"job": "C", "start": 4, "completion": 6, "lateness": -2, "tardiness": 0}, {"job": "A", "start": 6, "completion": 10, "lateness": 4, "tardiness": 4}, {"job": "D", "start": 10, "completion": 15, "lateness": 6, "tardiness": 6}]}
sched flowshop <json_times>
Description
Flow shop (all jobs visit the machines in the same order): sequence minimizing the makespan (Johnson, optimal for 2 machines; NEH heuristic beyond), lower bound and Gantt chart
Flow shop (all jobs visit the machines in the same order): sequence minimizing the makespan (Johnson, optimal for 2 machines; NEH heuristic beyond), lower bound and Gantt chart
Parameters
json_times: The processing times (one row per job, one column per machine) - String - required
json_times: The processing times (one row per job, one column per machine) - String - required
admin
sched flowshop "[[3, 6], [5, 2], [1, 2], [6, 6], [7, 5]]"
mentdb
{"method": "johnson", "sequence": ["job2", "job0", "job3", "job4", "job1"], "makespan": 24, "lower_bound": 24, "gantt": [{"job": "job2", "machine": 0, "start": 0, "end": 1}, {"job": "job2", "machine": 1, "start": 1, "end": 3}, {"job": "job0", "machine": 0, "start": 1, "end": 4}, {"job": "job0", "machine": 1, "start": 4, "end": 10}, {"job": "job3", "machine": 0, "start": 4, "end": 10}, {"job": "job3", "machine": 1, "start": 10, "end": 16}, {"job": "job4", "machine": 0, "start": 10, "end": 17}, {"job": "job4", "machine": 1, "start": 17, "end": 22}, {"job": "job1", "machine": 0, "start": 17, "end": 22}, {"job": "job1", "machine": 1, "start": 22, "end": 24}]}
sched flowshop <json_times> <json_params>
Description
Flow shop with parameters: method (johnson or neh), names
Flow shop with parameters: method (johnson or neh), names
Parameters
json_times: The times - String - required
json_params: The parameters - String - required
json_times: The times - String - required
json_params: The parameters - String - required
admin
sched flowshop "[[5, 9, 8], [9, 3, 10], [9, 4, 5], [4, 8, 8]]" "{\"names\": [\"P1\", \"P2\", \"P3\", \"P4\"]}"
mentdb
{"method": "neh", "sequence": ["P4", "P2", "P1", "P3"], "makespan": 43, "lower_bound": 43, "gantt": [{"job": "P4", "machine": 0, "start": 0, "end": 4}, {"job": "P4", "machine": 1, "start": 4, "end": 12}, {"job": "P4", "machine": 2, "start": 12, "end": 20}, {"job": "P2", "machine": 0, "start": 4, "end": 13}, {"job": "P2", "machine": 1, "start": 13, "end": 16}, {"job": "P2", "machine": 2, "start": 20, "end": 30}, {"job": "P1", "machine": 0, "start": 13, "end": 18}, {"job": "P1", "machine": 1, "start": 18, "end": 27}, {"job": "P1", "machine": 2, "start": 30, "end": 38}, {"job": "P3", "machine": 0, "start": 18, "end": 27}, {"job": "P3", "machine": 1, "start": 27, "end": 31}, {"job": "P3", "machine": 2, "start": 38, "end": 43}]}
sched jobshop <json_jobs>
Description
Job shop (each job has its own route [[machine, time], ...]): active schedules by the rules SPT, LPT, MWKR, FIFO and 500 randomized ones, the best makespan with its Gantt chart and a lower bound
Job shop (each job has its own route [[machine, time], ...]): active schedules by the rules SPT, LPT, MWKR, FIFO and 500 randomized ones, the best makespan with its Gantt chart and a lower bound
Parameters
json_jobs: The jobs - String - required
json_jobs: The jobs - String - required
admin
sched jobshop "[[[2, 1], [0, 3], [1, 6], [3, 7], [5, 3], [4, 6]], [[1, 8], [2, 5], [4, 10], [5, 10], [0, 10], [3, 4]], [[2, 5], [3, 4], [5, 8], [0, 9], [1, 1], [4, 7]], [[1, 5], [0, 5], [2, 5], [3, 3], [4, 8], [5, 9]], [[2, 9], [1, 3], [4, 5], [5, 4], [0, 3], [3, 1]], [[1, 3], [3, 3], [5, 9], [0, 10], [4, 4], [2, 1]]]"
mentdb
{"rule": "randomized", "makespan": 55, "lower_bound": 47, "gantt": [{"job": "job2", "machine": "2", "start": 0, "end": 5}, {"job": "job1", "machine": "1", "start": 0, "end": 8}, {"job": "job0", "machine": "2", "start": 5, "end": 6}, {"job": "job2", "machine": "3", "start": 5, "end": 9}, {"job": "job0", "machine": "0", "start": 6, "end": 9}, {"job": "job1", "machine": "2", "start": 8, "end": 13}, {"job": "job3", "machine": "1", "start": 8, "end": 13}, {"job": "job2", "machine": "5", "start": 9, "end": 17}, {"job": "job4", "machine": "2", "start": 13, "end": 22}, {"job": "job3", "machine": "0", "start": 13, "end": 18}, {"job": "job5", "machine": "1", "start": 13, "end": 16}, {"job": "job1", "machine": "4", "start": 13, "end": 23}, {"job": "job0", "machine": "1", "start": 16, "end": 22}, {"job": "job5", "machine": "3", "start": 16, "end": 19}, {"job": "job2", "machine": "0", "start": 18, "end": 27}, {"job": "job5", "machine": "5", "start": 19, "end": 28}, {"job": "job3", "machine": "2", "start": 22, "end": 27}, {"job": "job4", "machine": "1", "start": 22, "end": 25}, {"job": "job0", "machine": "3", "start": 22, "end": 29}, {"job": "job4", "machine": "4", "start": 25, "end": 30}, {"job": "job2", "machine": "1", "start": 27, "end": 28}, {"job": "job5", "machine": "0", "start": 28, "end": 38}, {"job": "job1", "machine": "5", "start": 28, "end": 38}, {"job": "job3", "machine": "3", "start": 29, "end": 32}, {"job": "job2", "machine": "4", "start": 30, "end": 37}, {"job": "job3", "machine": "4", "start": 37, "end": 45}, {"job": "job1", "machine": "0", "start": 38, "end": 48}, {"job": "job0", "machine": "5", "start": 38, "end": 41}, {"job": "job4", "machine": "5", "start": 41, "end": 45}, {"job": "job3", "machine": "5", "start": 45, "end": 54}, {"job": "job5", "machine": "4", "start": 45, "end": 49}, {"job": "job4", "machine": "0", "start": 48, "end": 51}, {"job": "job1", "machine": "3", "start": 48, "end": 52}, {"job": "job5", "machine": "2", "start": 49, "end": 50}, {"job": "job0", "machine": "4", "start": 49, "end": 55}, {"job": "job4", "machine": "3", "start": 52, "end": 53}]}
sched jobshop <json_jobs> <json_params>
Description
Job shop with parameters: rule (spt, lpt, mwkr, fifo or best), iterations (randomized schedules), seed, names
Job shop with parameters: rule (spt, lpt, mwkr, fifo or best), iterations (randomized schedules), seed, names
Parameters
json_jobs: The jobs - String - required
json_params: The parameters - String - required
json_jobs: The jobs - String - required
json_params: The parameters - String - required
admin
sched jobshop "[[[\"cut\", 3], [\"weld\", 2]], [[\"weld\", 4], [\"cut\", 1]], [[\"cut\", 2], [\"paint\", 3]]]" "{\"rule\": \"spt\"}"
mentdb
{"rule": "spt", "makespan": 10, "lower_bound": 6, "gantt": [{"job": "job2", "machine": "cut", "start": 0, "end": 2}, {"job": "job1", "machine": "weld", "start": 0, "end": 4}, {"job": "job2", "machine": "paint", "start": 2, "end": 5}, {"job": "job1", "machine": "cut", "start": 4, "end": 5}, {"job": "job0", "machine": "cut", "start": 5, "end": 8}, {"job": "job0", "machine": "weld", "start": 8, "end": 10}]}
Used in use cases (1 recipe)
Operations researcher › Workshop: job shop schedule and assignment of the operators
Operations researcher › Workshop: job shop schedule and assignment of the operators
