@staticmethod
def get_path_to_node(node):
    """
        Return the path from the root to the node.

        Parameters
        ----------
        node : OptNode

        Returns
        -------
        list of OptNode

        """
    rev_path = [node]
    while node.parent is not None:
        rev_path.append(node.parent)
        node = node.parent
    return list(reversed(rev_path))
