def reconstruct_path(came_from, current_node):
    """
    came_from : dictionary of nodes and nodes before them in the shortest found path
    current_node : the last node of the path
    """
    if current_node in came_from:
        p = reconstruct_path(came_from,came_from[current_node])
        return p + [current_node]
    else:
        return []