def sort_calculation_queue(graph_unsorted):
    """
    Sort the calculation queue.

    Returns
    -------
    list
    """
    graph_sorted = []
    while graph_unsorted:
        acyclic = False
        for item in graph_unsorted:
            for edge in item[1]:
                if edge in dict(graph_unsorted):
                    break
            else:
                acyclic = True
                graph_unsorted.remove(item)
                graph_sorted.append(item[0])
        if not acyclic:
            raise RuntimeError('A cyclic dependency occurred')
    return graph_sorted[::-1]
