ankane / or-tools-ruby

Operations research tools for Ruby
Apache License 2.0
179 stars 25 forks source link

[VRPTW] Add SolveFromAssignmentWithParameters #39

Closed iagopiimenta closed 2 years ago

iagopiimenta commented 2 years ago

I'm trying to define initial routes to the solver, but it is missing solve_from_assignment_with_parameters API.

Would it be possible to add solve_from_assignment_with_parameters?

# https://developers.google.com/optimization/routing/routing_tasks#setting-initial-routes-for-a-search
# python example: 
initial_solution = routing.ReadAssignmentFromRoutes(data['initial_routes'],
                                                    True)
print('Initial solution:')
print_solution(data, manager, routing, initial_solution)

# Set default search parameters.
search_parameters = pywrapcp.DefaultRoutingSearchParameters()

# Solve the problem.
solution = routing.SolveFromAssignmentWithParameters(
    initial_solution, search_parameters)
ankane commented 2 years ago

Hey @iagopiimenta, thanks for reporting! Added in the commit above.