def make_parent_list(node):
    """
    Auxiliary function that can be used to trace a path back to the origin node from a leaf node.
    Returns an ordered list that goes from the root to the leaf.

    :node: the leaf node.
    """
    if node.pai == None:
        return [node]
    else:
        return make_parent_list(node.pai) + [node]