@classmethod
def linear_graph_from_list(cls, tasks):
    """A hepler function to create a graph of tasks with linear dependency"""
    graph = cls()
    for t in tasks:
        graph.add_task(t)
    for t1, t2 in zip(tasks[:-1], tasks[1:]):
        graph.add_dependency(t2, waiting_for=t1)
    return graph
