for num_setups in range(1, 1 + len(job_requirements)):
    print('check combinations of %d setups' % num_setups)
setups = (c for c in chain(*(combinations(tools, i) for i in range(1, 1 +
    num_stations))) if len(set(tool[1] for tool in c)) == len(c))
for setups_comb in combinations(setups, num_setups):
    if all(any(satisfies_job(comb, job) for comb in setups_comb) for job in
        job_requirements):
        print('found valid tool setup combination:')
for comb in setups_comb:
    print(comb)
exit(0)
Алгоритм планирования заданий для минимизации изменений