ankane / or-tools-ruby

Operations research tools for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[VRPTW] Add SolveFromAssignmentWithParameters

iagopiimenta opened this issue · comments

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)

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