VROOM-Project / vroom

Vehicle Routing Open-source Optimization Machine
http://vroom-project.org/
BSD 2-Clause "Simplified" License
1.34k stars 337 forks source link

Want route based on number of vehicles #328

Closed trumboosahil closed 4 years ago

trumboosahil commented 4 years ago

This always give only one route when i put 3 vehicles what do you expect in matrix travel time or distance

curl --header "Content-Type:application/json" --data 
'{"matrix":[[0,48330,104676,173513,224287,208967,178772,266879,292761,67117,173595],[49329,0,64907,134882,184518,162506,139003,239804,265686,48895,145374],[104180,63750,0,78540,135057,102669,89542,190343,216225,69989,95913],[173782,133327,78545,0,74928,52916,74559,124886,156191,108841,95913],[224061,183631,136160,74928,0,37498,60545,70011,106826,159145,80495],[213067,150808,103337,52867,37449,0,23048,80923,112811,124147,49270],[193096,137681,91619,75914,60496,23048,0,94364,135858,111020,29936],[271421,232026,184555,124829,70011,80975,94091,0,48884,205556,91944],[303698,264303,216832,156165,106857,112781,139446,48884,0,237833,124221],[67155,48770,69950,108822,159206,124116,112594,212398,238280,0,117968],[184763,145368,97897,95912,80494,49318,29984,91790,124123,118898,0]],"vehicles":[{"id":0,"start_index":0},{"id":1,"start_index":0},{"id":2,"start_index":0}],"jobs":[{"id":0,"location_index":0},{"id":1,"location_index":1},{"id":2,"location_index":2},{"id":3,"location_index":3},{"id":4,"location_index":4},{"id":5,"location_index":5},{"id":6,"location_index":6},{"id":7,"location_index":7},{"id":8,"location_index":8},{"id":9,"location_index":9},{"id":10,"location_index":10}]}' http://localhost:3000
jcoupey commented 4 years ago

This is similar to #327 because based on the constraints you provide in input (or lack of constraints), there is no need to use all 3 vehicles. We output only one route because doing everything with one vehicle is cheaper, so this is expected behaviour.

If you want to "force" using all vehicles, resulting in a more expensive solution, this has to be the result of constraints you provide in input, such as capacity, time windows, skills etc.

Please check the documentation and the provided examples for more on constraints. You might also want to check out generic resources on vehicle routing problems with keywords like CVRP or VRPTW.