I have a list of tuples of the form route_cost = [(route, vehicle, cost),...]. Consider that I have 2 routes and 3 vehicles, I want to find the cheapest allocation of 1 vehicle to route 1 and 1 vehicle to route 2. When a vehicle is used it can not be used again.
I considered using itertools.permutations(route_cost, 2) but this of course will consider permutations for every entry. Ideally, I could fix a route and a vehicle i for the route and sum over all other routes and vehicles not equal to the fixed route or i.