def most_important_to_source(most_important, up=True):
    """ Function for computing a path from most important node to a source

    Parameters
    ----------
    most_important: Node\n
        \tnode from which, following predecessors, one gets to the beginning of the path
    up: bool\n
        \tboolean for chosing which path to build, if the one from the most important node
        \tto the start or to the end  
    """

    path = [most_important]

    # follow predecessors
    step = most_important.predecessor
    while step is not None:
        path = [step] + path
        step = step.predecessor

    if not up:
        return path[::-1]

    return path