def get_routes(solution, routing, manager):
    """Get vehicle routes from a solution and store them in an array."""
    # Get vehicle routes and store them in a two dimensional array whose
    # i,j entry is the jth location visited by vehicle i along its route.
    routes = []    
    for route_nbr in range(routing.vehicles()):      
      index = routing.Start(route_nbr)           
      route = [manager.IndexToNode(index)]     

      while not routing.IsEnd(index):
        index = solution.Value(routing.NextVar(index))        
        route.append(manager.IndexToNode(index))       

      routes.append(route)      
    return routes[0]