12/32
Part 3 of 7 · CyclesLearn and do

Cycles: the order comes out short

Every graph so far had no cycle. Add one, and run your order_from_config on it.

A cycle stops Kahn's loop early, and the tasks on it never reach 0

# compile now needs test too
broken = needs + [("compile", "test")]
config = {task: [p for t, p in broken if t == task] for task in tasks}
order = order_from_config(config)
print(order)
print(len(order), "of", len(tasks), "tasks")
Predict

One pair is added: compile now needs test too. How many tasks make it into Kahn's order?

Pick one to see what it prints.
Pick an answer above to see the rest
Predict

Kahn's runs on the tasks lint and format, with the one pair ("lint", "lint"). What does it return?

Pick an answer above to see the rest