def optimize(tutorials):
    tutorials = [frozenset(tutorial) for tutorial in tutorials]
topics = frozenset(topic for tutorial in tutorials for topic in tutorial)
cost = {frozenset(): 0}
predecessor = {}
for r in range(len(topics)):
    for s1_tuple in itertools.combinations(topics, r):
        s1 = frozenset(s1_tuple)
if s1 not in cost:
    continue
cost1 = cost[s1]
marginal_cost = sum(not tutorial.issubset(s1) for tutorial in tutorials)
for tutorial in tutorials:
    pass
Optimise Algorithm to find Gradual Learning Curve