def match_node(goal_node):
    """
    Returns a goal_op function (to be used in search functions) that returns true
    if the last_node of the current path is the supplied goal node. This can be used
    when the goal node is a static node in the graph (as opposed to looking for a node
    with certain properties).

    :param goal_node: The goal node that this goal_op will match with.
    :return: The goal_op function for matching the supplied goal_node.
    """
    return lambda graph, path: path.last_node == goal_node