ankane / or-tools-ruby

Operations research tools for Ruby
Apache License 2.0
173 stars 22 forks source link

Add 2 methods to RoutingModel class #9

Closed starchow closed 3 years ago

starchow commented 3 years ago

Dear @ankane,

Thank you for making this gem.

When using it to solve Vehicle Routing Problem, I faced with 2 problems

  1. Sometimes OR-tools can't solve the problem cause the parameters are not solvable. I usually get this error message [BUG] Segmentation fault at 0x0000000000000018 when I call solution.value(routing.next_var(index)) So, I added RoutingModel status method to check it before call routing.next_var https://google.github.io/or-tools/cpp_routing/classoperations__research_1_1_routing_model.html#a67a0db04d321a74b7e7fcfd3f1a3f70b

  2. I also added this method add_dimension_with_vehicle_transits to solve Vehicle Routing with Different Vehicle Speed Problem https://google.github.io/or-tools/cpp_routing/classoperations__research_1_1_routing_model.html#a66b87fec514d648c751ad9d4df09d05b

Please review this pull request, Thanks

starchow commented 3 years ago

Hey @starchow, thanks for the PR! Looks really great. I left two small comments inline.

I've just updated as your comments, thanks for your reviewing

ankane commented 3 years ago

Awesome, thanks @starchow!